anadroid.testing_framework package
Subpackages
- anadroid.testing_framework.work package
- Submodules
- anadroid.testing_framework.work.AbstractWorkLoad module
- anadroid.testing_framework.work.AppCrawlerWorkUnit module
- anadroid.testing_framework.work.DroidBotWorkUnit module
- anadroid.testing_framework.work.MonkeyRunnerWorkUnit module
- anadroid.testing_framework.work.MonkeyWorkUnit module
- anadroid.testing_framework.work.RERANWorkUnit module
- anadroid.testing_framework.work.WorkLoad module
- anadroid.testing_framework.work.WorkUnit module
- Module contents
Submodules
anadroid.testing_framework.AbstractTestingFramework module
- class anadroid.testing_framework.AbstractTestingFramework.AbstractTestingFramework(id, profiler, analyzer, default_test_res='anadroid_results/custom_test_results')[source]
Bases:
ABC
Defines a basic interface to be implemented by classes that provide integration of Android testing frameworks. .. attribute:: profiler
profiler.
- type:
Profiler
- id
testing framework uuid.
- Type:
str
- analyzer
Analyzer to be used.
- Type:
- config
set of testing frameowrk configurations.
- Type:
dict
- abstract execute_test(w_unit, timeout=None, *args, **kwargs)[source]
execute a test described by a work unit w_unit. :param w_unit: work unit containing information of the test to be executed. :type w_unit: object :param timeout: test timeout.
- get_config(key, default=None)[source]
get value of test configuration. :param key: config name/key. :param default: default value to be returned in the case of missing configuration.
- abstract init_default_workload(pkg, args_file=None, tests_dir=None)[source]
initialize workload to be done by tests of the testing framework. :param pkg: package of app under test. :param args_file: file containing test arguments, where each line contains arguments for 1 test. :param tests_dir: directory where test files or resources are stored.
anadroid.testing_framework.AppCrawlerFramework module
- class anadroid.testing_framework.AppCrawlerFramework.AppCrawlerFramework(profiler, analyzer, default_workload=False, resdir='/Users/ruirua/repos/pyAnaDroid/anadroid/resources/testingFrameworks/app-crawler')[source]
Bases:
AbstractTestingFramework
Implements AbstractTestingFramework interface to allow executing tests using App Crawler. .. attribute:: executable_prefix
prefix for test command. It is basically a call to java execute the framework’s jar.
- type:
str
- res_dir
directory containing app crawler resources.
- Type:
str
- exec_one_test(test_id, device, app, wk_unit, n_retries=1)[source]
executes one test identified by test_id of an given app on a given device. :param test_id: test uuid. :param device: device. :type device: Device :param app: app. :type app: App :param wk_unit: work unit to be executed. :type wk_unit: WorkUnit :param n_retries: number of times to try run the test in case it fails. :type n_retries: int
- execute_test(package, wunit=None, timeout=None, *args, **kwargs)[source]
execute a test described by a work unit w_unit. :param package: app package. :type package: str :param wunit: work unit containing information of the test to be executed. :type wunit: object :param timeout: test timeout.
- init_default_workload(pkg, args_file=None, tests_dir=None)[source]
Initializes the workload with AppCrawlerWorkUnits. Initializes workload attribute with many AppCrawlerWorkUnits, configured with configurations coming from config file. :param pkg: app package (ignored). :param args_file: ignored. :param tests_dir: ignored.
anadroid.testing_framework.DroidBotFramework module
- class anadroid.testing_framework.DroidBotFramework.DroidBotFramework(profiler, analyzer, default_workload=False, resdir='/Users/ruirua/repos/pyAnaDroid/anadroid/resources/testingFrameworks/droidbot')[source]
Bases:
AbstractTestingFramework
Implements AbstractTestingFramework interface to allow executing tests using DroidBot. .. attribute:: executable_prefix
prefix for test command. It is basically a call to the executable.
- type:
str
- res_dir
directory containing app crawler resources.
- Type:
str
- exec_one_test(test_id, device, app, wk_unit, n_retries=1)[source]
executes one test identified by test_id of an given app on a given device. :param test_id: test uuid. :param device: device. :type device: Device :param app: app. :type app: App :param wk_unit: work unit to be executed. :type wk_unit: WorkUnit :param n_retries: number of times to try run the test in case it fails. :type n_retries: int
- execute_test(apk_path, wunit=None, timeout=None, *args, **kwargs)[source]
execute a test described by a work unit w_unit. :param package: app package. :type package: str :param wunit: work unit containing information of the test to be executed. :type wunit: object :param timeout: test timeout.
- init_default_workload(pkg, args_file=None, tests_dir=None)[source]
Initializes the workload with AppCrawlerWorkUnits. Initializes workload attribute with many AppCrawlerWorkUnits, configured with configurations coming from config file. :param pkg: app package (ignored). :param args_file: ignored. :param tests_dir: ignored.
anadroid.testing_framework.JUnitBasedFramework module
- class anadroid.testing_framework.JUnitBasedFramework.JUnitBasedFramework(profiler, analyzer, resdir='/Users/ruirua/repos/pyAnaDroid/anadroid/resources/testingFramework/junit')[source]
Bases:
AbstractTestingFramework
Implements AbstractTestingFramework interface to allow executing tests using JUnit based testing frameworks. The tests executed are barely configurable. This class lists instrumentations on device and runs one by one. .. attribute:: executable_prefix
prefix for test command. It is basically a call to the executable.
- type:
str
- res_dir
directory containing app crawler resources.
- Type:
str
- exec_one_test(test_id, device, app, wk_unit, n_retries=1)[source]
executes one test identified by test_id of an given app on a given device. :param test_id: test uuid. :param device: device. :type device: Device :param app: app. :type app: App :param wk_unit: work unit to be executed. :type wk_unit: WorkUnit :param n_retries: number of times to try run the test in case it fails. :type n_retries: int
- execute_test(package, wunit=None, timeout=None, *args, **kwargs)[source]
execute a test described by a work unit w_unit. :param w_unit: work unit containing information of the test to be executed. :type w_unit: object :param timeout: test timeout.
- init_default_workload(pkg, seeds_file=None, tests_dir=None)[source]
initialize workload to be done by tests of the testing framework. :param pkg: package of app under test. :param args_file: file containing test arguments, where each line contains arguments for 1 test. :param tests_dir: directory where test files or resources are stored.
anadroid.testing_framework.MonkeyFramework module
- class anadroid.testing_framework.MonkeyFramework.MonkeyFramework(profiler, analyzer, default_workload=False, resdir='/Users/ruirua/repos/pyAnaDroid/anadroid/resources/testingFrameworks/monkey')[source]
Bases:
AbstractTestingFramework
Implements AbstractTestingFramework interface to allow executing tests using Monkey testing framework. .. attribute:: executable_prefix
prefix for test command. It is basically a call to the executable.
- type:
str
- res_dir
directory containing app crawler resources.
- Type:
str
- exec_one_test(test_id, device, app, wk_unit, n_retries=1)[source]
executes one test identified by test_id of an given app on a given device. :param test_id: test uuid. :param device: device. :type device: Device :param app: app. :type app: App :param wk_unit: work unit to be executed. :type wk_unit: WorkUnit :param n_retries: number of times to try run the test in case it fails. :type n_retries: int
- execute_test(package, wunit=None, timeout=None, *args, **kwargs)[source]
execute a test described by a work unit w_unit. :param w_unit: work unit containing information of the test to be executed. :type w_unit: object :param timeout: test timeout.
- init_default_workload(pkg, seeds_file='monkey_seeds.txt', tests_dir=None)[source]
initialize workload to be done by tests of the testing framework. :param pkg: package of app under test. :param args_file: file containing test arguments, where each line contains arguments for 1 test. :param tests_dir: directory where test files or resources are stored.
anadroid.testing_framework.MonkeyRunnerFramework module
- class anadroid.testing_framework.MonkeyRunnerFramework.MonkeyRunnerFramework(profiler, analyzer, default_workload=False, resources_dir='/Users/ruirua/repos/pyAnaDroid/anadroid/resources/testingFrameworks/monkey-runner')[source]
Bases:
AbstractTestingFramework
Implements AbstractTestingFramework interface to allow executing tests using monkeyrunner framework. .. attribute:: workload
workload object containing the work units to be executed.
- type:
WorkLoad
- resources_dir
directory containing app crawler resources.
- Type:
str
- exec_one_test(test_id, device, app, wk_unit, n_retries=1)[source]
executes one test identified by test_id of an given app on a given device. :param test_id: test uuid. :param device: device. :type device: Device :param app: app. :type app: App :param wk_unit: work unit to be executed. :type wk_unit: WorkUnit :param n_retries: number of times to try run the test in case it fails. :type n_retries: int
- execute_test(package, wunit=None, timeout=None, *args, **kwargs)[source]
execute a test described by a work unit w_unit. :param w_unit: work unit containing information of the test to be executed. :type w_unit: object :param timeout: test timeout.
- init_default_workload(pkg, seeds_file=None, tests_dir='/Users/ruirua/repos/pyAnaDroid/anadroid/resources/testingFrameworks/monkey-runner/tests')[source]
initialize workload to be done by tests of the testing framework. :param pkg: package of app under test. :param args_file: file containing test arguments, where each line contains arguments for 1 test. :param tests_dir: directory where test files or resources are stored.
- load_tests_of_app(monkeyrunner_tests_dir='/Users/ruirua/repos/pyAnaDroid/anadroid/resources/testingFrameworks/monkey-runner/tests')[source]
anadroid.testing_framework.RERANFramework module
- class anadroid.testing_framework.RERANFramework.RERANFramework(device, profiler, analyzer, resources_dir='/Users/ruirua/repos/pyAnaDroid/anadroid/resources/testingFrameworks/RERAN')[source]
Bases:
AbstractTestingFramework
Implements AbstractTestingFramework interface to allow recording and executing tests using RERAN framework. .. attribute:: workload
workload object containing the work units to be executed.
- type:
WorkLoad
- resources_dir
directory containing app crawler resources.
- Type:
str
- exec_one_test(test_id, device, app, wk_unit, n_retries=1)[source]
executes one test identified by test_id of an given app on a given device. :param test_id: test uuid. :param device: device. :type device: Device :param app: app. :type app: App :param wk_unit: work unit to be executed. :type wk_unit: WorkUnit :param n_retries: number of times to try run the test in case it fails. :type n_retries: int
- execute_test(package, wunit=None, timeout=None, *args, **kwargs)[source]
execute a test described by a work unit w_unit. :param w_unit: work unit containing information of the test to be executed. :type w_unit: object :param timeout: test timeout.
- init_default_workload(pkg, seeds_file=None, tests_dir=None)[source]
initialize workload to be done by tests of the testing framework. :param pkg: package of app under test. :param args_file: file containing test arguments, where each line contains arguments for 1 test. :param tests_dir: directory where test files or resources are stored.
- record_test(app_id=None, test_id=None, output_dir=None)[source]
record test of a given app, identified by test_id.