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

Proposed by Leo Arias
Status: Superseded
Proposed branch: lp:~elopio/unity8/test_open_app_from_launcher
Merge into: lp:unity8
Prerequisite: lp:~elopio/unity8/test_open_dash
Diff against target: 62 lines (+28/-0)
4 files modified
qml/Launcher/LauncherPanel.qml (+4/-0)
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py (+7/-0)
tests/autopilot/unity8/shell/emulators/launcher.py (+6/-0)
tests/autopilot/unity8/shell/emulators/main_window.py (+11/-0)
To merge this branch: bzr merge lp:~elopio/unity8/test_open_app_from_launcher
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Albert Astals Cid (community) Needs Fixing
Review via email: mp+225112@code.launchpad.net

This proposal supersedes a proposal from 2014-07-01.

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

Commit message

Added an autopilot test for focusing an app clicking the icon on the launcher.

Description of the change

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

Yes, the prerequisite has the helpers to open the dash.

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

Sort of. I ran the tests. I inspected the tree a lot with autopilot vis. I checked the jenkins results.

 * 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, but I added a new property to the LauncherDelegate to make the appId accessible by autopilot.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
993. By Leo Arias

Merged with prerequisite.

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)
994. By Leo Arias

Moved the property to the delegate as suggested by michael.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (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
995. By Leo Arias

Merged with prerequisite.

996. By Leo Arias

Merged with prerequisite.

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
1=== modified file 'qml/Launcher/LauncherPanel.qml'
2--- qml/Launcher/LauncherPanel.qml 2014-07-09 19:45:46 +0000
3+++ qml/Launcher/LauncherPanel.qml 2014-07-10 14:23:27 +0000
4@@ -146,6 +146,10 @@
5 delegate: FoldingLauncherDelegate {
6 id: launcherDelegate
7 objectName: "launcherDelegate" + index
8+ // We need the appId in the delegate in order to find
9+ // the right app when running autopilot tests for
10+ // multiple apps.
11+ property string appId: model.appId
12 itemHeight: launcherListView.itemHeight
13 itemWidth: launcherListView.itemWidth
14 width: itemWidth
15
16=== modified file 'tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py'
17--- tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py 2014-07-10 14:23:27 +0000
18+++ tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py 2014-07-10 14:23:27 +0000
19@@ -123,3 +123,10 @@
20 self.main_window.show_dash_from_launcher()
21
22 self.assert_current_focused_application('')
23+
24+ def test_click_app_icon_on_dash_must_focus_it(self):
25+ application_name = self.launch_fake_app()
26+ self.main_window.show_dash_from_launcher()
27+
28+ self.main_window.launch_application(application_name)
29+ self.assert_current_focused_application(application_name)
30
31=== modified file 'tests/autopilot/unity8/shell/emulators/launcher.py'
32--- tests/autopilot/unity8/shell/emulators/launcher.py 2014-07-10 14:23:27 +0000
33+++ tests/autopilot/unity8/shell/emulators/launcher.py 2014-07-10 14:23:27 +0000
34@@ -57,3 +57,9 @@
35 self.pointing_device.click_object(dash_icon)
36 else:
37 raise emulators.UnityEmulatorException('The launcher is closed.')
38+
39+ @autopilot.logging.log_action(logger.debug)
40+ def click_application_launcher_icon(self, application_name):
41+ launcher_delegate = self.select_single(
42+ 'LauncherDelegate', appId=application_name)
43+ self.pointing_device.click_object(launcher_delegate)
44
45=== modified file 'tests/autopilot/unity8/shell/emulators/main_window.py'
46--- tests/autopilot/unity8/shell/emulators/main_window.py 2014-07-10 14:23:27 +0000
47+++ tests/autopilot/unity8/shell/emulators/main_window.py 2014-07-10 14:23:27 +0000
48@@ -150,3 +150,14 @@
49
50 def is_launcher_open(self):
51 return self._get_launcher().shown
52+
53+ @autopilot_logging.log_action(logger.info)
54+ def launch_application(self, application_name):
55+ """Launch an application.
56+
57+ :parameter application_name: The name of the application to launch.
58+
59+ """
60+ launcher = self.open_launcher()
61+ launcher.click_application_launcher_icon(application_name)
62+ self.get_current_focused_app_id().wait_for(application_name)

Subscribers

People subscribed via source and target branches