Type | Description |
|---|---|
HeadlessApp<S> | Owns an GlobalState, root widget, layout engine, and mock text measurer. Call tick() to advance the clock. |
TestDriver<S> | High-level driver wrapping a TestHarness. Provides query methods (find_text, find_role, get_all_visible_text) and interaction methods (tap_text, type_text, press_key, scroll_down, scroll_to_text). |
TestRenderer | A no-op Renderer implementation that stores the last DisplayList for inspection. |
TextMatch | A query result containing the matched text, bounding rect, and node ID. |
SemanticMatch | A query result containing the matched accessibility role, label, bounds, and node ID. |
use fission_test::{TestDriver, TestHarness};
let harness = TestHarness::new(MyState::default(), MyWidget);
let mut driver = TestDriver::new(harness);
driver.set_viewport(800.0, 600.0);
driver.pump()?;
// Assert text is rendered
driver.assert_text_visible("Hello, world!");
// Simulate a tap on a button
driver.tap_text("Submit")?;
// Verify state change
driver.assert_text_visible("Submitted!");
Variable | Effect |
|---|---|
FISSION_TEST_USE_MOCK_MEASURER=1 | Force the mock text measurer (10 px per char, 20 px line height). |
FISSION_TEST_MEASURER=mock | Same as above. |
Type | Description |
|---|---|
HeadlessApp<S> | Owns an GlobalState, root widget, layout engine, and mock text measurer. Call tick() to advance the clock. |
TestDriver<S> | High-level driver wrapping a TestHarness. Provides query methods (find_text, find_role, get_all_visible_text) and interaction methods (tap_text, type_text, press_key, scroll_down, scroll_to_text). |
TestRenderer | A no-op Renderer implementation that stores the last DisplayList for inspection. |
TextMatch | A query result containing the matched text, bounding rect, and node ID. |
SemanticMatch | A query result containing the matched accessibility role, label, bounds, and node ID. |
use fission_test::{TestDriver, TestHarness};
let harness = TestHarness::new(MyState::default(), MyWidget);
let mut driver = TestDriver::new(harness);
driver.set_viewport(800.0, 600.0);
driver.pump()?;
// Assert text is rendered
driver.assert_text_visible("Hello, world!");
// Simulate a tap on a button
driver.tap_text("Submit")?;
// Verify state change
driver.assert_text_visible("Submitted!");
Variable | Effect |
|---|---|
FISSION_TEST_USE_MOCK_MEASURER=1 | Force the mock text measurer (10 px per char, 20 px line height). |
FISSION_TEST_MEASURER=mock | Same as above. |