Merge lp:~sil2100/unity/autopilot_misc_changes into lp:unity

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3327
Proposed branch: lp:~sil2100/unity/autopilot_misc_changes
Merge into: lp:unity
Diff against target: 30 lines (+5/-3)
1 file modified
tests/autopilot/unity/tests/test_hud.py (+5/-3)
To merge this branch: bzr merge lp:~sil2100/unity/autopilot_misc_changes
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Mathieu Trudel-Lapierre Approve
Review via email: mp+164452@code.launchpad.net

Commit message

Fix two HUD failures related to HUD slow action activation

Description of the change

- Problem:

Some of the HUD autopilot tests are failing because the HUD takes too long to activate entries. See LP: #1180903.

- Fix:

First of all, in the undo test, we need to wait a bit after activating the "Undo" HUD entry before saving. Since activation takes a while and the test checks the file contents, we need to make sure that the undo action takes place before Ctrl+s is pressed.
The other fix uses Eventually() to check if the application has quit, as it might take a bit for the action to take place.

- Tests:

N/A

To post a comment you must log in.
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Approve. Makes sense to me, will go well with the other timing changes I've proposed.

review: Approve
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

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) :
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_hud.py'
2--- tests/autopilot/unity/tests/test_hud.py 2013-05-02 00:22:30 +0000
3+++ tests/autopilot/unity/tests/test_hud.py 2013-05-17 16:37:36 +0000
4@@ -212,14 +212,15 @@
5
6 self.keyboard.type("undo")
7 hud_query_check = lambda: self.unity.hud.selected_hud_button.label_no_formatting
8- # XXX: with the new HUD, command and description is separated by '\u2002' and
9- # not a regular space ' '. Is that correct? (LP: #1172237)
10 self.assertThat(hud_query_check,
11 Eventually(Equals(u'Undo\u2002(Edit)')))
12 self.keyboard.press_and_release('Return')
13 self.assertThat(self.unity.hud.visible, Eventually(Equals(False)))
14
15 self.assertProperty(gedit_win, is_focused=True)
16+ # XXX: Because of LP: #1180903, we need to give HUD some time after activating
17+ # any entry, because it takes some time
18+ sleep(1.5)
19 self.keyboard.press_and_release("Ctrl+s")
20 self.assertThat(lambda: exists(file_path), Eventually(Equals(True)))
21
22@@ -330,7 +331,8 @@
23
24 self.keyboard.press_and_release("Enter")
25
26- self.assertFalse(self.process_manager.app_is_running("Text Editor"))
27+ is_running = lambda: self.process_manager.app_is_running("Text Editor")
28+ self.assertThat(is_running, Eventually(Equals(False)))
29
30 self.assertThat(self.unity.hud.visible, Eventually(Equals(False)))
31