How do I contribute an autopilot test?

What is Autopilot?

From the Ubuntu wiki:

Autopilot is a functional testing tool for Unity. It simulates user actions by generating keyboard and mouse events, and then testing the internal state of Unity and associated applications.

You can get involved with testing by joining the QA team. Here is a link to their mailing list - ubuntu-quality, their launchpad page, as well as the official Ubuntu QA page.

Installation

To install Autopilot from the command line, run the following commands:

sudo add-apt-repository ppa:autopilot/ppa
sudo apt-get update && sudo apt-get install python-autopilot

An example of a simple test unit:

autopilot run unity.tests.test_showdesktop.ShowDesktopTests.test_showdesktop_hides_apps 

Warning: Running autopilot tests on your default desktop will cause your pc to send mouse and keyboard movements without your control. Please read the articles below before blindly running this command.

Tutorials

There is a tutorial here. Additionally, there have been several good articles mentioned in the Ubuntu weekly newsletter. These were written by Nicholas Skaggs, a community coordinator on the testing team, that have been very useful for me.

Autopilot: part 1

Autopilot: part 2 - Here the author walks through a simple "hello world" use case of autopilot

Autopilot: part 3

I highly recommend reading the three above linked articles before getting started with autopilot.

Contributing Testcases

You can submit test cases by emailing the ubuntu-quality mailing list using a specified format outlined here.

Additionally, test cases can be pulled via bzr using the following command:

bzr branch lp:ubuntu-autopilot-tests

Adding test case changes to the code branch can be done with a bzr push comand:

bzr push lp:<username>/ubuntu-autopilot-tests/ubuntu-autopilot-tests

See http://code.launchpad.net/ubuntu-autopilot-tests for more information.