TestCase
Base test case class for Slicer testing.
Test cases inherit from TestCase and implement setup, run, verify, and teardown methods. Tests call Slicer API directly - no wrapper classes are provided.
Classes
- class Assertion
Result of a test assertion.
- class TestResult
Result of running a single test case.
Methods:
- failed_assertions()
Return only failed assertions.
- class TestCaseInfo
Information about a registered test case.
Functions
- failed_assertions()
Return only failed assertions.
- setup()
Set up test environment.
Called before run(). Load sample data, create segmentation nodes, configure the effect. Call Slicer API directly.
- Args:
ctx: Test context for screenshots, timing, assertions.
- run()
Execute the test actions.
Perform the main test operations: paint with the brush, change parameters, interact with UI. Call Slicer API directly.
- Args:
ctx: Test context for screenshots, timing, assertions.
- verify()
Verify test results with assertions.
Check that the test produced expected results. Use ctx.assert_* methods to record pass/fail conditions.
- Args:
ctx: Test context for screenshots, timing, assertions.
- teardown()
Clean up after test (optional).
Override to perform cleanup. Called after verify(), even if verify() raised an exception.
- Args:
ctx: Test context for screenshots, timing, assertions.