anadroid.testing_framework.work package

Submodules

anadroid.testing_framework.work.AbstractWorkLoad module

class anadroid.testing_framework.work.AbstractWorkLoad.AbstractWorkLoad[source]

Bases: ABC

Defines a interface to store and consume work units representing tests to be performed over apps.

abstract add_unit(wunit)[source]

Adds a work unit to the workload. :param wunit: work unit.

abstract consume()[source]

Consume work unit.

abstract flush()[source]

Flush work units and clean workload.

anadroid.testing_framework.work.AppCrawlerWorkUnit module

class anadroid.testing_framework.work.AppCrawlerWorkUnit.AppCrawlerWorkUnit(bin_cmd, stop_call=None)[source]

Bases: WorkUnit

extends WorkUnit functionality to adapt it to App Crawler framework executions.

config(id=None, **kwargs)[source]

configure command. :param id: run or app id.

execute(package_name, **kwargs)[source]

execute the current work unit for a given app identified by package name. :param pkg_name: package name. :type pkg_name: str

export_results(target_dir=None)[source]

export results from work unit. :param target_dir: directory where the results will be exported.

anadroid.testing_framework.work.AppCrawlerWorkUnit.convert_arg(key, val)[source]
anadroid.testing_framework.work.AppCrawlerWorkUnit.detect_crawl_finish(retry=False, stop_call=None)[source]

anadroid.testing_framework.work.DroidBotWorkUnit module

class anadroid.testing_framework.work.DroidBotWorkUnit.DroidBotWorkUnit(bin_cmd)[source]

Bases: WorkUnit

extends WorkUnit functionality to adapt it to droidbot framework executions.

config(id=None, **kwargs)[source]

configure command. :param id: run or app id.

execute(extras=None, *args, **kwargs)[source]

execute the current work unit for a given app identified by package name. :param pkg_name: package name. :type pkg_name: str

export_results(target_dir=None)[source]

export results from work unit. :param target_dir: directory where the results will be exported.

anadroid.testing_framework.work.DroidBotWorkUnit.convert_arg(key, val)[source]

anadroid.testing_framework.work.MonkeyRunnerWorkUnit module

class anadroid.testing_framework.work.MonkeyRunnerWorkUnit.MonkeyRunnerWorkUnit(bin_cmd)[source]

Bases: WorkUnit

extends WorkUnit functionality to adapt it to monkeyrunner executions.

config(filepath=None, **kwargs)[source]

configure command. :param id: run or app id.

execute(package_name=None, *args, **kwargs)[source]

execute the current work unit for a given app identified by package name. :param pkg_name: package name. :type pkg_name: str

anadroid.testing_framework.work.MonkeyRunnerWorkUnit.convert_arg(key, val)[source]

anadroid.testing_framework.work.MonkeyWorkUnit module

class anadroid.testing_framework.work.MonkeyWorkUnit.MonkeyWorkUnit(bin_cmd)[source]

Bases: WorkUnit

extends WorkUnit functionality to adapt it to UI Exerciser Monkey executions.

config(seed=None, **kwargs)[source]

configure command. :param id: run or app id.

execute(package_name, *args, **kwargs)[source]

execute the current work unit for a given app identified by package name. :param pkg_name: package name. :type pkg_name: str

export_results(target_dir=None)[source]

export results from work unit. :param target_dir: directory where the results will be exported.

anadroid.testing_framework.work.MonkeyWorkUnit.convert_arg(key, val)[source]

anadroid.testing_framework.work.RERANWorkUnit module

class anadroid.testing_framework.work.RERANWorkUnit.RERANWorkUnit(bin_cmd)[source]

Bases: WorkUnit

extends WorkUnit functionality to adapt it to RERAN framework executions.

config(device_test_path=None, **kwargs)[source]

configure command. :param id: run or app id.

execute(device, *args, **kwargs)[source]

execute the current work unit for a given app identified by package name. :param pkg_name: package name. :type pkg_name: str

export_results()[source]

export results from work unit. :param target_dir: directory where the results will be exported.

anadroid.testing_framework.work.WorkLoad module

class anadroid.testing_framework.work.WorkLoad.WorkLoad[source]

Bases: AbstractWorkLoad

add_unit(wunit)[source]

Adds a work unit to the workload. :param wunit: work unit.

consume()[source]

Consume work unit.

flush()[source]

Flush work units and clean workload.

anadroid.testing_framework.work.WorkUnit module

class anadroid.testing_framework.work.WorkUnit.WorkUnit(bin_cmd)[source]

Bases: object

Provides a reference implementation to store information about a work unit. A work unit is a command or task to be performed in a context of a test or test suite to be performed by a testing framework command. .. attribute:: command

command to be executed.

type:

str

cmd_args

set os keyed args to appended to command.

Type:

dict

has_timeout

True if the command has time limit to execute, False otherwise.

Type:

bool

add_timeout(timeout_val)[source]

adds a timeout to the work unit. :param timeout_val: timeout value in seconds. :type timeout_val: int

append_prefix(prefix)[source]

adds prefix to command.

build_command(pkg_name, *args, **kwargs)[source]

build command for a given app identified by package name. :param pkg_name: package name. :type pkg_name: str

config(id=None, *args, **kwargs)[source]

configure command. :param id: run or app id.

execute(pkg_name, *args, **kwargs)[source]

execute the current work unit for a given app identified by package name. :param pkg_name: package name. :type pkg_name: str

export_results(target_dir=None)[source]

export results from work unit. :param target_dir: directory where the results will be exported.

Module contents