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§
Source§impl AndroidDriver
impl AndroidDriver
pub fn new(runner: HttpRunnerClient) -> Self
pub fn runner(&self) -> &HttpRunnerClient
Trait Implementations§
Source§impl Driver for AndroidDriver
impl Driver for AndroidDriver
Source§fn set_session_id(&mut self, id: Option<String>)
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 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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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>
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)
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)
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)
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§
impl !RefUnwindSafe for AndroidDriver
impl !UnwindSafe for AndroidDriver
impl Freeze for AndroidDriver
impl Send for AndroidDriver
impl Sync for AndroidDriver
impl Unpin for AndroidDriver
impl UnsafeUnpin for AndroidDriver
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