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_target_bundle_id(&mut self, bundle: &str)
fn set_target_bundle_id(&mut self, bundle: &str)
Android impl: send the package of the app under test as
App-Bundle-Id on every request.
It does not pin the runner to one app the way the iOS header
does — Android’s /tree walks every attached window and there
is no XCUIApplication to rebind. What needs it is id lookup:
Compose emits <pkg>:id/<tag> on some layouts, and the runner
cannot construct that spelling without knowing the package.
Source§fn set_session_id(&mut self, id: Option<String>)
fn set_session_id(&mut self, id: Option<String>)
Android impl: attach / clear the Session-Id header on every
subsequent request.
The Kotlin runner does serve the /session/* routes and keeps a
SessionTable; sessions are optional there rather than absent,
which is what “Android drives sessionless” is shorthand for. A
flow that never opens one still works, because every action
route resolves without consulting the table.
Source§fn set_force_key_events(&mut self, force: bool)
fn set_force_key_events(&mut self, force: bool)
Android honours key-events by skipping focus resolution.
The iOS driver sends Input-Dispatch-Mode to its runner; there
is nothing to send here, because /input-text types into the
focused field either way. What the mode changes is whether this
driver resolves and taps the field first — and resolving is
exactly what fails for the callers who ask for this mode.
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,
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,
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,
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,
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,
(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,
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,
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,
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,
Source§fn tap<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 Selector,
include: Option<IncludeScope>,
) -> Pin<Box<dyn Future<Output = Result<ActOutcome, 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<ActOutcome, ExpectationFailure>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
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,
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,
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-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,
Source§fn long_press<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 Selector,
duration: Duration,
include: Option<IncludeScope>,
) -> Pin<Box<dyn Future<Output = Result<PressTiming, 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<PressTiming, ExpectationFailure>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
duration. Read moreSource§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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
Source§fn as_ios_driver(&self) -> Option<&IosDriver>
fn as_ios_driver(&self) -> Option<&IosDriver>
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_auto_activate(&mut self, _activate: bool)
fn set_auto_activate(&mut self, _activate: bool)
App-Activate: true header on every request so the iOS
runner calls .activate() on the resolved target before
operating. Read moreSource§fn tap_burst<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 Selector,
times: u32,
_interval_ms: Option<u32>,
_hold_ms: Option<u32>,
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_burst<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 Selector,
times: u32,
_interval_ms: Option<u32>,
_hold_ms: Option<u32>,
include: Option<IncludeScope>,
) -> Pin<Box<dyn Future<Output = Result<(), ExpectationFailure>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
times times, spaced on the event timeline. Read more