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 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<()>
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.
pub fn tap_text_and_wait(&self, text: &str, ms: u64) -> Result<()>
pub fn assert_text_visible(&self, needle: &str) -> Result<()>
pub fn assert_text_not_visible(&self, needle: &str) -> Result<()>
Auto Trait Implementations§
impl Freeze for LiveTestClient
impl RefUnwindSafe for LiveTestClient
impl Send for LiveTestClient
impl Sync for LiveTestClient
impl Unpin for LiveTestClient
impl UnsafeUnpin for LiveTestClient
impl UnwindSafe for LiveTestClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more