pub trait UiAutomator2AppCompatible: AppiumCapability {
Show 18 methods
// Provided methods
fn app_activity(&mut self, activity: &str) { ... }
fn app_package(&mut self, activity: &str) { ... }
fn app_wait_activity(&mut self, activity: &str) { ... }
fn app_wait_package(&mut self, activity: &str) { ... }
fn app_wait_duration(&mut self, duration: Duration) { ... }
fn android_install_timeout(&mut self, duration: Duration) { ... }
fn app_wait_for_launch(&mut self, value: bool) { ... }
fn force_app_launch(&mut self, value: bool) { ... }
fn auto_launch(&mut self, value: bool) { ... }
fn intent_category(&mut self, value: &str) { ... }
fn intent_action(&mut self, value: &str) { ... }
fn intent_flags(&mut self, value: &str) { ... }
fn optional_intent_arguments(&mut self, value: &str) { ... }
fn dont_stop_app_on_reset(&mut self, value: bool) { ... }
fn uninstall_other_packages(&mut self, value: &str) { ... }
fn remote_apps_cache_limit(&mut self, value: u64) { ... }
fn allow_test_packages(&mut self, value: bool) { ... }
fn enforce_app_install(&mut self, value: bool) { ... }
}
Expand description
Capabilities for UiAutomator2 (Android).
Provided Methods§
sourcefn app_activity(&mut self, activity: &str)
fn app_activity(&mut self, activity: &str)
Activity name for the Android activity you want to launch from your package.
This often needs to be preceded by a .
(a dot, e.g., .MainActivity
instead of MainActivity
).
By default this capability is received from the package manifest.
sourcefn app_package(&mut self, activity: &str)
fn app_package(&mut self, activity: &str)
Java package of the Android app you want to run.
By default this capability is received from the package manifest.
sourcefn app_wait_activity(&mut self, activity: &str)
fn app_wait_activity(&mut self, activity: &str)
Activity name/names, comma separated, for the Android activity you want to wait for.
By default the value of this capability is the same as for appActivity.
You must set it to the very first focused application activity name in case it is different
from the one which is set as appActivity if your capability has appActivity
and appPackage
.
You can also use wildcards (*).
sourcefn app_wait_package(&mut self, activity: &str)
fn app_wait_package(&mut self, activity: &str)
Java package of the Android app you want to wait for.
By default the value of this capability is the same as for appActivity.
sourcefn app_wait_duration(&mut self, duration: Duration)
fn app_wait_duration(&mut self, duration: Duration)
Timeout in milliseconds used to wait for the appWaitActivity to launch (default 20000)
sourcefn android_install_timeout(&mut self, duration: Duration)
fn android_install_timeout(&mut self, duration: Duration)
Timeout in milliseconds used to wait for an apk to install to the device. Defaults to 90000
sourcefn app_wait_for_launch(&mut self, value: bool)
fn app_wait_for_launch(&mut self, value: bool)
Block until app starts.
Whether to block until the app under test returns the control to the caller after its activity has been started by Activity Manager (true, the default value) or to continue the test without waiting for that (false)
sourcefn force_app_launch(&mut self, value: bool)
fn force_app_launch(&mut self, value: bool)
Always start app forcefully when testing starts.
Set it to true if you want the application under test to be always forcefully restarted on session startup even if appium:noReset is true, and the app was already running. If noReset is falsy, then the app under test is going to be restarted if either this capability set to true or appium:dontStopAppOnReset is falsy (the default behavior). false by default. Available since driver version 2.12
sourcefn auto_launch(&mut self, value: bool)
fn auto_launch(&mut self, value: bool)
Whether to launch the application under test automatically after a test starts.
Default: true
sourcefn intent_category(&mut self, value: &str)
fn intent_category(&mut self, value: &str)
Set an optional intent category to be applied when starting the given appActivity by Activity Manager.
Defaults to android.intent.category.LAUNCHER
.
Please use mobile:startActivity
in case you don’t set an explicit value.
sourcefn intent_action(&mut self, value: &str)
fn intent_action(&mut self, value: &str)
Set an optional intent action to be applied when starting the given appActivity by Activity Manager.
Defaults to android.intent.action.MAIN
. Please use mobile:startActivity
in case you don’t set an explicit value.
sourcefn intent_flags(&mut self, value: &str)
fn intent_flags(&mut self, value: &str)
Set an optional intent flags to be applied when starting the given appActivity by Activity Manager.
Defaults to 0x10200000 (FLAG_ACTIVITY_NEW_TASK)
sourcefn optional_intent_arguments(&mut self, value: &str)
fn optional_intent_arguments(&mut self, value: &str)
Set an optional intent arguments to be applied when starting the given appActivity by Activity Manager
sourcefn dont_stop_app_on_reset(&mut self, value: bool)
fn dont_stop_app_on_reset(&mut self, value: bool)
Set it to true if you don’t want the application to be restarted if it was already running.
If appium:noReset is falsy, then the app under test is going to be restarted if either this capability is falsy (the default behavior) or appium:forceAppLaunch is set to true.
false
by default
sourcefn uninstall_other_packages(&mut self, value: &str)
fn uninstall_other_packages(&mut self, value: &str)
Allows to set one or more comma-separated package identifiers to be uninstalled from the device before a test starts.
sourcefn remote_apps_cache_limit(&mut self, value: u64)
fn remote_apps_cache_limit(&mut self, value: u64)
Sets the maximum amount of application packages to be cached on the device under test.
This is needed for devices that don’t support streamed installs (Android 7 and below), because ADB must push app packages to the device first in order to install them, which takes some time.
Setting this capability to zero disables apps caching. 10 by default.
sourcefn allow_test_packages(&mut self, value: bool)
fn allow_test_packages(&mut self, value: bool)
Use packages built with test flag.
If set to true then it would be possible to use packages built with the test flag for the automated testing (literally adds -t flag to the adb install command).
false by default
sourcefn enforce_app_install(&mut self, value: bool)
fn enforce_app_install(&mut self, value: bool)
Reinstall app (even if it’s a downgrade).
If set to true then the application under test is always reinstalled even if a newer version
of it already exists on the device under test.
This capability has no effect if appium:noReset
is set to true.
false
by default