summaryrefslogtreecommitdiff
path: root/tests/autopilot
diff options
Diffstat (limited to 'tests/autopilot')
-rw-r--r--tests/autopilot/unity/tests/launcher/test_icon_behavior.py21
-rw-r--r--tests/autopilot/unity/tests/launcher/test_keynav.py36
2 files changed, 57 insertions, 0 deletions
diff --git a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py
index 798283d21..f24a73c71 100644
--- a/tests/autopilot/unity/tests/launcher/test_icon_behavior.py
+++ b/tests/autopilot/unity/tests/launcher/test_icon_behavior.py
@@ -150,6 +150,27 @@ class LauncherIconsTests(LauncherTestCase):
self.assertThat(calc_icon, NotEquals(None))
self.assertThat(calc_icon.visible, Eventually(Equals(True)))
+ def test_right_click_on_icon_ends_expo(self):
+ """Right click on a launcher icon in expo mode must end the expo
+ and show the quicklist.
+
+ """
+ self.keybinding("expo/start")
+ self.addCleanup(self.keybinding, "expo/cancel")
+
+ bfb = self.launcher.model.get_bfb_icon()
+ self.mouse.move(bfb.center_x, bfb.center_y)
+ self.mouse.click(button=3)
+
+ self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(True)))
+
+ monitor = self.screen_geo.get_primary_monitor()
+ self.panel = self.panels.get_panel_for_monitor(monitor)
+
+ # When workspace switcher is opened the panel title is "Ubuntu Desktop" so we check
+ # to make sure that workspace switcher end.
+ self.assertThat(self.panels.get_active_panel().title, Eventually(NotEquals("Ubuntu Desktop")))
+
class LauncherDragIconsBehavior(LauncherTestCase):
"""Tests dragging icons around the Launcher."""
diff --git a/tests/autopilot/unity/tests/launcher/test_keynav.py b/tests/autopilot/unity/tests/launcher/test_keynav.py
index cf4a79f4e..474463a30 100644
--- a/tests/autopilot/unity/tests/launcher/test_keynav.py
+++ b/tests/autopilot/unity/tests/launcher/test_keynav.py
@@ -198,3 +198,39 @@ class LauncherKeyNavTests(LauncherTestCase):
self.assertThat(self.hud.visible, Equals(False))
self.assertThat(self.launcher.key_nav_is_active, Equals(True))
+
+ def test_launcher_keynav_cancel_on_click_outside(self):
+ """A single click outside of launcher must cancel keynav."""
+ self.start_keynav_with_cleanup_cancel()
+
+ self.launcher_instance.move_mouse_to_right_of_launcher()
+ self.mouse.click()
+
+ self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(False)))
+
+ def test_launcher_keynav_cancel_on_click_icon(self):
+ """A single click on a launcher icon must cancel keynav."""
+ calc_win = self.start_app_window('Calculator', locale = 'C')
+ calc_app = calc_win.application
+ calc_icon = self.launcher.model.get_icon(desktop_id=calc_app.desktop_file)
+
+ self.start_keynav_with_cleanup_cancel()
+
+ self.launcher_instance.click_launcher_icon(calc_icon)
+
+ self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(False)))
+
+ def test_launcher_keynav_cancel_on_quicklist_activate(self):
+ """A single click on a quicklist item must cancel keynav."""
+ self.start_keynav_with_cleanup_cancel()
+ self.launcher_instance.key_nav_enter_quicklist()
+
+ bfb_icon = self.launcher.model.get_bfb_icon()
+ bfb_ql = bfb_icon.get_quicklist()
+
+ bfb_ql.click_item(bfb_ql.selected_item)
+ self.addCleanup(self.dash.ensure_hidden)
+
+ self.assertThat(self.dash.visible, Eventually(Equals(True)))
+ self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(False)))
+