wlauto.common.android package

Submodules

wlauto.common.android.device module

class wlauto.common.android.device.AndroidDevice(**kwargs)[source]

Bases: wlauto.common.linux.device.BaseLinuxDevice

Device running Android OS.

abi
aliases = AC([])
artifacts = AC([])
boot(hard=False, **kwargs)[source]
broadcast_media_mounted(dirpath, as_root=False)[source]

Force a re-index of the mediaserver cache for the specified directory.

broadcast_media_scan_file(filepath)[source]

Force a re-index of the mediaserver cache for the specified file.

capture_screen(filepath)[source]

Caputers the current device screen into the specified file in a PNG format.

capture_ui_hierarchy(filepath)[source]

Captures the current view hierarchy into the specified file in a XML format.

clear_logcat()[source]

Clear (flush) logcat log.

connect()[source]
core_modules = []
default_timeout = 30
delay = 2
delete_file(filepath, as_root=False)[source]
deploy_sqlite3(context)[source]
disable_screen_lock()[source]

Attempts to disable he screen lock on the device.

Note

This does not always work…

Added inversion 2.1.4

disable_selinux()[source]
disconnect()[source]
dump_logcat(outfile, filter_spec=None)[source]

Dump the contents of logcat, for the specified filter spec to the specified output file. See http://developer.android.com/tools/help/logcat.html

Parameters:
dynamic_modules = AC(["{'devcpufreq': {}}", "{'cpuidle': {}}"])
ensure_screen_is_on()[source]
executable_is_installed(executable_name)[source]
execute(command, timeout=30, check_exit_code=True, background=False, as_root=False, busybox=False, **kwargs)[source]

Execute the specified command on the device using adb.

Parameters:

param command:

The command to be executed. It should appear exactly as if you were typing it into a shell.

param timeout:

Time, in seconds, to wait for adb to return before aborting and raising an error. Defaults to AndroidDevice.default_timeout.

param check_exit_code:
 

If True, the return code of the command on the Device will be check and exception will be raised if it is not 0. Defaults to True.

param background:
 

If True, will execute adb in a subprocess, and will return immediately, not waiting for adb to return. Defaults to False

param busybox:

If True, will use busybox to execute the command. Defaults to False.

Added in version 2.1.3

Note

The device must be rooted to be able to use some busybox features.

param as_root:

If True, will attempt to execute command in privileged mode. The device must be rooted, otherwise an error will be raised. Defaults to False.

Added in version 2.1.3

Returns:If background parameter is set to True, the subprocess object will be returned; otherwise, the contents of STDOUT from the device will be returned.
Raises:DeviceError if adb timed out or if the command returned non-zero exit code on the device, or if attempting to execute a command in privileged mode on an unrooted device.
file_exists(filepath)[source]
finalize(*args, **kwargs)
forward_port(from_port, to_port)[source]

Forward a port on the device to a port on localhost.

Parameters:
  • from_port – Port on the device which to forward.
  • to_port – Port on the localhost to which the device port will be forwarded.

Ports should be specified using adb spec. See the “adb forward” section in “adb help”.

get_android_id()[source]

Get the device’s ANDROID_ID. Which is

“A 64-bit number (as a hex string) that is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user’s device.”

Note

This will get reset on userdata erasure.

get_android_version()[source]
get_device_model()[source]
get_installed_package_abi(package)[source]

Returns the primary abi of the specified package if it is installed on the device, or None otherwise.

get_installed_package_version(package)[source]

Returns the version (versionName) of the specified package if it is installed on the device, or None otherwise.

Added in version 2.1.4

get_pids_of(process_name)[source]

Returns a list of PIDs of all processes with the specified name.

get_properties(context)[source]

Captures and saves the information from /system/build.prop and /proc/version

get_screen_size()[source]
get_sdk_version()[source]
getprop(prop=None)[source]

