summaryrefslogtreecommitdiff
path: root/tests/autopilot
diff options
authorThomi Richards <thomi.richards@canonical.com>2012-07-09 14:17:30 +1200
committerThomi Richards <thomi.richards@canonical.com>2012-07-09 14:17:30 +1200
commite66f8153e8f86b123a86a5164bbac689908b6f9a (patch)
tree08d905f682d5453e103569105beb38d7a81f8657 /tests/autopilot
parente7671d4fd57515d417d8c0573f55acaef3e002f1 (diff)
Fixed another quicklist test to use start_application_window method.
(bzr r2470.7.8)
Diffstat (limited to 'tests/autopilot')
-rw-r--r--tests/autopilot/unity/tests/test_quicklist.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/tests/autopilot/unity/tests/test_quicklist.py b/tests/autopilot/unity/tests/test_quicklist.py
index 7d46e5ae6..8a70510b0 100644
--- a/tests/autopilot/unity/tests/test_quicklist.py
+++ b/tests/autopilot/unity/tests/test_quicklist.py
@@ -102,26 +102,17 @@ class QuicklistActionTests(UnityTestCase):
"""This tests shows that when you activate a quicklist application item
when an application window is focused, the spread is initiated.
"""
- calc = self.start_app("Calculator")
- [calc_win1] = calc.get_windows()
- self.assertTrue(calc_win1.is_focused)
-
- self.start_app("Calculator")
- # Sleeping due to the start_app only waiting for the bamf model to be
- # updated with the application. Since the app has already started,
- # and we are just waiting on a second window, however a defined sleep
- # here is likely to be problematic.
- # TODO: fix bamf emulator to enable waiting for new windows.
- sleep(1)
- [calc_win2] = [w for w in calc.get_windows() if w.x_id != calc_win1.x_id]
+ calc_win1 = self.start_app_window("Calculator")
+ calc_win2 = self.start_app_window("Calculator")
+ calc_app = calc_win1.application
self.assertVisibleWindowStack([calc_win2, calc_win1])
- self.assertTrue(calc_win2.is_focused)
+ self.assert_window_focused(calc_win2)
- calc_icon = self.launcher.model.get_icon_by_desktop_id(calc.desktop_file)
+ calc_icon = self.launcher.model.get_icon_by_desktop_id(calc_app.desktop_file)
calc_ql = self.open_quicklist_for_icon(calc_icon)
- app_item = calc_ql.get_quicklist_application_item(calc.name)
+ app_item = calc_ql.get_quicklist_application_item(calc_app.name)
self.addCleanup(self.keybinding, "spread/cancel")
app_item.mouse_click()