Merge lp:~elopio/autopilot/fix1195092-tutorial-emulator_base into lp:autopilot

Proposed by Leo Arias
Status: Merged
Approved by: Thomi Richards
Approved revision: 251
Merged at revision: 251
Proposed branch: lp:~elopio/autopilot/fix1195092-tutorial-emulator_base
Merge into: lp:autopilot
Diff against target: 26 lines (+14/-3)
1 file modified
docs/tutorial/advanced_autopilot.rst (+14/-3)
To merge this branch: bzr merge lp:~elopio/autopilot/fix1195092-tutorial-emulator_base
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+171707@code.launchpad.net

Commit message

Added to the tutorial the step to pass the custom emulator as an argument to the launch_test_application method.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Looks great - thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/tutorial/advanced_autopilot.rst'
--- docs/tutorial/advanced_autopilot.rst 2013-05-28 00:52:21 +0000
+++ docs/tutorial/advanced_autopilot.rst 2013-06-27 03:20:32 +0000
@@ -250,8 +250,19 @@
250250
251 # Add custom methods here...251 # Add custom methods here...
252252
2533. As long as this custom class has been seen by the python interpreter (usually by importing it somewhere within the test suite), autopilot will use it every time it needs to generate a ``QLabel`` instance. You can also pass this class to methods like :meth:`~autopilot.introspection.DBusIntrospectionObject.select_single` instead of a string. So, for example, the following is a valid way of selecting the QLabel instances in an application::2533. Pass the emulator base as an argument to the launch_test_application method on your test class. Something like this::
254254
255 # self.app is the application proxy object.255 from autopilot.testcase import AutopilotTestCase
256
257 class TestCase(AutopilotTestCase):
258
259 def setUp(self):
260 super(TestCase, self).setUp()
261 self.app = self.launch_test_application(
262 '/path/to/the/application',
263 emulator_base=EmulatorBase)
264
2654. You can pass the emulator class to methods like :meth:`~autopilot.introspection.DBusIntrospectionObject.select_single` instead of a string. So, for example, the following is a valid way of selecting the QLabel instances in an application::
266
256 # Get all QLabels in the applicaton:267 # Get all QLabels in the applicaton:
257 labels = self.app.select_many(QLabel)268 labels = self.app.select_many(QLabel)

Subscribers

People subscribed via source and target branches