Merge lp:~elopio/ubuntu-ui-toolkit/fix1248740-composer_sheet_emulator into lp:ubuntu-ui-toolkit
- fix1248740-composer_sheet_emulator
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Cris Dywan | ||||
Approved revision: | 833 | ||||
Merged at revision: | 870 | ||||
Proposed branch: | lp:~elopio/ubuntu-ui-toolkit/fix1248740-composer_sheet_emulator | ||||
Merge into: | lp:ubuntu-ui-toolkit | ||||
Diff against target: |
119 lines (+97/-0) 2 files modified
tests/autopilot/ubuntuuitoolkit/emulators.py (+21/-0) tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py (+76/-0) |
||||
To merge this branch: | bzr merge lp:~elopio/ubuntu-ui-toolkit/fix1248740-composer_sheet_emulator | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Florian Boucault (community) | Approve | ||
Thomi Richards (community) | Approve | ||
Review via email:
|
Commit message
Added a ComposerSheet autopilot emulator.
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Thomi Richards (thomir-deactivatedaccount) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Leo Arias (elopio) wrote : | # |
We need to wait for the new autopilot to be packaged and released in order to use wait_until_
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:828
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:828
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:829
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:830
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:830
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:831
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:833
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Florian Boucault (fboucault) wrote : | # |
Good to go.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'tests/autopilot/ubuntuuitoolkit/emulators.py' |
2 | --- tests/autopilot/ubuntuuitoolkit/emulators.py 2013-11-22 15:59:48 +0000 |
3 | +++ tests/autopilot/ubuntuuitoolkit/emulators.py 2013-11-27 18:51:44 +0000 |
4 | @@ -532,3 +532,24 @@ |
5 | |
6 | class Subtitled(Base): |
7 | pass |
8 | + |
9 | + |
10 | +class ComposerSheet(UbuntuUIToolkitEmulatorBase): |
11 | + """ComposerSheet Autopilot emulator.""" |
12 | + |
13 | + def __init__(self, *args): |
14 | + super(ComposerSheet, self).__init__(*args) |
15 | + |
16 | + @autopilot_logging.log_action(logger.info) |
17 | + def confirm(self): |
18 | + """Confirm the composer sheet.""" |
19 | + button = self.select_single('Button', objectName='confirmButton') |
20 | + self.pointing_device.click_object(button) |
21 | + self.wait_until_destroyed() |
22 | + |
23 | + @autopilot_logging.log_action(logger.info) |
24 | + def cancel(self): |
25 | + """Cancel the composer sheet.""" |
26 | + button = self.select_single('Button', objectName='cancelButton') |
27 | + self.pointing_device.click_object(button) |
28 | + self.wait_until_destroyed() |
29 | |
30 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py' |
31 | --- tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py 2013-11-17 04:41:14 +0000 |
32 | +++ tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py 2013-11-27 18:51:44 +0000 |
33 | @@ -20,6 +20,7 @@ |
34 | |
35 | import autopilot |
36 | from autopilot import input, platform |
37 | +from autopilot.introspection import dbus |
38 | from testtools.matchers import GreaterThan, LessThan |
39 | |
40 | from ubuntuuitoolkit import emulators, tests |
41 | @@ -750,3 +751,78 @@ |
42 | self._go_to_page1() |
43 | self.main_view.go_back() |
44 | self.assertEqual(self.header.title, 'Page 0') |
45 | + |
46 | + |
47 | +class ComposerSheetTestCase(tests.QMLStringAppTestCase): |
48 | + |
49 | + test_qml = (""" |
50 | +import QtQuick 2.0 |
51 | +import Ubuntu.Components 0.1 |
52 | +import Ubuntu.Components.Popups 0.1 |
53 | + |
54 | +MainView { |
55 | + width: units.gu(48) |
56 | + height: units.gu(60) |
57 | + |
58 | + Button { |
59 | + objectName: "openComposerSheetButton" |
60 | + text: "Open Composer Sheet" |
61 | + onClicked: PopupUtils.open(testComposerSheet); |
62 | + } |
63 | + |
64 | + Label { |
65 | + id: "label" |
66 | + objectName: "actionLabel" |
67 | + anchors.centerIn: parent |
68 | + text: "No action taken." |
69 | + } |
70 | + |
71 | + Component { |
72 | + id: testComposerSheet |
73 | + ComposerSheet { |
74 | + id: sheet |
75 | + objectName: "testComposerSheet" |
76 | + onCancelClicked: { |
77 | + label.text = "Cancel selected." |
78 | + } |
79 | + onConfirmClicked: { |
80 | + label.text = "Confirm selected." |
81 | + } |
82 | + } |
83 | + } |
84 | +} |
85 | +""") |
86 | + |
87 | + def setUp(self): |
88 | + super(ComposerSheetTestCase, self).setUp() |
89 | + self.label = self.main_view.select_single( |
90 | + 'Label', objectName='actionLabel') |
91 | + self.assertEqual(self.label.text, 'No action taken.') |
92 | + self._open_composer_sheet() |
93 | + self.composer_sheet = self._select_composer_sheet() |
94 | + |
95 | + def _open_composer_sheet(self): |
96 | + button = self.main_view.select_single( |
97 | + 'Button', objectName='openComposerSheetButton') |
98 | + self.pointing_device.click_object(button) |
99 | + |
100 | + def _select_composer_sheet(self): |
101 | + return self.main_view.select_single( |
102 | + emulators.ComposerSheet, objectName='testComposerSheet') |
103 | + |
104 | + def test_select_composer_sheet_custom_emulator(self): |
105 | + self.assertIsInstance(self.composer_sheet, emulators.ComposerSheet) |
106 | + |
107 | + def test_confirm_composer_sheet(self): |
108 | + self.composer_sheet.confirm() |
109 | + self.assertEqual(self.label.text, 'Confirm selected.') |
110 | + self._assert_composer_sheet_is_closed() |
111 | + |
112 | + def _assert_composer_sheet_is_closed(self): |
113 | + self.assertRaises( |
114 | + dbus.StateNotFoundError, self._select_composer_sheet) |
115 | + |
116 | + def test_cancel_composer_sheet(self): |
117 | + self.composer_sheet.cancel() |
118 | + self.assertEqual(self.label.text, 'Cancel selected.') |
119 | + self._assert_composer_sheet_is_closed() |
LGTM