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

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: no longer in the source branch.
Merged at revision: 3011
Proposed branch: lp:~sil2100/unity/autopilot_fix_hud_locale_and_such
Merge into: lp:unity
Diff against target: 56 lines (+6/-28)
1 file modified
tests/autopilot/unity/tests/test_hud.py (+6/-28)
To merge this branch: bzr merge lp:~sil2100/unity/autopilot_fix_hud_locale_and_such
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Timo Jyrinki Approve
Thomi Richards (community) Approve
Review via email: mp+133547@code.launchpad.net

Commit message

Removed the test_hud_closes_on_item_activated test as the same behavior is tested already by test_app_activate_on_enter - redundant.
Made test_app_activate_on_enter work better on non-EN-locale systems by explicitly opening a C locale application for performing the tests.

Description of the change

- Problem:

More failing tests due to locale-dependency. Also, one of the tests is badly written and redundant.

- Fix:

Remove the badly written and redundant test, the other one we fix up by forcing to use a gedit instance for testing which we explicitly tell which locale to use - this way we achieve testability on non-EN machines.

- Tests:

N/A

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

The error by jenkins bot looks like a temporary jenkins failure.

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)

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 2012-12-19 20:43:46 +0000
3+++ tests/autopilot/unity/tests/test_hud.py 2013-01-04 11:37:27 +0000
4@@ -299,16 +299,17 @@
5
6 def test_app_activate_on_enter(self):
7 """Hud must close after activating a search item with Enter."""
8+ self.start_app('Text Editor', locale='C')
9+ self.addCleanup(self.close_all_app, "Text Editor")
10+
11 self.hud.ensure_visible()
12
13- self.keyboard.type("Device > System Settings")
14- self.assertThat(self.hud.search_string, Eventually(Equals("Device > System Settings")))
15+ self.keyboard.type("File > Quit")
16+ self.assertThat(self.hud.search_string, Eventually(Equals("File > Quit")))
17
18 self.keyboard.press_and_release("Enter")
19
20- app_found = self.bamf.wait_until_application_is_running("gnome-control-center.desktop", 5)
21- self.assertTrue(app_found)
22- self.addCleanup(self.close_all_app, "System Settings")
23+ self.assertFalse(self.app_is_running("Text Editor"))
24
25 self.assertThat(self.hud.visible, Eventually(Equals(False)))
26
27@@ -356,29 +357,6 @@
28
29 self.assertThat(file_contents, Equals('ABCD'))
30
31- def test_hud_closes_on_item_activated(self):
32- """Activating a HUD item with the 'Enter' key MUST close the HUD."""
33- # starting on a clean desktop because this way we are sure that our search
34- # string won't match any menu item from a focused application
35- self.start_placeholder_app()
36- self.window_manager.enter_show_desktop()
37- self.addCleanup(self.window_manager.leave_show_desktop)
38-
39- self.hud.ensure_visible()
40-
41- self.keyboard.type("settings")
42- self.assertThat(self.hud.search_string, Eventually(Equals("settings")))
43-
44- self.keyboard.press_and_release('Down')
45- self.assertThat(self.hud.selected_button, Eventually(Equals(2)))
46- self.keyboard.press_and_release('Down')
47- self.assertThat(self.hud.selected_button, Eventually(Equals(3)))
48- self.keyboard.press_and_release('Enter')
49-
50- self.addCleanup(self.close_all_app, "System Settings")
51-
52- self.assertThat(self.hud.visible, Eventually(Equals(False)))
53-
54 def test_mouse_changes_selected_hud_button(self):
55 """This tests moves the mouse from the top of the screen to the bottom, this must
56 change the selected button from 1 to 5.