Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Latest commit

 

History

History
87 lines (47 loc) · 2.6 KB

README-Autopilot.md

File metadata and controls

87 lines (47 loc) · 2.6 KB

Running Autopilot tests

The calculator 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 calculator app, please follow the following steps below to ensure that all tests pass before proposing a merge request.

If you are looking for more info about Autopilot or writing AP tests for the calculator app, here are some useful links to help you:

For help and options on running tests, see:

Prerequisites

Install the following autopilot packages required to run the tests,

$ sudo apt-get install ubuntu-ui-toolkit-autopilot xserver-xephyr ratpoison xvfb

Running tests on the desktop

Using terminal:

  • Branch the Calculator app code, for example,

    $ bzr branch lp:ubuntu-calculator-app

  • Navigate to the tests/autopilot directory.

    $ cd ubuntu-calculator-app/tests/autopilot

  • Run all tests.

    $ autopilot3 run -vv ubuntu_calculator_app

  • To list all tests:

    $ autopilot3 list ubuntu_calculator_app

  • To run only one test (for instance: ubuntu_calculator_app.tests.test_main.MainTestCase.test_divide_by_zero)

    $ autopilot3 run -vv ubuntu_calculator_app.tests.test_main.MainTestCase.test_divide_by_zero

  • Debugging tests using autopilot vis

    $ autopilot3 launch -i Qt qmlscene app/ubuntu-calculator-app.qml

    $ autopilot3 vis

Running tests using Ubuntu SDK

Refer this tutorial to run tests on Ubuntu SDK:

Running tests within virtual environment

Warning: Running virtual environment is not working with proprietary NVidia drivers.

To run all tests from sandbox, run following command from tests/autopilot:

$ autopilot3-sandbox-run -X —windowmanager ratpoison -s 400x600x24 ubuntu_calculator_app/

Running tests on device or emulator:

Using autopkg:

  • Branch the Calculator app code, for example,

    $ bzr branch lp:ubuntu-calculator-app

  • Navigate to the source directory.

    $ cd ubuntu-calculator-app

  • Build a click package

    $ click-buddy .

  • Run the tests on device (assumes only one click package in the directory)

    $ adt-run . *.click --- ssh -s adb -- -p