1
# Running Autopilot tests
3
The Weather app follows a test driven development where autopilot tests are run before every merge into trunk. If you are submitting your bugfix/patch to the Weather app, please follow the following steps below to ensure that all tests pass before proposing a merge request.
5
If you are looking for more info about Autopilot or writing AP tests for the weather app, here are some useful links to help you:
7
- http://developer.ubuntu.com/start/quality
8
- https://developer.ubuntu.com/api/autopilot/python/1.5.0/
10
For help and options on running tests, see:
12
- https://developer.ubuntu.com/en/start/platform/guides/running-autopilot-tests/
16
Install the following autopilot packages required to run the tests,
17
$ sudo apt-get install python3-autopilot libautopilot-qt ubuntu-ui-toolkit-autopilot python3-autopilot-vis
19
## Running tests on the desktop
23
* Branch the Weather app code, for example,
24
$ bzr branch lp:ubuntu-weather-app
26
* Navigate to the tests/autopilot directory.
27
$ cd ubuntu-weather-app/tests/autopilot
30
$ autopilot3 run -vv ubuntu_weather_app
33
$ autopilot3 list ubuntu_weather_app
35
To run only one test (for instance: ubuntu_weather_app.tests.test_empty_state.TestEmptyState.test_add_location_button)
36
$ autopilot3 run -vv ubuntu_weather_app.tests.test_empty_state.TestEmptyState.test_add_location_button
38
Debugging tests using autopilot vis
39
$ autopilot3 launch -i Qt qmlscene app/ubuntu-weather-app.qml
43
## Running tests on device or emulator:
47
* Branch the Weather app code, for example,
48
$ bzr branch lp:ubuntu-weather-app
50
* Navigate to the source directory.
51
$ cd ubuntu-weather-app
53
* Build a click package
56
* Run the tests on device (assumes only one click package in the directory)
57
$ adt-run . *.click --- ssh -s adb -- -p <PASSWORD>