Merge lp:~elopio/unity8/test_open_dash into lp:unity8

Proposed by Leo Arias
Status: Superseded
Proposed branch: lp:~elopio/unity8/test_open_dash
Merge into: lp:unity8
Prerequisite: lp:~elopio/unity8/flake8
Diff against target: 154 lines (+64/-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 (+19/-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:~elopio/unity8/test_open_dash
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Albert Astals Cid (community) Needs Fixing
Review via email: mp+224553@code.launchpad.net

This proposal has been superseded by a proposal from 2014-07-21.

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 :
review: Needs Fixing (continuous-integration)
lp:~elopio/unity8/test_open_dash updated
990. By Leo Arias

Merged with prerequisite.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~elopio/unity8/test_open_dash updated
991. By Leo Arias

Merged with staging.

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)
lp:~elopio/unity8/test_open_dash updated
992. By Leo Arias

Removed the tests for some code paths and preconditions for the life cycle test.

993. By Leo Arias

Remove the swipe to the left.

994. By Leo Arias

Brough back the is_launcher_open.

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
Albert Astals Cid (aacid) wrote :

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

review: Needs Fixing
lp:~elopio/unity8/test_open_dash updated
995. By Leo Arias

Merged with trunk.

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)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py'
--- tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py 2014-06-11 15:36:51 +0000
+++ tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py 2014-07-10 14:20:25 +0000
@@ -115,3 +115,11 @@
115 self.launch_upstart_application(application_name)115 self.launch_upstart_application(application_name)
116 self.assertThat(greeter.created, Eventually(Equals(False)))116 self.assertThat(greeter.created, Eventually(Equals(False)))
117 self.assert_current_focused_application(application_name)117 self.assert_current_focused_application(application_name)
118
119 def test_click_dash_icon_must_unfocus_application(self):
120 application_name = self.launch_fake_app()
121 self.assert_current_focused_application(application_name)
122
123 self.main_window.show_dash_from_launcher()
124
125 self.assert_current_focused_application('')
118126
=== modified file 'tests/autopilot/unity8/shell/emulators/launcher.py'
--- tests/autopilot/unity8/shell/emulators/launcher.py 2013-11-01 13:59:50 +0000
+++ tests/autopilot/unity8/shell/emulators/launcher.py 2014-07-10 14:20:25 +0000
@@ -1,7 +1,7 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Unity Autopilot Test Suite3# Unity Autopilot Test Suite
4# Copyright (C) 2012-2013 Canonical4# Copyright (C) 2012, 2013, 2014 Canonical
5#5#
6# This program is free software: you can redistribute it and/or modify6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by7# it under the terms of the GNU General Public License as published by
@@ -17,22 +17,43 @@
17# along with this program. If not, see <http://www.gnu.org/licenses/>.17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#18#
1919
20from unity8.shell.emulators import UnityEmulatorBase20import logging
21from autopilot.input import Touch21
2222import autopilot.logging
2323
24class Launcher(UnityEmulatorBase):24from unity8.shell import emulators
25
26
27logger = logging.getLogger(__name__)
28
29
30class Launcher(emulators.UnityEmulatorBase):
2531
26 """An emulator that understands the Launcher."""32 """An emulator that understands the Launcher."""
2733
34 @autopilot.logging.log_action(logger.debug)
28 def show(self):35 def show(self):
29 """Swipes open the launcher."""36 """Show the launcher swiping it to the right."""
30 touch = Touch.create()37 if not self.shown:
38 self._swipe_to_show_launcher()
39 self.shown.wait_for(True)
40 else:
41 logger.debug('The launcher is already opened.')
3142
43 def _swipe_to_show_launcher(self):
32 view = self.get_root_instance().select_single('QQuickView')44 view = self.get_root_instance().select_single('QQuickView')
45 start_y = stop_y = view.y + view.height // 2
46
33 start_x = view.x + 147 start_x = view.x + 1
34 start_y = view.y + view.height / 248 stop_x = start_x + self.panelWidth - 1
35 stop_x = start_x + self.panelWidth + 149
36 stop_y = start_y50 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
37 touch.drag(start_x, start_y, stop_x, stop_y)51
38 self.shown.wait_for(True)52 @autopilot.logging.log_action(logger.debug)
53 def click_dash_icon(self):
54 if self.shown:
55 dash_icon = self.select_single(
56 'QQuickImage', objectName='dashItem')
57 self.pointing_device.click_object(dash_icon)
58 else:
59 raise emulators.UnityEmulatorException('The launcher is closed.')
3960
=== modified file 'tests/autopilot/unity8/shell/emulators/main_window.py'
--- tests/autopilot/unity8/shell/emulators/main_window.py 2014-07-09 13:16:20 +0000
+++ tests/autopilot/unity8/shell/emulators/main_window.py 2014-07-10 14:20:25 +0000
@@ -67,9 +67,6 @@
67 def get_bottombar(self):67 def get_bottombar(self):
68 return self.select_single("Bottombar")68 return self.select_single("Bottombar")
6969
70 def get_launcher(self):
71 return self.select_single(Launcher)
72
73 def get_pinPadLoader(self):70 def get_pinPadLoader(self):
74 return self.select_single(71 return self.select_single(
75 "QQuickLoader",72 "QQuickLoader",
@@ -134,3 +131,22 @@
134 @autopilot_logging.log_action(logger.info)131 @autopilot_logging.log_action(logger.info)
135 def search(self, query):132 def search(self, query):
136 self.get_dash().enter_search_query(query)133 self.get_dash().enter_search_query(query)
134
135 @autopilot_logging.log_action(logger.info)
136 def show_dash_from_launcher(self):
137 """Open the dash clicking the dash icon on the launcher."""
138 launcher = self.open_launcher()
139 launcher.click_dash_icon()
140 return self.get_dash()
141
142 @autopilot_logging.log_action(logger.info)
143 def open_launcher(self):
144 launcher = self._get_launcher()
145 launcher.show()
146 return launcher
147
148 def _get_launcher(self):
149 return self.select_single(Launcher)
150
151 def is_launcher_open(self):
152 return self._get_launcher().shown
137153
=== modified file 'tests/autopilot/unity8/shell/tests/disabled_test_hud.py'
--- tests/autopilot/unity8/shell/tests/disabled_test_hud.py 2014-06-18 01:52:15 +0000
+++ tests/autopilot/unity8/shell/tests/disabled_test_hud.py 2014-07-10 14:20:25 +0000
@@ -184,12 +184,11 @@
184 unity_proxy = self.launch_unity()184 unity_proxy = self.launch_unity()
185 unlock_unity(unity_proxy)185 unlock_unity(unity_proxy)
186 hud = self.main_window.get_hud()186 hud = self.main_window.get_hud()
187 launcher = self.main_window.get_launcher()
188187
189 self._launch_test_app_from_app_screen()188 self._launch_test_app_from_app_screen()
190189
191 hud.show()190 hud.show()
192 launcher.show()191 self.main_window.open_launcher()
193192
194 self.assertThat(hud.shown, Eventually(Equals(False)))193 self.assertThat(hud.shown, Eventually(Equals(False)))
195194
196195
=== modified file 'tests/autopilot/unity8/shell/tests/test_notifications.py'
--- tests/autopilot/unity8/shell/tests/test_notifications.py 2014-07-07 08:51:33 +0000
+++ tests/autopilot/unity8/shell/tests/test_notifications.py 2014-07-10 14:20:25 +0000
@@ -242,8 +242,8 @@
242 # the shell)242 # the shell)
243 time.sleep(1)243 time.sleep(1)
244 self.main_window.show_dash_swiping()244 self.main_window.show_dash_swiping()
245 launcher = self.main_window.get_launcher()245 self.assertThat(
246 self.assertThat(launcher.shown, Eventually(Equals(False)))246 self.main_window.is_launcher_open, Eventually(Equals(False)))
247247
248 # verify and interact with the triggered snap-decision notification248 # verify and interact with the triggered snap-decision notification
249 notify_list = self._get_notifications_list()249 notify_list = self._get_notifications_list()

Subscribers

People subscribed via source and target branches