Merge lp:~townsend/unity/fix-quicklist-ap-test-failure into lp:unity

Proposed by Christopher Townsend
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3503
Proposed branch: lp:~townsend/unity/fix-quicklist-ap-test-failure
Merge into: lp:unity
Diff against target: 32 lines (+8/-14)
1 file modified
tests/autopilot/unity/tests/test_quicklist.py (+8/-14)
To merge this branch: bzr merge lp:~townsend/unity/fix-quicklist-ap-test-failure
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+185304@code.launchpad.net

Commit message

Use the first two icons in the Launcher to assure the icons are always on the screen for this particular Autopilot test.

Description of the change

= Issue =
The unity.tests.test_quicklist.QuicklistActionTests.test_right_click_opens_quicklist_if_already_open AP test assumed that the two icons being used would be on the screen. This isn't always the case since the icons may be off the screen when there are many icons in the Launcher. When it was off the screen, the AP test would go into an infinite mouse move loop trying to get to the icon.

= Fix =
Just use the first two icons in the Launcher for the test as these will always be on the screen.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity/tests/test_quicklist.py'
2--- tests/autopilot/unity/tests/test_quicklist.py 2013-06-19 09:11:43 +0000
3+++ tests/autopilot/unity/tests/test_quicklist.py 2013-09-12 15:44:30 +0000
4@@ -191,20 +191,14 @@
5 lp:890991
6 """
7
8- calc_win = self.process_manager.start_app_window("Calculator")
9- mahj_win = self.process_manager.start_app_window("Mahjongg")
10-
11- calc_icon = self.unity.launcher.model.get_icon(
12- desktop_id=calc_win.application.desktop_file)
13- mahj_icon = self.unity.launcher.model.get_icon(
14- desktop_id=mahj_win.application.desktop_file)
15-
16- calc_ql = self.open_quicklist_for_icon(calc_icon)
17- self.assertThat(calc_ql.active, Eventually(Equals(True)))
18-
19- mahj_ql = self.open_quicklist_for_icon(mahj_icon)
20- self.assertThat(mahj_ql.active, Eventually(Equals(True)))
21- self.assertThat(calc_ql.active, Eventually(Equals(False)))
22+ icons = self.unity.launcher.model.get_launcher_icons()
23+
24+ icon0_ql = self.open_quicklist_for_icon(icons[0])
25+ self.assertThat(icon0_ql.active, Eventually(Equals(True)))
26+
27+ icon1_ql = self.open_quicklist_for_icon(icons[1])
28+ self.assertThat(icon1_ql.active, Eventually(Equals(True)))
29+ self.assertThat(icon0_ql.active, Eventually(Equals(False)))
30
31 def test_right_clicking_same_icon_doesnt_reopen_ql(self):
32 """A right click to the same icon in the launcher must