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 | 39 | 'QQuickItem', objectName='confirmRemovalDialog') | 39 | 'QQuickItem', objectName='confirmRemovalDialog') |
6 | 40 | 40 | ||
7 | 41 | @autopilot_logging.log_action(logger.info) | 41 | @autopilot_logging.log_action(logger.info) |
10 | 42 | def swipe_to_delete(self, direction='right'): | 42 | def swipe_to_delete(self, direction='deprecated'): |
11 | 43 | """Swipe the item in a specific direction.""" | 43 | """Swipe the item in from left to right in order to delete it. |
12 | 44 | |||
13 | 45 | :param direction: deprecated. The only direction that will cause a | ||
14 | 46 | delete is left to right. Do not pass any argument to this method, | ||
15 | 47 | because it will be removed in future versions. | ||
16 | 48 | |||
17 | 49 | """ | ||
18 | 50 | if direction != 'deprecated': | ||
19 | 51 | logger.warn( | ||
20 | 52 | 'The direction argument is deprecated. Now the Ubuntu SDK ' | ||
21 | 53 | 'only deletes list items when swiping from left to right. ' | ||
22 | 54 | 'Call swipe_to_delete without arguments.') | ||
23 | 55 | else: | ||
24 | 56 | direction = 'right' | ||
25 | 44 | if self.removable: | 57 | if self.removable: |
34 | 45 | # Swipe to delete is always right to left | 58 | self._swipe_to_delete_removable_item(direction) |
27 | 46 | if direction == 'left': | ||
28 | 47 | direction = 'right' | ||
29 | 48 | self._drag_pointing_device_to_delete(direction) | ||
30 | 49 | if self.confirmRemoval: | ||
31 | 50 | self.waitingConfirmationForRemoval.wait_for(True) | ||
32 | 51 | else: | ||
33 | 52 | self._wait_until_deleted() | ||
35 | 53 | else: | 59 | else: |
36 | 54 | raise _common.ToolkitException( | 60 | raise _common.ToolkitException( |
37 | 55 | 'The item "{0}" is not removable'.format(self.objectName)) | 61 | 'The item "{0}" is not removable'.format(self.objectName)) |
38 | 56 | 62 | ||
40 | 57 | def _drag_pointing_device_to_delete(self, direction): | 63 | def _swipe_to_delete_removable_item(self, direction): |
41 | 64 | if direction == 'left': | ||
42 | 65 | raise _common.ToolkitException( | ||
43 | 66 | 'Only swiping to the right will cause the item to be deleted.') | ||
44 | 67 | elif direction != 'right': | ||
45 | 68 | raise _common.ToolkitException( | ||
46 | 69 | 'Invalid direction "{0}" used on swipe to delete function' | ||
47 | 70 | .format(direction)) | ||
48 | 71 | |||
49 | 72 | self._drag_pointing_device_to_delete() | ||
50 | 73 | if self.confirmRemoval: | ||
51 | 74 | self.waitingConfirmationForRemoval.wait_for(True) | ||
52 | 75 | else: | ||
53 | 76 | self._wait_until_deleted() | ||
54 | 77 | |||
55 | 78 | def _drag_pointing_device_to_delete(self): | ||
56 | 58 | x, y, width, height = self.globalRect | 79 | x, y, width, height = self.globalRect |
59 | 59 | left_x = x + (width * 0.2) | 80 | start_x = x + (width * 0.2) |
60 | 60 | right_x = x + (width * 0.8) | 81 | stop_x = x + (width * 0.8) |
61 | 61 | start_y = stop_y = y + (height // 2) | 82 | start_y = stop_y = y + (height // 2) |
62 | 62 | 83 | ||
75 | 63 | if direction == 'right': | 84 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) |
64 | 64 | start_x = left_x | ||
65 | 65 | stop_x = right_x | ||
66 | 66 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) | ||
67 | 67 | elif direction == 'left': | ||
68 | 68 | start_x = right_x | ||
69 | 69 | stop_x = left_x | ||
70 | 70 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) | ||
71 | 71 | else: | ||
72 | 72 | raise _common.ToolkitException( | ||
73 | 73 | 'Invalid direction "{0}" used on swipe to delete function' | ||
74 | 74 | .format(direction)) | ||
76 | 75 | 85 | ||
77 | 76 | def _wait_until_deleted(self): | 86 | def _wait_until_deleted(self): |
78 | 77 | try: | 87 | try: |
79 | 78 | 88 | ||
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 | 14 | # You should have received a copy of the GNU Lesser General Public License | 14 | # You should have received a copy of the GNU Lesser General Public License |
85 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
86 | 16 | 16 | ||
87 | 17 | import logging | ||
88 | 18 | |||
89 | 19 | import fixtures | ||
90 | 20 | from testtools.matchers import Contains | ||
91 | 21 | |||
92 | 17 | import ubuntuuitoolkit | 22 | import ubuntuuitoolkit |
93 | 18 | from ubuntuuitoolkit import listitems, tests | 23 | from ubuntuuitoolkit import listitems, tests |
94 | 19 | 24 | ||
95 | @@ -119,10 +124,26 @@ | |||
96 | 119 | self._item.swipe_to_delete('right') | 124 | self._item.swipe_to_delete('right') |
97 | 120 | self.assertTrue(self._item.waitingConfirmationForRemoval) | 125 | self.assertTrue(self._item.waitingConfirmationForRemoval) |
98 | 121 | 126 | ||
103 | 122 | def test_swipe_item_to_left(self): | 127 | def test_swipe_item_to_left_must_raise_exception(self): |
104 | 123 | # This will do a right to left swipe behind the scenes | 128 | error = self.assertRaises( |
105 | 124 | self._item.swipe_to_delete('left') | 129 | ubuntuuitoolkit.ToolkitException, |
106 | 125 | self.assertTrue(self._item.waitingConfirmationForRemoval) | 130 | self._item.swipe_to_delete, |
107 | 131 | 'left') | ||
108 | 132 | self.assertEqual( | ||
109 | 133 | str(error), | ||
110 | 134 | 'Only swiping to the right will cause the item to be deleted.') | ||
111 | 135 | |||
112 | 136 | def test_swipe_item_with_direction_must_log_deprecation_warning(self): | ||
113 | 137 | fake_logger = fixtures.FakeLogger(level=logging.WARNING) | ||
114 | 138 | self.useFixture(fake_logger) | ||
115 | 139 | |||
116 | 140 | self._item.swipe_to_delete(direction='right') | ||
117 | 141 | self.assertThat( | ||
118 | 142 | fake_logger.output, | ||
119 | 143 | Contains( | ||
120 | 144 | 'The direction argument is deprecated. Now the Ubuntu SDK ' | ||
121 | 145 | 'only deletes list items when swiping from left to right. ' | ||
122 | 146 | 'Call swipe_to_delete without arguments.')) | ||
123 | 126 | 147 | ||
124 | 127 | def test_swipe_item_to_wrong_direction(self): | 148 | def test_swipe_item_to_wrong_direction(self): |
125 | 128 | self.assertRaises( | 149 | self.assertRaises( |
126 | @@ -134,12 +155,6 @@ | |||
127 | 134 | self._item.confirm_removal() | 155 | self._item.confirm_removal() |
128 | 135 | self.assertFalse(self._item.exists()) | 156 | self.assertFalse(self._item.exists()) |
129 | 136 | 157 | ||
130 | 137 | def test_delete_item_moving_left(self): | ||
131 | 138 | # This will do a right to left swipe behind the scenes | ||
132 | 139 | self._item.swipe_to_delete('left') | ||
133 | 140 | self._item.confirm_removal() | ||
134 | 141 | self.assertFalse(self._item.exists()) | ||
135 | 142 | |||
136 | 143 | def test_delete_non_removable_item(self): | 158 | def test_delete_non_removable_item(self): |
137 | 144 | self._item = self.main_view.select_single( | 159 | self._item = self.main_view.select_single( |
138 | 145 | listitems.Empty, objectName='listitem_empty') | 160 | 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://