run-slicer-tests
Run the Slicer-based test suite for AdaptiveBrush.
Usage
/run-slicer-tests [--exit] [suite]
Where:
- •
--exit- Exit Slicer after tests complete (for automated iteration) - •
suiteis one of:- •
all(default) - Run all tests - •
algorithm- Run algorithm tests only - •
ui- Run UI tests only - •
workflow- Run workflow tests only - •
reviewer- Run all Reviewer module tests - •
reviewer_unit- Run Reviewer unit tests (SequenceRecorder, ViewGroupManager, Bookmarks) - •
reviewer_ui- Run Reviewer UI tests (navigation, bookmarks, playback, visualization, rating, keyboard) - •
reviewer_integration- Run Reviewer integration test (full workflow)
- •
What This Skill Does
- •Reads
SLICER_PATHfrom.envfile - •Launches Slicer with the test runner script
- •Executes registered test cases
- •Captures screenshots and metrics
- •Either exits (with
--exit) or leaves Slicer open for manual testing
Prerequisites
- •Copy
.env.exampleto.envand setSLICER_PATH - •Ensure the extension is installed in Slicer (symlinked to Slicer's module path)
Execution Steps
Step 1: Read Slicer Path from .env
Use the Read tool to read the .env file and extract the SLICER_PATH value.
Step 2: Launch Slicer with Test Runner
Use Bash to run Slicer with the path from .env:
For automated runs (exits when done):
<SLICER_PATH> --python-script scripts/run_tests.py --exit all
For interactive follow-up (stays open):
<SLICER_PATH> --python-script scripts/run_tests.py all
Replace <SLICER_PATH> with the actual path from the .env file.
Step 3: Check Exit Code
When using --exit, the return code indicates:
- •
0- All tests passed - •
1- One or more tests failed
Step 4: Review Output
Test output is saved to:
- •
test_runs/<timestamp>_<suite>/results.json- Test results - •
test_runs/<timestamp>_<suite>/metrics.json- Performance metrics - •
test_runs/<timestamp>_<suite>/screenshots/- Screenshots per test - •
test_runs/<timestamp>_<suite>/logs/test_run.log- Test execution log - •
test_runs/<timestamp>_<suite>/logs/slicer_session.log- Slicer application log
Use /review-test-results to analyze the output (errors, warnings, failures, performance).
Output Location
Test runs are saved to test_runs/ in the extension directory. Each run creates a timestamped folder:
test_runs/2026-01-24_143025_all/
├── metadata.json
├── results.json
├── metrics.json
├── screenshots/
│ ├── manifest.json
│ ├── workflow_basic/
│ │ ├── 001.png
│ │ ├── 002.png
│ │ └── ...
│ ├── algorithm_watershed/
│ │ ├── 001.png
│ │ └── ...
│ └── ui_options_panel/
│ └── ...
└── logs/
├── test_run.log
└── slicer_session.log
Interactive Testing (without --exit)
After automated tests complete, Slicer stays open with the Adaptive Brush Tester module visible. You can:
- •Start recording manual actions
- •Create new screenshot groups
- •Take screenshots (auto-numbered within groups)
- •Add notes
- •Mark pass/fail
Actions are logged to manual_actions.jsonl for later review.
Automated Iteration (with --exit)
Use --exit when iterating on code:
- •Run tests:
/run-slicer-tests --exit - •Review results: Read
test_runs/.../results.json - •Fix issues in code
- •Run tests again
This is faster than staying open for manual testing.