Merge lp:~canonical-platform-qa/unity8/click_item_with_swipe into lp:unity8

Proposed by Leo Arias on 2015-04-21
Status: Merged
Approved by: Albert Astals Cid on 2015-05-22
Approved revision: 1530
Merged at revision: 1813
Proposed branch: lp:~canonical-platform-qa/unity8/click_item_with_swipe
Merge into: lp:unity8
Prerequisite: lp:~saviq/unity8/fix-flake8
Diff against target: 89 lines (+22/-9)
3 files modified
debian/control (+1/-1)
tests/autopilot/unity8/shell/emulators/dash.py (+15/-8)
tests/autopilot/unity8/shell/tests/test_emulators.py (+6/-0)
To merge this branch: bzr merge lp:~canonical-platform-qa/unity8/click_item_with_swipe
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration 2015-04-21 Approve on 2015-05-22
Michał Sawicz 2015-04-22 Approve on 2015-04-22
Christopher Lee 2015-04-21 Pending
Review via email: mp+256961@code.launchpad.net

This proposal supersedes a proposal from 2014-12-17.

Commit Message

On the autopilot helpers, swipe if the item to open from the dash is not visible.
unity8-autopilot dependencies now require ubuntu-ui-toolkit-autopilot (>= 1.2.1485+15.04.20150417.1-0ubuntu1)

Description of the Change

This branch requires https://code.launchpad.net/~canonical-platform-qa/ubuntu-ui-toolkit/fix1401517-overwrite_swipe_borders/+merge/248986 that has already landed in ubuntu-ui-toolkit trunk as part of http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk/revision/1178

We need it in order to open apps from the dash in order to automate the sanity tests.

 * Are there any related MPs required for this MP to build/function as expected? Please list.

fix-flake8 branch is a dependency, to avoid conflicts.

 * Did you perform an exploratory manual test run of your code change and any related functionality?

just ran the tests.

 * Did you make sure that your branch does not contain spurious tags?

yes.

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

No debian changes.

 * If you changed the UI, has there been a design review?

No UI changes.

To post a comment you must log in.
Leo Arias (elopio) wrote : Posted in a previous version of this proposal

Once the branch in the toolkit lands, we have to update this branch to use grid units for the margin.

Christopher Lee (veebers) wrote : Posted in a previous version of this proposal

I have a query regarding consistency between this and what was/is used in the sanity suite.

review: Needs Fixing
Brendan Donegan (brendan-donegan) wrote : Posted in a previous version of this proposal

Followed up on veebers question. Update to use the grid units, then it's a LGTM

Leo Arias (elopio) wrote : Posted in a previous version of this proposal

Thanks for noticing that veebers. I made the wrong paste, sorry about that.
I will give a run on the sanity once this branch is ready for review.

Michał Sawicz (saviq) wrote :

Unity8-autopilot's Depends should be updated to require the change in UITK.

One inline bit and otherwise, fine.

review: Needs Fixing
Leo Arias (elopio) wrote :

Thanks saviq. I pushed two changes.

Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
Bug #1446846
 * Did you make sure that the branch does not contain spurious tags?
Y

review: Approve
1530. By Leo Arias on 2015-05-22

Merged with trunk.

Albert Astals Cid (aacid) wrote :

Any idea why Paul Larson top un-approved this?

Brendan Donegan (brendan-donegan) wrote :

We should probably rerun the Jenkins job as it is stale now and we can't even read the results.

Albert Astals Cid (aacid) wrote :

Retriggered CI

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-04-22 14:43:17 +0000
3+++ debian/control 2015-05-22 13:46:18 +0000
4@@ -150,7 +150,7 @@
5 python3-fixtures,
6 python3-gi,
7 qttestability-autopilot (>= 1.4),
8- ubuntu-ui-toolkit-autopilot,
9+ ubuntu-ui-toolkit-autopilot (>= 1.2.1485+15.04.20150417.1-0ubuntu1),
10 unity-scope-click,
11 unity8 (= ${source:Version}),
12 unity8-fake-env (= ${source:Version}),
13
14=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
15--- tests/autopilot/unity8/shell/emulators/dash.py 2015-04-28 15:20:13 +0000
16+++ tests/autopilot/unity8/shell/emulators/dash.py 2015-05-22 13:46:18 +0000
17@@ -185,14 +185,15 @@
18
19
20 class ListViewWithPageHeader(ubuntuuitoolkit.QQuickFlickable):
21- pass
22+
23+ margin_to_swipe_from_bottom = ubuntuuitoolkit.units.gu(4)
24
25
26 class GenericScopeView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
27 """Autopilot emulator for generic scopes."""
28
29 @autopilot_logging.log_action(logger.info)
30- def open_preview(self, category, app_name):
31+ def open_preview(self, category, app_name, press_duration=0.10):
32 """Open the preview of an application.
33
34 :parameter category: The name of the category where the application is.
35@@ -203,16 +204,19 @@
36 # FIXME some categories need a long press in order to see the preview.
37 # Some categories do not show previews, like recent apps.
38 # --elopio - 2014-1-14
39- self.click_scope_item(category, app_name)
40+ self.click_scope_item(category, app_name, press_duration)
41 preview_list = self.wait_select_single(
42 'QQuickLoader', objectName='subPageLoader')
43 preview_list.subPageShown.wait_for(True)
44 preview_list.x.wait_for(0)
45+ self.get_root_instance().select_single(
46+ objectName='processingIndicator').visible.wait_for(False)
47 return preview_list.select_single(
48- Preview, objectName='preview{}'.format(preview_list.currentIndex))
49+ Preview, objectName='preview{}'.format(
50+ preview_list.initialIndex))
51
52 @autopilot_logging.log_action(logger.debug)
53- def click_scope_item(self, category, title):
54+ def click_scope_item(self, category, title, press_duration=0.10):
55 """Click an item from the scope.
56
57 :parameter category: The name of the category where the item is.
58@@ -220,9 +224,12 @@
59
60 """
61 category_element = self._get_category_element(category)
62- icon = category_element.wait_select_single('AbstractButton',
63- title=title)
64- self.pointing_device.click_object(icon)
65+ icon = category_element.wait_select_single(
66+ 'AbstractButton', title=title)
67+ list_view = self.select_single(
68+ ListViewWithPageHeader, objectName='categoryListView')
69+ list_view.swipe_child_into_view(icon)
70+ self.pointing_device.click_object(icon, press_duration=press_duration)
71
72 def _get_category_element(self, category):
73 try:
74
75=== modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
76--- tests/autopilot/unity8/shell/tests/test_emulators.py 2015-04-17 21:58:16 +0000
77+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2015-05-22 13:46:18 +0000
78@@ -120,6 +120,12 @@
79 self.assertIsInstance(preview, dash_emulators.Preview)
80 self.assertTrue(preview.isCurrent)
81
82+ def test_open_preview_of_non_visible_item(self):
83+ """Open an item that requires swiping to make it visible."""
84+ preview = self.generic_scope.open_preview('2', 'Title.2.0')
85+ self.assertIsInstance(preview, dash_emulators.Preview)
86+ self.assertTrue(preview.isCurrent)
87+
88
89 class DashAppsEmulatorTestCase(tests.DashBaseTestCase):
90

Subscribers

People subscribed via source and target branches