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

Proposed by Leo Arias
Status: Merged
Approved by: Michał Sawicz
Approved revision: 998
Merged at revision: 1156
Proposed branch: lp:~canonical-platform-qa/unity8/test_open_dash
Merge into: lp:unity8
Prerequisite: lp:~elopio/unity8/flake8
Diff against target: 155 lines (+62/-20)
5 files modified
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py (+8/-0)
tests/autopilot/unity8/shell/emulators/launcher.py (+34/-13)
tests/autopilot/unity8/shell/emulators/main_window.py (+17/-3)
tests/autopilot/unity8/shell/tests/disabled_test_hud.py (+1/-2)
tests/autopilot/unity8/shell/tests/test_notifications.py (+2/-2)
To merge this branch: bzr merge lp:~canonical-platform-qa/unity8/test_open_dash
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Brendan Donegan (community) Approve
Albert Astals Cid Pending
Review via email: mp+227564@code.launchpad.net

This proposal supersedes a proposal from 2014-06-26.

Commit message

Added autopilot helpers and tests for the launcher and dash icon.

Description of the change

This branch adds the helpers we need to make a regression test for bug #1090358, so that even with the osk open we can go back to the dash with the icon.

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

Only the prerequisite that fixes static errors: https://code.launchpad.net/~elopio/unity8/flake8

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

More or less. I didn't change any functionality, but I did run the tests I added and did some exploratory on the related properties and components.

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

Yes I did.

 * 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.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

Text conflict in tests/autopilot/unity8/shell/emulators/main_window.py
1 conflicts encountered.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

Just resubmit to make it a team branch, according to the new QA team policy.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

This looks good, it can land.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

Back to work in progress because the dash app branch will break this. Working on that first.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

See inline.

review: Needs Information
Revision history for this message
Michał Sawicz (saviq) wrote :

Please run http://people.canonical.com/~msawicz/unity8/strip-u8-tags.py on this branch and any local checkouts you might have.

review: Needs Fixing
Revision history for this message
Leo Arias (elopio) wrote :

Done. Ready for a new review.

Thanks.

Revision history for this message
Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes. Tests pass.

 * Did CI run pass? If not, please explain why.