Returns parsed output of Android getprop command. If a property is specified, only the value for that property will be returned (with None returned if the property doesn’t exist. Otherwise, wlauto.utils.android.AndroidProperties will be returned, which is a dict-like object.

hard_reset()[source]
initialize(*args, **kwargs)
install(filepath, timeout=30, with_name=None, replace=False)[source]
install_apk(filepath, timeout=300, replace=False, allow_downgrade=False)[source]
install_executable(filepath, with_name=None)[source]

Installs a binary executable on device. Returns the path to the installed binary, or None if the installation has failed. Optionally, with_name parameter may be used to specify a different name under which the executable will be installed.

Added in version 2.1.3. Updated in version 2.1.5 with with_name parameter.

is_installed(name)[source]
is_rooted
is_screen_on()[source]

Returns True if the device screen is currently on, False otherwise.

kick_off(command, as_root=None)[source]

Like execute but closes adb session and returns immediately, leaving the command running on the device (this is different from execute(background=True) which keeps adb connection open and returns a subprocess object).

Added in version 2.1.4

list_packages()[source]

List packages installed on the device.

Added in version 2.1.4

listdir(path, as_root=False, **kwargs)[source]
long_delay = 6
package_is_installed(package_name)[source]

Returns True the if a package with the specified name is installed on the device, and False otherwise.

Added in version 2.1.4

parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <class 'wlauto.utils.types.list_of_caseless_strings'>, 'mandatory': True, 'name': 'core_names', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function list_of_ints>, 'mandatory': True, 'name': 'core_clusters', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'scheduler', 'constraint': None, 'default': 'unknown', 'allowed_values': ['unknown', 'smp', 'hmp', 'iks', 'ea', 'other'], 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'iks_switch_frequency', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function list_of_strs>, 'mandatory': None, 'name': 'property_files', 'constraint': None, 'default': ['/etc/arch-release', '/etc/debian_version', '/etc/lsb-release', '/proc/config.gz', '/proc/cmdline', '/proc/cpuinfo', '/proc/version', '/proc/zconfig', '/sys/kernel/debug/sched_features', '/sys/kernel/hmp'], 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'_overridden': 'AndroidDevice', 'kind': <type 'str'>, 'mandatory': None, 'name': 'binaries_directory', 'constraint': None, 'default': '/data/local/tmp/wa-bin', 'allowed_values': None, 'global_alias': None, 'override': True})", "Param({'_overridden': 'AndroidDevice', 'kind': <type 'str'>, 'mandatory': None, 'name': 'working_directory', 'constraint': None, 'default': '/sdcard/wa-working', 'allowed_values': None, 'global_alias': None, 'override': True})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'adb_name', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function regex>, 'mandatory': None, 'name': 'android_prompt', 'constraint': None, 'default': <_sre.SRE_Pattern object>, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'package_data_directory', 'constraint': None, 'default': '/data/data', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'external_storage_directory', 'constraint': None, 'default': '/sdcard', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'connection', 'constraint': None, 'default': 'usb', 'allowed_values': ['usb', 'ethernet'], 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'logcat_poll_period', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'enable_screen_check', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'swipe_to_unlock', 'constraint': None, 'default': None, 'allowed_values': [None, 'horizontal', 'vertical'], 'global_alias': None, 'override': False})"])
perform_unlock_swipe()[source]
ping()[source]
platform = 'android'
ps(**kwargs)[source]

Returns the list of running processes on the device. Keyword arguments may be used to specify simple filters for columns.

Added in version 2.1.4

pull_file(source, dest, as_root=False, timeout=30)[source]

Modified in version 2.1.4: added as_root parameter.

push_file(source, dest, as_root=False, timeout=30)[source]

Modified in version 2.1.4: added as_root parameter.

ready_timeout = 60
refresh_device_files(file_list)[source]

Depending on the devices android version and root status, determine the appropriate method of forcing a re-index of the mediaserver cache for a given list of files.

reset()[source]
runtime_parameters = AC(['sysfile_values', '${core}_cores', '${core}_min_frequency', '${core}_max_frequency', '${core}_frequency', '${core}_governor', '${core}_governor_tunables'])
start()[source]
stop()[source]
supported_abi
uninstall(package)[source]
uninstall_executable(executable_name)[source]

