http://unity.ubuntu.com/autopilot/ has auto-generated documentation.
What is Autopilot?
Autopilot is a functional testing tool. It simulates user actions by generating keyboard and mouse events, and then testing the internal state of the application in question. It works for gtk and qt based applications.
Autopilot is written in python. Tests are standard python unit tests and introspection is done using DBus calls.