Merge lp:~elopio/ubuntu-ui-toolkit/deprecate_swipe_to_left into lp:ubuntu-ui-toolkit/staging
- deprecate_swipe_to_left
- Merge into staging
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Cris Dywan | ||||
Approved revision: | 1108 | ||||
Merged at revision: | 1130 | ||||
Proposed branch: | lp:~elopio/ubuntu-ui-toolkit/deprecate_swipe_to_left | ||||
Merge into: | lp:ubuntu-ui-toolkit/staging | ||||
Prerequisite: | lp:~elopio/ubuntu-ui-toolkit/fix_swipe | ||||
Diff against target: |
138 lines (+60/-35) 2 files modified
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/listitems.py (+35/-25) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py (+25/-10) |
||||
To merge this branch: | bzr merge lp:~elopio/ubuntu-ui-toolkit/deprecate_swipe_to_left | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Cris Dywan | Approve | ||
PS Jenkins bot | continuous-integration | Approve | |
Ubuntu SDK team | Pending | ||
Review via email: mp+223008@code.launchpad.net |
Commit message
Deprecate the swipe to delete from right to left on the autopilot helpers.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1105
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1106
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Cris Dywan (kalikiana) : | # |
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://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1106
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
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://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Leo Arias (elopio) wrote : | # |
I hate this branch. It passes, and then fails on landing. This last time, all tests failed. I'll give it another try.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1106
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1106
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1106
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1107
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1107
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1108
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Cris Dywan (kalikiana) : | # |
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://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Leo Arias (elopio) wrote : | # |
This is a joke. What changes between the landing run and the other runs?
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1108
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Cris Dywan (kalikiana) : | # |
Preview Diff
1 | === modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/listitems.py' |
2 | --- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/listitems.py 2014-06-13 21:34:43 +0000 |
3 | +++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/listitems.py 2014-06-27 12:44:51 +0000 |
4 | @@ -39,39 +39,49 @@ |
5 | 'QQuickItem', objectName='confirmRemovalDialog') |
6 | |
7 | @autopilot_logging.log_action(logger.info) |
8 | - def swipe_to_delete(self, direction='right'): |
9 | - """Swipe the item in a specific direction.""" |
10 | + def swipe_to_delete(self, direction='deprecated'): |
11 | + """Swipe the item in from left to right in order to delete it. |
12 | + |
13 | + :param direction: deprecated. The only direction that will cause a |
14 | + delete is left to right. Do not pass any argument to this method, |
15 | + because it will be removed in future versions. |
16 | + |
17 | + """ |
18 | + if direction != 'deprecated': |
19 | + logger.warn( |
20 | + 'The direction argument is deprecated. Now the Ubuntu SDK ' |
21 | + 'only deletes list items when swiping from left to right. ' |
22 | + 'Call swipe_to_delete without arguments.') |
23 | + else: |
24 | + direction = 'right' |
25 | if self.removable: |
26 | - # Swipe to delete is always right to left |
27 | - if direction == 'left': |
28 | - direction = 'right' |
29 | - self._drag_pointing_device_to_delete(direction) |
30 | - if self.confirmRemoval: |
31 | - self.waitingConfirmationForRemoval.wait_for(True) |
32 | - else: |
33 | - self._wait_until_deleted() |
34 | + self._swipe_to_delete_removable_item(direction) |
35 | else: |
36 | raise _common.ToolkitException( |
37 | 'The item "{0}" is not removable'.format(self.objectName)) |
38 | |
39 | - def _drag_pointing_device_to_delete(self, direction): |
40 | + def _swipe_to_delete_removable_item(self, direction): |
41 | + if direction == 'left': |
42 | + raise _common.ToolkitException( |
43 | + 'Only swiping to the right will cause the item to be deleted.') |
44 | + elif direction != 'right': |
45 | + raise _common.ToolkitException( |
46 | + 'Invalid direction "{0}" used on swipe to delete function' |
47 | + .format(direction)) |
48 | + |
49 | + self._drag_pointing_device_to_delete() |
50 | + if self.confirmRemoval: |
51 | + self.waitingConfirmationForRemoval.wait_for(True) |
52 | + else: |
53 | + self._wait_until_deleted() |
54 | + |
55 | + def _drag_pointing_device_to_delete(self): |
56 | x, y, width, height = self.globalRect |
57 | - left_x = x + (width * 0.2) |
58 | - right_x = x + (width * 0.8) |
59 | + start_x = x + (width * 0.2) |
60 | + stop_x = x + (width * 0.8) |
61 | start_y = stop_y = y + (height // 2) |
62 | |
63 | - if direction == 'right': |
64 | - start_x = left_x |
65 | - stop_x = right_x |
66 | - self.pointing_device.drag(start_x, start_y, stop_x, stop_y) |
67 | - elif direction == 'left': |
68 | - start_x = right_x |
69 | - stop_x = left_x |
70 | - self.pointing_device.drag(start_x, start_y, stop_x, stop_y) |
71 | - else: |
72 | - raise _common.ToolkitException( |
73 | - 'Invalid direction "{0}" used on swipe to delete function' |
74 | - .format(direction)) |
75 | + self.pointing_device.drag(start_x, start_y, stop_x, stop_y) |
76 | |
77 | def _wait_until_deleted(self): |
78 | try: |
79 | |
80 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py' |
81 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py 2014-06-06 09:31:54 +0000 |
82 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_listitems.py 2014-06-27 12:44:51 +0000 |
83 | @@ -14,6 +14,11 @@ |
84 | # You should have received a copy of the GNU Lesser General Public License |
85 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
86 | |
87 | +import logging |
88 | + |
89 | +import fixtures |
90 | +from testtools.matchers import Contains |
91 | + |
92 | import ubuntuuitoolkit |
93 | from ubuntuuitoolkit import listitems, tests |
94 | |
95 | @@ -119,10 +124,26 @@ |
96 | self._item.swipe_to_delete('right') |
97 | self.assertTrue(self._item.waitingConfirmationForRemoval) |
98 | |
99 | - def test_swipe_item_to_left(self): |
100 | - # This will do a right to left swipe behind the scenes |
101 | - self._item.swipe_to_delete('left') |
102 | - self.assertTrue(self._item.waitingConfirmationForRemoval) |
103 | + def test_swipe_item_to_left_must_raise_exception(self): |
104 | + error = self.assertRaises( |
105 | + ubuntuuitoolkit.ToolkitException, |
106 | + self._item.swipe_to_delete, |
107 | + 'left') |
108 | + self.assertEqual( |
109 | + str(error), |
110 | + 'Only swiping to the right will cause the item to be deleted.') |
111 | + |
112 | + def test_swipe_item_with_direction_must_log_deprecation_warning(self): |
113 | + fake_logger = fixtures.FakeLogger(level=logging.WARNING) |
114 | + self.useFixture(fake_logger) |
115 | + |
116 | + self._item.swipe_to_delete(direction='right') |
117 | + self.assertThat( |
118 | + fake_logger.output, |
119 | + Contains( |
120 | + 'The direction argument is deprecated. Now the Ubuntu SDK ' |
121 | + 'only deletes list items when swiping from left to right. ' |
122 | + 'Call swipe_to_delete without arguments.')) |
123 | |
124 | def test_swipe_item_to_wrong_direction(self): |
125 | self.assertRaises( |
126 | @@ -134,12 +155,6 @@ |
127 | self._item.confirm_removal() |
128 | self.assertFalse(self._item.exists()) |
129 | |
130 | - def test_delete_item_moving_left(self): |
131 | - # This will do a right to left swipe behind the scenes |
132 | - self._item.swipe_to_delete('left') |
133 | - self._item.confirm_removal() |
134 | - self.assertFalse(self._item.exists()) |
135 | - |
136 | def test_delete_non_removable_item(self): |
137 | self._item = self.main_view.select_single( |
138 | listitems.Empty, objectName='listitem_empty') |
FAILED: Continuous integration, rev:1105 jenkins. qa.ubuntu. com/job/ ubuntu- sdk-team- ubuntu- ui-toolkit- staging- ci/366/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/840 jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 777/console jenkins. qa.ubuntu. com/job/ ubuntu- sdk-team- ubuntu- ui-toolkit- staging- utopic- amd64-ci/ 198 jenkins. qa.ubuntu. com/job/ ubuntu- sdk-team- ubuntu- ui-toolkit- staging- utopic- armhf-ci/ 198 jenkins. qa.ubuntu. com/job/ ubuntu- sdk-team- ubuntu- ui-toolkit- staging- utopic- armhf-ci/ 198/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ ubuntu- sdk-team- ubuntu- ui-toolkit- staging- utopic- i386-ci/ 198/console jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/1253 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1540 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1540/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 8372 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 689/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/916 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/916/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- sdk-team- ubuntu- ui-toolkit- staging- ci/366/ rebuild
http://