Added in version 2.1.3.

validate(*args, **kwargs)
class wlauto.common.android.device.BigLittleDevice(**kwargs)[source]

Bases: wlauto.common.android.device.AndroidDevice

aliases = AC([])
artifacts = AC([])
core_modules = []
dynamic_modules = AC(["{'devcpufreq': {}}", "{'cpuidle': {}}"])
finalize(*args, **kwargs)
initialize(*args, **kwargs)
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <class 'wlauto.utils.types.list_of_caseless_strings'>, 'mandatory': True, 'name': 'core_names', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function list_of_ints>, 'mandatory': True, 'name': 'core_clusters', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'_overridden': 'BigLittleDevice', 'kind': <type 'str'>, 'mandatory': None, 'name': 'scheduler', 'constraint': None, 'default': 'hmp', 'allowed_values': ['unknown', 'smp', 'hmp', 'iks', 'ea', 'other'], 'global_alias': None, 'override': True})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'iks_switch_frequency', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function list_of_strs>, 'mandatory': None, 'name': 'property_files', 'constraint': None, 'default': ['/etc/arch-release', '/etc/debian_version', '/etc/lsb-release', '/proc/config.gz', '/proc/cmdline', '/proc/cpuinfo', '/proc/version', '/proc/zconfig', '/sys/kernel/debug/sched_features', '/sys/kernel/hmp'], 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'_overridden': 'AndroidDevice', 'kind': <type 'str'>, 'mandatory': None, 'name': 'binaries_directory', 'constraint': None, 'default': '/data/local/tmp/wa-bin', 'allowed_values': None, 'global_alias': None, 'override': True})", "Param({'_overridden': 'AndroidDevice', 'kind': <type 'str'>, 'mandatory': None, 'name': 'working_directory', 'constraint': None, 'default': '/sdcard/wa-working', 'allowed_values': None, 'global_alias': None, 'override': True})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'adb_name', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function regex>, 'mandatory': None, 'name': 'android_prompt', 'constraint': None, 'default': <_sre.SRE_Pattern object>, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'package_data_directory', 'constraint': None, 'default': '/data/data', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'external_storage_directory', 'constraint': None, 'default': '/sdcard', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'connection', 'constraint': None, 'default': 'usb', 'allowed_values': ['usb', 'ethernet'], 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'logcat_poll_period', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'enable_screen_check', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'swipe_to_unlock', 'constraint': None, 'default': None, 'allowed_values': [None, 'horizontal', 'vertical'], 'global_alias': None, 'override': False})"])
runtime_parameters = AC(['sysfile_values', '${core}_cores', '${core}_min_frequency', '${core}_max_frequency', '${core}_frequency', '${core}_governor', '${core}_governor_tunables'])
validate(*args, **kwargs)

wlauto.common.android.resources module

class wlauto.common.android.resources.ApkFile(owner, platform=None, uiauto=False, package=None)[source]

Bases: wlauto.common.resources.FileResource

name = 'apk'
class wlauto.common.android.resources.JarFile(owner)[source]

Bases: wlauto.common.resources.FileResource

name = 'jar'
class wlauto.common.android.resources.ReventFile(owner, stage)[source]

Bases: wlauto.common.resources.FileResource

name = 'revent'

wlauto.common.android.workload module

wlauto.common.android.workload.AndroidBenchmark

alias of ApkWorkload

class wlauto.common.android.workload.AndroidUiAutoBenchmark(device, **kwargs)[source]

Bases: wlauto.common.android.workload.UiAutomatorWorkload, wlauto.common.android.workload.ApkWorkload

