1
# Running Autopilot tests
3
Ubuntu Clock 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 clock 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 clock app, here are some useful links to help you,
7
- http://developer.ubuntu.com/api/devel/ubuntu-14.10/python/autopilot/
8
- http://developer.ubuntu.com/api/devel/ubuntu-14.10/python/autopilot-emulator/
12
Install the following autopilot packages required to run the tests,
13
$ sudo apt-get install python-autopilot libautopilot-qt ubuntu-ui-toolkit-autopilot python3-autopilot-vis
16
#### Running tests on the desktop
20
1. Branch the clock app code,
21
$ bzr branch lp:ubuntu-clock-app/reboot
23
2. Navigate to the tests/autopilot directory.
24
$ cd ubuntu-clock-app/reboot/tests/autopilot
27
$ autopilot3 run -vv ubuntu_clock_app
30
$ autopilot3 list ubuntu_clock_app
32
To run only one test (for instance: test_add_single_type_alarm_must_add_to_alarm_list in TestAlarm.py):
33
$ autopilot3 run -vv ubuntu_clock_app.tests.test_alarm.TestAlarm.test_add_single_type_alarm_must_add_to_alarm_list
35
Debugging tests using autopilot vis
36
$ autopilot3 launch -i Qt qmlscene ../../app/ubuntu-clock-app.qml -I ../../builddir/backend/
40
#### Running tests on device or emulator:
44
1. navigate to the directory where the ubuntu-clock-app branch is and run:
45
$ adt-run ubuntu-clock-app --click=com.ubuntu.clock.devel --- ssh -s adb