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 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 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