aliases = AC([])
artifacts = AC([])
core_modules = []
finalize(*args, **kwargs)
init_resources(context)[source]
initialize(*args, **kwargs)
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'install_timeout', 'constraint': None, 'default': 300, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'check_apk', 'constraint': None, 'default': True, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'force_install', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'uninstall_apk', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'exact_abi', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'clear_data_on_reset', 'constraint': None, 'default': True, 'allowed_values': None, 'global_alias': None, 'override': False})"])
setup(context)[source]
supported_platforms = ['android']
teardown(context)[source]
update_result(context)[source]
validate(*args, **kwargs)
class wlauto.common.android.workload.AndroidUxPerfWorkload(device, **kwargs)[source]

Bases: wlauto.common.android.workload.AndroidUiAutoBenchmark

aliases = AC([])
artifacts = AC([])
core_modules = []
delete_assets()[source]
deployable_assets = []
finalize(*args, **kwargs)
initialize(*args, **kwargs)
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'install_timeout', 'constraint': None, 'default': 300, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'check_apk', 'constraint': None, 'default': True, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'force_install', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'uninstall_apk', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'exact_abi', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'clear_data_on_reset', 'constraint': None, 'default': True, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'markers_enabled', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'clean_assets', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'force_push_assets', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})"])
push_assets(context)[source]
setup(context)[source]
teardown(context)[source]
validate(*args, **kwargs)
class wlauto.common.android.workload.AndroidUxPerfWorkloadMeta[source]

Bases: wlauto.core.extension.ExtensionMeta

to_propagate = [('parameters', <class 'wlauto.core.extension.Param'>, <class 'wlauto.core.extension.AttributeCollection'>), ('artifacts', <class 'wlauto.core.extension.Artifact'>, <class 'wlauto.core.extension.AttributeCollection'>), ('core_modules', <type 'str'>, <class 'wlauto.core.extension.ListCollection'>), ('deployable_assets', <type 'str'>, <class 'wlauto.core.extension.ListCollection'>)]
class wlauto.common.android.workload.ApkWorkload(device, _call_super=True, **kwargs)[source]

Bases: wlauto.core.workload.Workload

A workload based on an APK file.

Defines the following attributes:

Package:

The package name of the app. This is usually a Java-style name of the form com.companyname.appname.

Activity:

This is the initial activity of the app. This will be used to launch the app during the setup. Many applications do not specify a launch activity so this may be left blank if necessary.

View:

The class of the main view pane of the app. This needs to be defined in order to collect SurfaceFlinger-derived statistics (such as FPS) for the app, but may otherwise be left as None.

Launch_main:

If False, the default activity will not be launched (during setup), allowing workloads to start the app with an intent of their choice in the run step. This is useful for apps without a launchable default/main activity or those where it cannot be launched without intent data (which is provided at the run phase).

Install_timeout:
 

Timeout for the installation of the APK. This may vary wildly based on the size and nature of a specific APK, and so should be defined on per-workload basis.

Note

To a lesser extent, this will also vary based on the the device and the nature of adb connection (USB vs Ethernet), so, as with all timeouts, so leeway must be included in the specified value.

Min_apk_version:
 

The minimum supported apk version for this workload. May be None.

Max_apk_version:
 

The maximum supported apk version for this workload. May be None.

Note

Both package and activity for a workload may be obtained from the APK using the aapt tool that comes with the ADT (Android Developemnt Tools) bundle.

activity = None
aliases = AC([])
artifacts = AC([])
check_host_version()[source]
core_modules = []
do_post_install(context)[source]

May be overwritten by derived classes.

finalize(*args, **kwargs)
force_install_apk(context, host_version)[source]
initialize(*args, **kwargs)
install_apk(context, replace=False)[source]
kill_background()[source]
launch_application()[source]
launch_main = True
launch_package()[source]
max_apk_version = None
min_apk_version = None
package = None
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'install_timeout', 'constraint': None, 'default': 300, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'check_apk', 'constraint': None, 'default': True, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'force_install', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'uninstall_apk', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'exact_abi', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'clear_data_on_reset', 'constraint': None, 'default': True, 'allowed_values': None, 'global_alias': None, 'override': False})"])
prefer_host_apk(context, host_version, target_version)[source]
prefer_target_apk(context, host_version, target_version)[source]
reset(context)[source]
run(context)[source]
setup(context)[source]
setup_workload_apk(context)[source]
supported_platforms = ['android']
teardown(context)[source]
update_result(context)[source]
validate(*args, **kwargs)
validate_version(version)[source]
verify_apk_version(target_version, target_abi, host_version)[source]
view = None
class wlauto.common.android.workload.GameWorkload(device, **kwargs)[source]

