Base package for application launching and environment management.
Fixture to manage launching a Click application.A class that knows how to launch an application with a certain type of introspection enabled.
Parameters: |
|
---|
Launch a click package application with introspection enabled.
This method takes care of launching a click package with introspection exabled. You probably want to use this method if your application is packaged in a click application, or is started via upstart.
Usage is similar to NormalApplicationLauncher.launch:
from autopilot.application import ClickApplicationLauncher
launcher = ClickApplicationLauncher()
launcher.setUp()
app_proxy = launcher.launch('com.ubuntu.dropping-letters')
Parameters: |
|
---|---|
Raises: |
|
Returns: | proxy object for the launched package application |
Fixture to manage launching an application.A class that knows how to launch an application with a certain type of introspection enabled.
Parameters: |
|
---|
Launch an application and return a proxy object.
Use this method to launch an application and start testing it. The arguments passed in arguments are used as arguments to the application to launch. Additional keyword arguments are used to control the manner in which the application is launched.
This fixture is designed to be flexible enough to launch all supported types of applications. Autopilot can automatically determine how to enable introspection support for dynamically linked binary applications. For example, to launch a binary Gtk application, a test might start with:
from autopilot.application import NormalApplicationLauncher
launcher = NormalApplicationLauncher()
launcher.setUp()
app_proxy = launcher.launch('gedit')
For use within a testcase, use useFixture:
from autopilot.application import NormalApplicationLauncher launcher = self.useFixture(NormalApplicationLauncher()) app_proxy = launcher.launch(‘gedit’)
Applications can be given command line arguments by supplying an arguments argument to this method. For example, if we want to launch gedit with a certain document loaded, we might do this:
app_proxy = launcher.launch(
'gedit', arguments=['/tmp/test-document.txt'])
... a Qt5 Qml application is launched in a similar fashion:
app_proxy = launcher.launch(
'qmlscene', arguments=['my_scene.qml'])
If you wish to launch an application that is not a dynamically linked binary, you must specify the application type. For example, a Qt4 python application might be launched like this:
app_proxy = launcher.launch(
'my_qt_app.py', app_type='qt')
Similarly, a python/Gtk application is launched like so:
app_proxy = launcher.launch(
'my_gtk_app.py', app_type='gtk')
Parameters: |
|
---|---|
Returns: | A proxy object that represents the application. Introspection data is retrievable via this object. |
A launcher class that launches applications with UpstartAppLaunch.A class that knows how to launch an application with a certain type of introspection enabled.
Parameters: |
|
---|
Launch an application with upstart.
This method launches an application via the upstart-app-launch library, on platforms that support it.
Usage is similar to NormalApplicationLauncher:
from autopilot.application import UpstartApplicationLauncher
launcher = UpstartApplicationLauncher()
launcher.setUp()
app_proxy = launcher.launch('gallery-app')
Parameters: |
|
---|---|
Raises RuntimeError: | |
If the specified application cannot be launched. |
|
Returns: | proxy object for the launched package application |
Return an instance of ApplicationLauncher that knows how to launch the application at ‘app_path’.