The testrunner needs job and config files to execute tests. They can be found in the Modules/Testrunner/Templates section on Greenspector App.
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 ios test available on Modules section/Testrunner/Job for iOS in Greenspector App.
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
greenspector/application
name : the name of the application of Greenspector App
version : the name of the version
job: # List all mandatory ipa to install on the phone before the launch of the test # App can be path to Apple Store, local path to an ipa or public URL to an ipa # apps: # - ${app} testsSuites: - name: suite1 testFiles: - "./script.testgb" iterations: 1 # Number of iteration for each test case extras: 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: hardware_probe: false tcpdump: false
testsSuites
name: the name of the application
testFiles: the path of the functional journey file
iterations: Number of iteration for each test case
extras :
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
modules
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:
PAUSEAFTERACTION: 500
PAUSEAFTERSCROLL: 500
Variables needed (id, password, ..)
Example
# Testrunner job configuration file mode: custom greenspector: application: name: LeMonde version: "automatisation" job: # Custom job android apk testsSuites: - name: "LeMonde" testFiles: - ios.testgb iterations: 1 testTimeout: 60m0s online: false modules: hardware_probe: false tcpdump: false extras: PAUSEDURATION: 2000 PAUSEAFTERLOAD : 1000 PAUSEAFTERACTION: 500 PAUSEAFTERSCROLL: 500 ID: jean PSWD: 5678
2 - Config.yml
The config.yml will give the information to the testrunner about the device and the server connection.
Here, there is the file template for ios test available on Modules section/Testrunner/Config for iOS in Greenspector App.
Different code lines are explained below.
platform: ios # The platform you are testing on [mobile | pc] resultPath: ./greenspector # The path where you want the Testrunner to save the tests results. defaults to ./greenspector/measures target: # target bloc for iOS mode connection: usb udid: ${PHONE_UDID} # Unique Device ID of the iPhone name: ${PHONE_NAME} # Name of the iPhone greenspector: server: ${GREENSPECTOR_CORE_SERVER_URL} # URL of your Greenspector instance token: ${PRIVATE_TOKEN} # Your private token registered on Greenspectors
platform: The platform you are testing on (ios)
resultPath: The path where the Testrunner saves the tests results. defaults to ./greenspector/measures
udid: Unique Device ID of the iPhone (you can find it on Xcode > Window > Devices and Simulators)
name: Name of the iPhone (you can find it on Xcode > Window > Devices and Simulators)
greenspector/server: URL of Greenspector instance (https://app.greenspector.com)
greenspector/token: Private token registered on Greenspector in Profile/Preferences
Parameters can be added:
log-level: The log level you want (from maximum to minimum log)
debug
info
warn
error
fatal
panic
Target parameters can be added:
target: # For the hardware_probe module in the job.yml file hardware: address: /dev/ttyACM0 # For the tcpdump module in the job.yml file tcpdump: deviceIP: 10.42.0.129 # IP of the device to measure gatewayIP: 10.42.0.1 # IP of the gateway used to filter data networkInterface: wlp2s0 # Network interface used to detect data (wlp2s0...) keepPcap: false # If true, it keeps the pcap file at the end of the measures ipFilters: # Other IP addresses used to filter data apple: false # If true, it filters data related with 17.0.0.0/8
For more information on the tcpdump module, see: Collect of data via network probe
Example
log-level: debug platform: ios resultPath: ./results target: udid: 00008110-001969180AA8201E name: "iPhone" hardware: address: /dev/cu.usbmodem11401 tcpdump: deviceIP: 192.168.2.4 gatewayIP: 192.168.2.1 networkInterface: bridge100 ipFilters: apple: true greenspector: server: https://app.greenspector.com token: ******************************
Indentation is important in these files, please be aware.