Bases: wlauto.common.android.workload.ApkWorkload, wlauto.common.linux.workload.ReventWorkload

GameWorkload is the base class for all the workload that use revent files to run.

For more in depth details on how to record revent files, please see revent. To subclass this class, please refer to Adding revent-dependent Workload:.

Additionally, this class defines the following attributes:

Asset_file:A tarball containing additional assets for the workload. These are the assets that are not part of the APK but would need to be downloaded by the workload (usually, on first run of the app). Since the presence of a network connection cannot be assumed on some devices, this provides an alternative means of obtaining the assets.
Saved_state_file:
 A tarball containing the saved state for a workload. This tarball gets deployed in the same way as the asset file. The only difference being that it is usually much slower and re-deploying the tarball should alone be enough to reset the workload to a known state (without having to reinstall the app or re-deploy the other assets).
Loading_time:Time it takes for the workload to load after the initial activity has been started.
aliases = AC([])
artifacts = AC([])
asset_file = None
check_state(context, phase)[source]
core_modules = []
do_post_install(context)[source]
finalize(*args, **kwargs)
init_resources(context)[source]
initialize(*args, **kwargs)
loading_time = 10
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'_overridden': 'GameWorkload', 'kind': <function integer>, 'mandatory': None, 'name': 'install_timeout', 'constraint': None, 'default': 500, 'allowed_values': None, 'global_alias': None, 'override': True})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'check_apk', 'constraint': None, 'default': True, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'force_install', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'uninstall_apk', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'exact_abi', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'clear_data_on_reset', 'constraint': None, 'default': True, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'idle_time', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'check_states', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': 'check_game_states', 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'assets_push_timeout', 'constraint': None, 'default': 500, 'allowed_values': None, 'global_alias': None, 'override': False})"])
reset(context)[source]
run(context)[source]
saved_state_file = None
setup(context)[source]
setup_required = True
supported_platforms = ['android']
teardown(context)[source]
validate(*args, **kwargs)
view = 'SurfaceView'
class wlauto.common.android.workload.UiAutomatorWorkload(device, _call_super=True, **kwargs)[source]

Bases: wlauto.core.workload.Workload

Base class for all workloads that rely on a UI Automator APK file.

This class should be subclassed by workloads that rely on android UiAutomator to work. This class handles installing the UI Automator APK to the device and invoking it to run the workload. By default, it will look for the *.apk file in the same directory as the .py file for the workload (this can be changed by overriding the uiauto_file property in the subclassing workload).

To inintiate UI Automation, the fully-qualified name of the Java class and the corresponding method name are needed. By default, the package part of the class name is derived from the class file, and class and method names are UiAutomation and runUiAutomaton respectively. If you have generated the boilder plate for the UiAutomatior code using create_workloads utility, then everything should be named correctly. If you’re creating the Java project manually, you need to make sure the names match what is expected, or you could override uiauto_package, uiauto_class and uiauto_method class attributes with the value that match your Java code.

You can also pass parameters to the APK file. To do this add the parameters to self.uiauto_params dict inside your class’s __init__ or setup methods.

aliases = AC([])
artifacts = AC([])
core_modules = []
finalize(*args, **kwargs)
init_resources(context)[source]
initialize(*args, **kwargs)
parameters = AC(["Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})"])
run(context)[source]
run_timeout = 600
setup(context)[source]
supported_platforms = ['android']
teardown(context)[source]
uiauto_class = 'UiAutomation'
uiauto_method = 'android.support.test.runner.AndroidJUnitRunner'
uiauto_package = ''
uninstall_uiauto_apk = True
update_result(context)[source]
validate(*args, **kwargs)

Module contents