1
# Running Autopilot tests
3
Music 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 music 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 music 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
* Branch the music app code, for example,
21
$ bzr branch lp:music-ap
23
* Navigate to the tests/autopilot directory.
24
$ cd music-app/tests/autopilot
27
$ autopilot3 run -vv music_app
30
$ autopilot3 list music_app
32
To run only one test (for instance: music_app.tests.test_music.TestMainWindow.test_swipe_to_delete_song)
33
$ autopilot3 run -vv music_app.tests.test_music.TestMainWindow.test_swipe_to_delete_song
35
Debugging tests using autopilot vis
36
$ autopilot3 launch -i Qt qmlscene music-app.qml
40
## Running tests on device or emulator:
42
NOTE: Prior to running the tests on the device, you will need to do the following if there is music on the system:
44
$ mv /home/phablet/Music /home/phablet/.Music
45
$ restart mediascanner-2.0
49
1. navigate to the directory where the music-app branch is and run:
50
$ adt-run music-app --click=com.ubuntu.music --- ssh -s adb