Skip to content

Instantly share code, notes, and snippets.

@dwi2
Last active August 29, 2015 14:05
Show Gist options
  • Save dwi2/747da88f50299b8243d8 to your computer and use it in GitHub Desktop.
Save dwi2/747da88f50299b8243d8 to your computer and use it in GitHub Desktop.
Gaia UI test memo - How to run Gaia UI test on b2g desktop
## Document ##
* Marionette Client document
http://marionette-client.readthedocs.org/en/latest/#
* Gaia UI Tests doc lists
https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests
* Running Gaia UI tests
https://developer.mozilla.org/en-US/Firefox_OS/Platform/Automated_testing/gaia-ui-tests/Gaia_UI_Tests_Run_Tests
* Running Gaia UI tests and integration tests for developers
https://developer.mozilla.org/en-US/Firefox_OS/Running_Tests_on_Firefox_OS_for_Developers
## Steps ##
1. Download latest b2g desktop from [nightly website](http://nightly.mozilla.org/) and extract it
2. Go to Gaia root directory, setup environment for the first time
```sh
$ virtualenv gaia_ui_venv
...
$ source gaia_ui_venv/bin/activate
...
$ cd tests/python/gaia-ui-tests
$ python setup.py develop
```
or setup environment if you have done steps above
```sh
$ source gaia_ui_venv/bin/activate
```
3. Place testvars.json (see testvars.json example)
This two values must be set.
```json
{
...
"acknowledged_risks": true,
"skip_warning": true,
...
}
```
4. Run specific test on B2G desktop
* On Mac (say we want to run test_a11y_volume_buttons.py)
```sh
$ gaiatest --binary=/full/path/to/B2G.app/Contents/MacOS/b2g-bin --profile=/full/path/to/gaia/profile --testvars=testvars.json --restart ./gaiatest/tests/accessibility/system/test_a11y_volume_buttons.py
```
* Manually start b2g desktop and run tests on Mac
(Presumption, build gaia like it is on device, e.g. DEVICE_DEBUG=1)
```sh
$ /full/path/to/b2g -profile /full/path/to/gaia/profile
$ gaiatest --testvars testvars.json ./gaiatest/tests/accessibility/system/test_a11y_volume_buttons.py
```
## testvars.json example ##
```json
{
"acknowledged_risks": true,
"skip_warning": true,
"settings": {
"ftu.manifestURL": null,
"lockscreen.enabled": false
},
"prefs": {
"marionette.defaultPrefs.enabled": true,
"marionette.defaultPrefs.port": 2828
},
"carrier":{
"phone_number": "",
"country": "",
"network": ""
},
"imei": "",
"remote_phone_number": "",
"wifi": {
"ssid": ""
},
"email": {
"gmail": {
"name": "",
"email": "",
"password": ""
},
"IMAP": {
"name": "",
"email": "",
"password": "",
"imap_hostname": "",
"imap_name": "",
"imap_port": "",
"smtp_hostname": "",
"smtp_name": "",
"smtp_port": ""
},
"ActiveSync":{
"name": "",
"email": "",
"password": "",
"active_sync_hostname": "",
"active_sync_username": ""
}
},
"plivo": {
"auth_id": "",
"auth_token": "",
"phone_number": ""
}
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment