Status | ||||
---|---|---|---|---|
|
...
4 - --networkMode: The network mode for the test. Values can be "WIFI", "4G", "3G" or "2G". (Default: WIFI). Optional
5 - --report
: (Beta feature) Automatically generate the test report in the .greenspector
folder and wait for the job to end. (Default: false). Optional
...
1 - --apkFile
: The APK(s) to benchmark. (If set multiple times, all the APK will be installed but only the first one will be monitored). Mandatory option: Minimum 1 Optional if the applications to benchmark are already installed on phone
2 - --iterations
: Number of iterations of measure you want. (Default: 1). Optional
...
This feature allows you to run your custom functional tests on your Android application or web site on the Power Test Cloud/Bench.
To use this feature, you have to first configure the application name, version and the environment to run the measure on.
The command to run is:
Code Block | ||
---|---|---|
| ||
# To run android tests (uiautomator, espresso)
gspt testbench custom-tests --apkFile <path to APK> --testPackage <Test package to launch> --monitoredPackage <package to monitor> |
Examples:
Code Block | ||
---|---|---|
| ||
or # To run Greenspector DSL tests gspt testbench custom-tests --apkFile target/application.apk --apkFile target/test.apk<path to APK> --testPackage com.greenspector.demo.teststestsSuite <suite name:path_testfile1.testgb,path_testfile2.testgb> --monitoredPackage com.greenspector.demo.app <package to monitor> |
Examples:
Code Block | ||
---|---|---|
| ||
gspt testbench custom-tests --apkFile target/application.apk --apkFile target/test-1.apk --apkFile targettestPackage com.greenspector.demo.tests --monitoredPackage com.greenspector.demo.app gspt testbench custom-tests --apkFile target/application.apk --apkFile target/test-1.apk --apkFile target/test-2.apk --testPackage com.greenspector.demo.tests.first --testPackage com.greenspector.demo.tests.second --monitoredPackage com.greenspector.demo.app --iterations 5 gspt testbench custom-tests --apkFile target/application.apk --apkFile target/test.apk --testPackage com.greenspector.demo.tests --monitoredPackage com.greenspector.demo.app --report gspt testbench custom-tests --apkFile target/application.apk --testsSuite suite1:tests/file1.testgb,tests/file2.tgb --testsSuite suite2:tests/file3.testgb --monitoredPackage com.greenspector.demo.app |
The options are:
1 - --apkFile
: Precise the APKs you want to measure and the APKs which contain your functional tests to launch. Prefer separate APKs for your app and for your tests. Mandatory option: Minimum 1
2 - --testPackage
: For each APK containing functional tests you want to launch (i.e. UI Automator or Espresso tests), precise the name of the android package (i.e. package in file AndroidManifest.xml). All tests in those Android packages will be launched. Mandatory option: Minimum 1 if --testsSuite is not used
3 - --testsSuite
: For each suite, precise the suite name and the name of the android package (i.e. package in file AndroidManifest.xml). All tests in those Android packages will be launchedlists of test files writen with Greenspector DSL. All test files will be launched in the specified order. Mandatory option: Minimum 1 3 if --testPackage is not used
4 - --monitoredPackage
: For each Android application you want to monitored, precise the name of the android package to get metrics about the process (process data, process CPU…). Probes can monitor multi package at a time. In this case, metrics are agreggated. For website, choose the browser where the tests runs (i.e. com.android.chrome
). Mandatory option: Minimum 1
4 5 - --iterations
: Number of iterations of measure you want. (Default: 1). Optional
5 6 - --report
: (Beta feature) Automatically generate the test report in the .greenspector folder and wait for the job to end.(Default: false). Optional
This command will send a measure request to the server. After this measure will ran on the Power Test Bench/Cloud, you will find the results on the Web Interface.
6 7 - --extra:
Use to transmit extras parameters to your instrumentation with the format name=value (ie --extra annotation=com.greenspector.demo.test.MyAnnotation add the following parameters to your instrumentation -e annotation com.greenspector.demo.test.MyAnnotation). Thus you can filter your tests for example using those extras parameters : https://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner). Optional
7 8 - --networkMode: The network mode for the test. Values can be "WIFI", "4G", "3G" or "2G". (Default: WIFI). Optional
Some options are deprecated:
...