Complementary files (Android)
update 25 nov 2024
The testrunner needs job and config files to execute tests. They can be found in the Examples section of Greenspector’s Gitlab.
Style rules :
Bold : parameters which contain a value
Italic : not free choice of value (ex: false/true)
1 - Job.yml
The job.yml will give the instructions to the testrunner about the journey details (variables, iterations,..)
Here, there is the file template for android test available on Examples section for Android in Greenspector Gitlab.
Different code lines are explained below.
mode: custom
greenspector:
application:
name: ${APP_NAME} # Your application's name
version: ${APP_VERSION} # Your application's version
mode:
custom: test with a gdsl script
apk: benchmark from an APK (ex: com.google.android.youtube)
url: benchmark from an URL (ex: https://metropole.nantes.fr)
freerunner: manual test (in this case, the job.monitoredPackages, job.stepName and job.duration fields must be completed)
greenspector/application
name : name of the application of Greenspector Studio
version : name of the version
job:
# List all mandatory apk to install on the phone before the launch of the test
# URL can be package name to install from Playstore, local path on an apk or public URL to an apk
# urls:
# - ${URL}
testsSuites:
- name: suite1
testFiles:
- "./script.testgb"
monitoredPackages:
- ${MONITORED_PACKAGE} # The package to monitor, existing or newly installed
iterations: 1 # Number of iteration for each test case
extras:
config-screenbrightness: "127"
config-skipsetupphone: "true"
PAUSEDURATION: "${PAUSEDURATION}"
PAUSEAFTERLOAD: "${PAUSEAFTERLOAD}"
testTimeout: 30m0s # Timeout for the total duration of the test, default value is 30m, max value is 60m
online: true # [true, false]
networkMode: WIFI
modules:
android_system_monitoring: false
hardware_probe: false
tcpdump: false
testsSuites
name: name of the application
testFiles: path of the functional journey file
monitoredPackages:
for website: browser package
for app: app package
iterations: Number of iteration for each test case
extras:
config-screenbrightness: level of brightness (50% = 127)
config-skipsetupphone:
“true” : skip the device preparation (cache cleaning,..)
“false”
PAUSEDURATION
PAUSEAFTERLOAD
testTimeout: Timeout for the total duration of the test, default value is 30m, max value is 60m
online:
false : results available on your PC
true : results available on Greenspector App and locally
networkMode: Please be aware that your phone has to be able to handle the network mode
WIFI
4G
3G
modules
android_system_monitoring: “false” (use of the dumpsys probe to get more results like memory used by SQL, number of loaded views…)
hardware_probe: “false” (use of the hardware module to get the energy consumption)
tcpdump: “false” (use of the tcpdump module to get the exchanged data)
Extras can be added:
config-compressedLayoutHierarchy: true
config-waitForIdle: true (true by default, if "false" set idle timeout to 0)
PAUSEAFTERACTION: 500
PAUSEAFTERSCROLL: 500
Variables needed (id, password, ..)
Example
# Testrunner job configuration file
mode: custom
greenspector:
application:
name: APP3
version: "test-18/02/2024"
job: # Custom job android apk
testsSuites:
- name: APP3
testFiles:
- journey.testgb
monitoredPackages:
- com.android.chrome
iterations: 1
networkMode: WIFI
testTimeout: 60m0s
online: false
modules:
android_system_monitoring: false
hardware_probe: false
extras:
config-skipsetupphone: true
config-screenbrightness: "127"
PAUSEDURATION: 5000 # A remettre à 30000 pour les mesures
PAUSEAFTERLOAD : 1000
PAUSEAFTERACTION: 500
PAUSEAFTERSCROLL: 500
ID: jean
PSWD: 5678
2 - Config.yml
Here, there is the file template for android test available on Examples section for Android in Greenspector Gitlab.
Different code lines are explained below.
plateform: The platform you are testing on (mobile)
connection: The way the device is connected
wifi
usb
ip: IP address of mobile
port: The port used by adb to connect to the device. Defaults to 5555
paths/adb: The path to adb in your Android SDK installation
paths/aapt: The path to aapt in your Android SDK installation
greenspector/server: URL of Greenspector instance (https://core-saas-prod.greenspector.com)
greenspector/token: Private token registered on Greenspector Studio in Profile
Parameters can be added:
resultPath: The path where you want the Testrunner to save the tests results. defaults to ./greenspector
log-level: The log level you want (from maximum to minimum log)
debug
info
warn
error
fatal
panic
Target parameters can be added:
target.ip : IP of the device to measure
tcpdump : allows you to retrieve data exchanged on a telephone. This module is not compatible with Windows.
gatewayIP : IP of the gateway used to filter data. To find with
ifconfig
commandnetworkInterface : Network interface used to detect data (wlp2s0...). To find with
ifconfig
orsudo tcpdump -D
.keepPcap :
true: conserve le fichier pcap à la fin des mesures
ipFilters : filters to pull out network exchanges of measurement
apple: true : in case of iOS measurement, to filter IP addresses corresponding to 17.0.0.0/8 (Apple).
launchOnDevice :
true: launches tcpdump on the device
Example