Skip to main content

AndroidDriver

Struct AndroidDriver 

Source
pub struct AndroidDriver { /* private fields */ }
Expand description

Android Driver impl. Wraps HttpRunnerClient connecting to the Kotlin runner via adb-forwarded port (default 28080, configurable via AndroidDriver::new(port)).

Implementations§

Trait Implementations§

Source§

impl Driver for AndroidDriver

Source§

fn set_session_id(&mut self, id: Option<String>)

v1.0.3 — Android impl: attach / clear the Session-Id header on every subsequent request. Same wire as iOS; the Kotlin runner-side session table is symmetric.

Source§

fn platform(&self) -> Platform

Platform identifier — Platform::Ios or Platform::Android.
Source§

fn tree<'life0, 'async_trait>( &'life0 self, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<A11yNode, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch full a11y tree (GET /tree).
Source§

fn find<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<bool, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Boolean existence quick-probe.
Source§

fn find_one<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<Option<A11yNode>, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve selector → single matching node.
Source§

fn find_all<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<Vec<A11yNode>, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve selector → all matching nodes.
Source§

fn find_norm_coord<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, ) -> Pin<Box<dyn Future<Output = Result<Option<(f64, f64)>, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve selector → centroid as viewport-normalized (nx, ny).
Source§

fn find_text_by_ocr<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, text: &'life1 str, locales: &'life2 [String], recognition_level: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Option<OcrFrame>, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Apple Vision / ML Kit OCR find text in current screenshot. recognition_level is "accurate" or "fast".
Source§

fn system_popups<'life0, 'async_trait>( &'life0 self, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<Vec<SystemPopup>, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List visible system-level popups (alerts, permission dialogs).
Source§

fn system_popup_action<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, popup_id: &'life1 str, button_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Tap a button on a system popup by id.
Source§

fn wait_for<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, timeout: Duration, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<A11yNode, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Wait until selector resolves (returns matched node when ready).
Source§

fn tap<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Tap an element (default mode = element-anchored coord tap).
Source§

fn tap_with_mode<'life0, 'life1, 'async_trait>( &'life0 self, _selector: &'life1 Selector, _mode: TapMode, _include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Tap with explicit mode (Path A vs Path B).
Source§

fn tap_at_norm_coord<'life0, 'async_trait>( &'life0 self, nx: f64, ny: f64, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Tap at viewport-normalized coordinate (§9 #3 escape hatch).
Source§

fn tap_by_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Tap by accessibility identifier via the swift /tap-by-id route (IOHID synthesize at element-frame center).
Source§

fn double_tap<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Double-tap a selector.
Source§

fn long_press<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, duration: Duration, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Long-press a selector for duration.
Source§

fn fill<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, selector: &'life1 Selector, text: &'life2 str, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fill text into a focused / matched input.
Source§

fn clear<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, include: Option<IncludeScope>, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Clear text from a focused / matched input.
Source§

fn press_key<'life0, 'async_trait>( &'life0 self, key: KeyName, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Press a named key (Return / Tab / Backspace / etc).
Source§

fn scroll<'life0, 'life1, 'async_trait>( &'life0 self, selector: &'life1 Selector, direction: SwipeDirection, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Scroll until a selector is visible.
Source§

fn swipe_once<'life0, 'async_trait>( &'life0 self, direction: SwipeDirection, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

One-shot swipe in a direction (no probe loop).
Source§

fn swipe_at_norm_coord<'life0, 'async_trait>( &'life0 self, from: (f64, f64), to: (f64, f64), ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Swipe between two viewport-normalized coords.
Source§

fn hide_keyboard<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dismiss the keyboard.
Source§

fn back<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Trigger “back” gesture (iOS edge-swipe / Android KEYCODE_BACK).
Source§

fn set_orientation<'life0, 'async_trait>( &'life0 self, orientation: Orientation, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rotate the device.
Source§

fn foreground<'life0, 'life1, 'async_trait>( &'life0 self, bundle_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Bring app to foreground.
Source§

fn webview_eval<'life0, 'life1, 'async_trait>( &'life0 self, js: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Value, ExpectationFailure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Evaluate JavaScript in a WebView (iOS: fixture bridge :28080; Android: Chrome DevTools Protocol via adb forward).
Source§

fn as_ios_driver(&self) -> Option<&IosDriver>

iOS-only escape hatch: access IosDriver’s inherent runner() for capsule recording (start_record / stop_record) + describe() aggregation. Android impl returns None. Default None so non-iOS impls don’t need to implement.
Source§

fn set_target_bundle_id(&mut self, _bundle: &str)

Set the target bundle id sent to the runner. For iOS this becomes the App-Bundle-Id header on every request so the runner’s resolveApp() rebinds XCUIApplication(bundleIdentifier:) per request. Default no-op — only iOS currently uses this; Android path stays unaffected.
Source§

fn set_auto_activate(&mut self, _activate: bool)

Enable App-Activate: true header on every request so the iOS runner calls .activate() on the resolved target before operating. Default no-op.
Source§

fn set_force_key_events(&mut self, _force: bool)

Force key-event dispatch for text input, bypassing a11y-focus resolution. Wires as the Input-Dispatch-Mode: key-events header. Default no-op.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more