Merge lp:~canonical-platform-qa/autopilot/custom-assert-doc into lp:autopilot

Proposed by Thomi Richards on 2015-01-20
Status: Merged
Approved by: Leo Arias on 2015-01-20
Approved revision: 526
Merged at revision: 525
Proposed branch: lp:~canonical-platform-qa/autopilot/custom-assert-doc
Merge into: lp:autopilot
Diff against target: 79 lines (+55/-1)
2 files modified
docs/tutorial/advanced_autopilot.rst (+53/-1)
docs/tutorial/good_tests.rst (+2/-0)
To merge this branch: bzr merge lp:~canonical-platform-qa/autopilot/custom-assert-doc
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration 2015-01-20 Approve on 2015-01-20
Thomi Richards (community) Approve on 2015-01-20
Leo Arias 2015-01-20 Pending
Christopher Lee 2015-01-20 Pending
Allan LeSage 2015-01-20 Pending
Review via email: mp+246963@code.launchpad.net

Commit Message

Add missing documentation for custom assert methods in advanced autopilot tutorial.

Description of the Change

Add missing documentation for custom assert methods in advanced autopilot tutorial.

To post a comment you must log in.
Thomi Richards (thomir) wrote :

Resubmitted to take into account fixes now in trunk.

review: Approve
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
No commit message was specified in the merge proposal. Hit 'Add commit message' on the merge proposal web page or follow the link below. You can approve the merge proposal yourself to rerun.
https://code.launchpad.net/~canonical-platform-qa/autopilot/custom-assert-doc/+merge/246963/+edit-commit-message

review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:525
http://jenkins.qa.ubuntu.com/job/autopilot-ci/972/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-amd64-ci/35
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-amd64-ci/35/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-armhf-ci/35
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-armhf-ci/35/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-i386-ci/35
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-i386-ci/35/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/861
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-vivid-autopilot/39
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/753
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/859
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/859/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/17203
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-vivid-autopilot/45
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-amd64/450
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-amd64/450/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/autopilot-ci/972/rebuild

review: Approve (continuous-integration)
526. By Richard Huddie on 2015-01-20

merge trunk

PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:526
http://jenkins.qa.ubuntu.com/job/autopilot-ci/977/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-amd64-ci/40
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-amd64-ci/40/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-armhf-ci/40
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-armhf-ci/40/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-i386-ci/40
        deb: http://jenkins.qa.ubuntu.com/job/autopilot-vivid-i386-ci/40/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/878/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-vivid-autopilot/50
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/770/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/876
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/876/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/17236
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-vivid-autopilot/55
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-amd64/462
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-amd64/462/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/autopilot-ci/977/rebuild

review: Approve (continuous-integration)
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/tutorial/advanced_autopilot.rst'
2--- docs/tutorial/advanced_autopilot.rst 2015-01-20 08:40:37 +0000
3+++ docs/tutorial/advanced_autopilot.rst 2015-01-20 10:51:37 +0000
4@@ -159,10 +159,62 @@
5
6 The :class:`fixtures.EnvironmentVariable` fixture will revert the value of the environment variable to it's initial value, or will delete it altogether if the environment variable did not exist when :class:`fixtures.EnvironmentVariable` was instantiated. This happens in the cleanup phase of the test execution.
7
8+.. _custom_assertions:
9+
10 Custom Assertions
11 =================
12
13-.. Document the custom assertion methods present in AutopilotTestCase
14+Autopilot provides additional custom assertion methods within the :class:`~autopilot.testcase.AutopilotTestCase` base class. These assertion methods can be used for validating the visible window stack and also properties on objects whose attributes do not have the ``wait_for`` method, such as :class:`~autopilot.process.Window` objects (See :ref:`wait_for` for more information about ``wait_for``).
15+
16+:py:mod:`autopilot.testcase.AutopilotTestCase.assertVisibleWindowStack`
17+
18+This assertion allows the test to check the start of the visible window stack by passing an iterable item of :class:`~autopilot.process.Window` instances. Minimised windows will be ignored::
19+
20+ from autopilot.process import ProcessManager
21+ from autopilot.testcase import AutopilotTestCase
22+
23+
24+ class WindowTests(AutopilotTestCase):
25+
26+ def test_window_stack(self):
27+ self.launch_some_test_apps()
28+ pm = ProcessManager.create()
29+ test_app_windows = []
30+ for window in pm.get_open_windows():
31+ if self.is_test_app(window.name):
32+ test_app_windows.append(window)
33+ self.assertVisibleWindowStack(test_app_windows)
34+
35+.. note:: The process manager is only available on environments that use bamf, i.e. desktop running Unity 7. There is currently no process manager for any other platform.
36+
37+.. _custom_assertions_assertProperty:
38+
39+:py:mod:`autopilot.testcase.AutopilotTestCase.assertProperty`
40+
41+This assertion allows the test to check properties of an object that does not have a **wait_for** method (i.e.- objects that do not come from the autopilot DBus interface). For example the :py:mod:`~autopilot.process.Window` object::
42+
43+ from autopilot.process import ProcessManager
44+ from autopilot.testcase import AutopilotTestCase
45+
46+
47+ class WindowTests(AutopilotTestCase):
48+
49+ def test_window_stack(self):
50+ self.launch_some_test_apps()
51+ pm = ProcessManager.create()
52+ for window in pm.get_open_windows():
53+ if self.is_test_app(window.name):
54+ self.assertProperty(window, is_maximized=True)
55+
56+.. note:: :py:mod:`~autopilot.testcase.AutopilotTestCase.assertProperties` is a synonym for this method.
57+
58+.. note:: The process manager is only available on environments that use bamf, i.e. desktop running Unity 7. There is currently no process manager for any other platform.
59+
60+:py:mod:`autopilot.testcase.AutopilotTestCase.assertProperties`
61+
62+See :ref:`autopilot.testcase.AutopilotTestCase.assertProperty <custom_assertions_assertProperty>`.
63+
64+.. note:: :py:mod:`~autopilot.testcase.AutopilotTestCase.assertProperty` is a synonym for this method.
65
66 .. _platform_selection:
67
68
69=== modified file 'docs/tutorial/good_tests.rst'
70--- docs/tutorial/good_tests.rst 2014-05-16 02:09:23 +0000
71+++ docs/tutorial/good_tests.rst 2015-01-20 10:51:37 +0000
72@@ -339,6 +339,8 @@
73
74 Note that you can pass any object that follows the testtools matcher protocol (so you can write your own matchers, if you like).
75
76+.. _wait_for:
77+
78 In Proxy Classes
79 ----------------
80

Subscribers

People subscribed via source and target branches