pub struct LiveTestClient { /* private fields */ }Expand description
An HTTP client that drives a running Fission application for automated UI testing.
Connect to a running application via [LiveTestClient::connect(port)]. The
application must have been started with FISSION_TEST_CONTROL_PORT=<port>.
§Example
let client = LiveTestClient::connect(9876);
client.wait_for_ready(5000).unwrap();
client.tap_text("Submit").unwrap();
client.assert_text_visible("Success").unwrap();
client.screenshot("/tmp/result.png").unwrap();
client.quit().unwrap();Implementations§
Source§impl LiveTestClient
impl LiveTestClient
pub fn connect(port: u16) -> Self
pub fn wait_for_ready(&self, timeout_ms: u64) -> Result<()>
pub fn tap(&self, x: f32, y: f32) -> Result<()>
pub fn tap_text(&self, text: &str) -> Result<()>
pub fn tap_text_without_pump(&self, text: &str) -> Result<()>
pub fn resolve_selector(&self, query: SelectorQuery) -> Result<SemanticNode>
pub fn scroll_into_view(&self, query: SelectorQuery) -> Result<SemanticNode>
pub fn tap_selector(&self, query: SelectorQuery) -> Result<()>
pub fn tap_semantic_identifier(&self, identifier: &str) -> Result<()>
pub fn activate_selector(&self, query: SelectorQuery) -> Result<()>
pub fn focus_selector(&self, query: SelectorQuery) -> Result<()>
pub fn hover_selector(&self, query: SelectorQuery) -> Result<()>
pub fn right_click_selector(&self, query: SelectorQuery) -> Result<()>
pub fn fill_text_selector(&self, query: SelectorQuery, text: &str) -> Result<()>
pub fn fill_text_semantic_identifier( &self, identifier: &str, text: &str, ) -> Result<()>
pub fn clear_text_selector(&self, query: SelectorQuery) -> Result<()>
pub fn toggle_selector(&self, query: SelectorQuery) -> Result<()>
pub fn select_option(&self, query: SelectorQuery) -> Result<()>
pub fn wait_for_selector( &self, query: SelectorQuery, timeout_ms: u64, ) -> Result<()>
pub fn wait_for_visible( &self, query: SelectorQuery, timeout_ms: u64, ) -> Result<()>
pub fn wait_for_enabled( &self, query: SelectorQuery, timeout_ms: u64, ) -> Result<()>
pub fn wait_for_disabled( &self, query: SelectorQuery, timeout_ms: u64, ) -> Result<()>
pub fn wait_for_value( &self, query: SelectorQuery, value: &str, timeout_ms: u64, ) -> Result<()>
pub fn wait_for_text(&self, text: &str, timeout_ms: u64) -> Result<()>
pub fn wait_for_gone(&self, query: SelectorQuery, timeout_ms: u64) -> Result<()>
pub fn drag( &self, start_x: f32, start_y: f32, end_x: f32, end_y: f32, steps: u32, ) -> Result<()>
pub fn external_file_hover( &self, x: f32, y: f32, paths: impl Into<Vec<String>>, ) -> Result<()>
pub fn external_file_drop( &self, x: f32, y: f32, paths: impl Into<Vec<String>>, ) -> Result<()>
pub fn external_file_cancel(&self) -> Result<()>
pub fn scroll(&self, x: f32, y: f32, dx: f32, dy: f32) -> Result<()>
pub fn press_key(&self, key: &str, modifiers: u8) -> Result<()>
pub fn type_text(&self, text: &str) -> Result<()>
pub fn ime_preedit( &self, text: &str, cursor: Option<(usize, usize)>, ) -> Result<()>
pub fn ime_commit(&self, text: &str) -> Result<()>
pub fn ime_cancel(&self) -> Result<()>
pub fn screenshot(&self, path: &str) -> Result<()>
Sourcepub fn capture_screenshot_png(&self) -> Result<Vec<u8>>
pub fn capture_screenshot_png(&self) -> Result<Vec<u8>>
Captures the current frame as encoded PNG bytes.
Sourcepub fn compare_golden(
&self,
golden_path: impl AsRef<Path>,
diff_path: Option<impl AsRef<Path>>,
options: GoldenOptions,
) -> Result<GoldenReport>
pub fn compare_golden( &self, golden_path: impl AsRef<Path>, diff_path: Option<impl AsRef<Path>>, options: GoldenOptions, ) -> Result<GoldenReport>
Compares the current frame to a golden image and writes an optional heatmap.
Sourcepub fn pause_animations(&self) -> Result<()>
pub fn pause_animations(&self) -> Result<()>
Freezes the animation clock while leaving production motion declarations active.
Sourcepub fn resume_animations(&self) -> Result<()>
pub fn resume_animations(&self) -> Result<()>
Resumes advancing animations from the currently frozen clock value.
Sourcepub fn advance_clock(&self, ms: u64) -> Result<()>
pub fn advance_clock(&self, ms: u64) -> Result<()>
Deterministically advances the application and motion clock.
Sourcepub fn capture_at(&self, ms: u64, path: &str) -> Result<()>
pub fn capture_at(&self, ms: u64, path: &str) -> Result<()>
Advances the clock and captures the resulting frame to path.
Sourcepub fn capture_at_png(&self, ms: u64) -> Result<Vec<u8>>
pub fn capture_at_png(&self, ms: u64) -> Result<Vec<u8>>
Advances the clock and returns the resulting frame as encoded PNG bytes.
Sourcepub fn wait_for_idle(
&self,
timeout_ms: u64,
ignore_repeating_motion: bool,
) -> Result<()>
pub fn wait_for_idle( &self, timeout_ms: u64, ignore_repeating_motion: bool, ) -> Result<()>
Waits for finite motion to settle, optionally ignoring repeating motion.
pub fn get_text(&self) -> Result<Vec<TextItem>>
pub fn get_tree(&self) -> Result<Vec<SemanticNode>>
pub fn wait(&self, ms: u64) -> Result<()>
pub fn pump(&self) -> Result<()>
pub fn quit(&self) -> Result<()>
Sourcepub fn simulate_mouse_move(&self, x: f32, y: f32) -> Result<()>
pub fn simulate_mouse_move(&self, x: f32, y: f32) -> Result<()>
Simulate a mouse move to (x, y) — goes through the real CursorMoved path.
Sourcepub fn right_click(&self, x: f32, y: f32) -> Result<()>
pub fn right_click(&self, x: f32, y: f32) -> Result<()>
Simulate a right-click at (x, y) — move + down + up with right button.
Sourcepub fn simulate_resize(&self, width: u32, height: u32) -> Result<()>
pub fn simulate_resize(&self, width: u32, height: u32) -> Result<()>
Simulate a window resize in logical test-space pixels.