Just unrelated qml failures, fixed in another branch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py'
2--- tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py 2014-07-31 05:52:29 +0000
3+++ tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py 2014-08-11 15:29:51 +0000
4@@ -115,3 +115,11 @@
5 self.launch_upstart_application(application_name)
6 self.assertThat(greeter.created, Eventually(Equals(False)))
7 self.assert_current_focused_application(application_name)
8+
9+ def test_click_dash_icon_must_unfocus_application(self):
10+ application_name = self.launch_fake_app()
11+ self.assert_current_focused_application(application_name)
12+
13+ self.main_window.show_dash_from_launcher()
14+
15+ self.assert_current_focused_application('unity8-dash')
16
17=== modified file 'tests/autopilot/unity8/shell/emulators/launcher.py'
18--- tests/autopilot/unity8/shell/emulators/launcher.py 2013-11-01 13:59:50 +0000
19+++ tests/autopilot/unity8/shell/emulators/launcher.py 2014-08-11 15:29:51 +0000
20@@ -1,7 +1,7 @@
21 # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
22 #
23 # Unity Autopilot Test Suite
24-# Copyright (C) 2012-2013 Canonical
25+# Copyright (C) 2012, 2013, 2014 Canonical
26 #
27 # This program is free software: you can redistribute it and/or modify
28 # it under the terms of the GNU General Public License as published by
29@@ -17,22 +17,43 @@
30 # along with this program. If not, see <http://www.gnu.org/licenses/>.
31 #
32
33-from unity8.shell.emulators import UnityEmulatorBase
34-from autopilot.input import Touch
35-
36-
37-class Launcher(UnityEmulatorBase):
38+import logging
39+
40+import autopilot.logging
41+
42+from unity8.shell import emulators
43+
44+
45+logger = logging.getLogger(__name__)
46+
47+
48+class Launcher(emulators.UnityEmulatorBase):
49
50 """An emulator that understands the Launcher."""
51
52+ @autopilot.logging.log_action(logger.debug)
53 def show(self):
54- """Swipes open the launcher."""
55- touch = Touch.create()
56+ """Show the launcher swiping it to the right."""
57+ if not self.shown:
58+ self._swipe_to_show_launcher()
59+ self.shown.wait_for(True)
60+ else:
61+ logger.debug('The launcher is already opened.')
62
63+ def _swipe_to_show_launcher(self):
64 view = self.get_root_instance().select_single('QQuickView')
65+ start_y = stop_y = view.y + view.height // 2
66+
67 start_x = view.x + 1
68- start_y = view.y + view.height / 2
69- stop_x = start_x + self.panelWidth + 1
70- stop_y = start_y
71- touch.drag(start_x, start_y, stop_x, stop_y)
72- self.shown.wait_for(True)
73+ stop_x = start_x + self.panelWidth - 1
74+
75+ self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
76+
77+ @autopilot.logging.log_action(logger.debug)
78+ def click_dash_icon(self):
79+ if self.shown:
80+ dash_icon = self.select_single(
81+ 'QQuickImage', objectName='dashItem')
82+ self.pointing_device.click_object(dash_icon)
83+ else:
84+ raise emulators.UnityEmulatorException('The launcher is closed.')
85
86=== modified file 'tests/autopilot/unity8/shell/emulators/main_window.py'
87--- tests/autopilot/unity8/shell/emulators/main_window.py 2014-07-30 19:29:16 +0000
88+++ tests/autopilot/unity8/shell/emulators/main_window.py 2014-08-11 15:29:51 +0000
89@@ -63,9 +63,6 @@
90 def get_bottombar(self):
91 return self.select_single("Bottombar")
92
93- def get_launcher(self):
94- return self.select_single(Launcher)
95-
96 def get_pinPadLoader(self):
97 return self.select_single(
98 "QQuickLoader",
99@@ -122,6 +119,23 @@
100 return self._get_shell().focusedApplicationId
101
102 @autopilot_logging.log_action(logger.info)
103+ def show_dash_from_launcher(self):
104+ """Open the dash clicking the dash icon on the launcher."""
105+ launcher = self.open_launcher()
106+ launcher.click_dash_icon()
107+
108+ @autopilot_logging.log_action(logger.info)
109+ def open_launcher(self):
110+ launcher = self._get_launcher()
111+ launcher.show()
112+ return launcher
113+
114+ def _get_launcher(self):
115+ return self.select_single(Launcher)
116+
117+ def is_launcher_open(self):
118+ return self._get_launcher().shown
119+
120 def enter_pin_code(self, code):
121 """Enter code 'code' into the single-pin lightdm pincode entry screen.
122
123
124=== modified file 'tests/autopilot/unity8/shell/tests/disabled_test_hud.py'
125--- tests/autopilot/unity8/shell/tests/disabled_test_hud.py 2014-06-18 01:52:15 +0000
126+++ tests/autopilot/unity8/shell/tests/disabled_test_hud.py 2014-08-11 15:29:51 +0000
127@@ -184,12 +184,11 @@
128 unity_proxy = self.launch_unity()
129 unlock_unity(unity_proxy)
130 hud = self.main_window.get_hud()
131- launcher = self.main_window.get_launcher()
132
133 self._launch_test_app_from_app_screen()
134
135 hud.show()
136- launcher.show()
137+ self.main_window.open_launcher()
138
139 self.assertThat(hud.shown, Eventually(Equals(False)))
140
141
142=== modified file 'tests/autopilot/unity8/shell/tests/test_notifications.py'
143--- tests/autopilot/unity8/shell/tests/test_notifications.py 2014-07-30 19:29:16 +0000
144+++ tests/autopilot/unity8/shell/tests/test_notifications.py 2014-08-11 15:29:51 +0000
145@@ -242,8 +242,8 @@
146 # the shell)
147 time.sleep(1)
148 self.main_window.show_dash_swiping()
149- launcher = self.main_window.get_launcher()
150- self.assertThat(launcher.shown, Eventually(Equals(False)))
151+ self.assertThat(
152+ self.main_window.is_launcher_open, Eventually(Equals(False)))
153
154 # verify and interact with the triggered snap-decision notification
155 notify_list = self._get_notifications_list()

Subscribers

People subscribed via source and target branches