on xenial help sign in
Added a test for clicking the app icon on the launcher.
commita2c5ac93e61c90a6f05dea0b9bfe9ca792cfd7e5 authorLeo Arias <leo.arias@canonical.com> dateMon 30 Jun 2014, 22:53 (12 years ago) parent6699f45
3 files changed+22
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+7 tests/autopilot/unity8/shell/emulators/launcher.py+4 tests/autopilot/unity8/shell/emulators/main_window.py+11
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+7
@@ -123,3 +123,10 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
123123 self.main_window.show_dash_from_launcher()
124124
125125 self.assert_current_focused_application('')
126+
127+ def test_click_app_icon_on_dash_must_focus_it(self):
128+ application_name = self.launch_fake_app()
129+ self.main_window.show_dash_from_launcher()
130+
131+ self.main_window.launch_application(application_name)
132+ self.assert_current_focused_application(application_name)
tests/autopilot/unity8/shell/emulators/launcher.py+4
@@ -73,3 +73,7 @@ class Launcher(emulators.UnityEmulatorBase):
7373 self.pointing_device.click_object(dash_icon)
7474 else:
7575 raise emulators.UnityEmulatorException('The launcher is closed.')
76+
77+ @autopilot.logging.log_action(logger.debug)
78+ def click_application_launcher_icon(self, application_name):
79+ import pdb; pdb.set_trace()
tests/autopilot/unity8/shell/emulators/main_window.py+11
@@ -160,3 +160,14 @@ class QQuickView(emulators.UnityEmulatorBase):
160160
161161 def is_launcher_open(self):
162162 return self._get_launcher().shown
163+
164+ @autopilot_logging.log_action(logger.info)
165+ def launch_application(self, application_name):
166+ """Launch an application.
167+
168+ :parameter application_name: The name of the application to launch.
169+
170+ """
171+ launcher = self.open_launcher()
172+ launcher.click_application_launcher_icon(application_name)
173+ self.get_current_focused_app_id().wait_for(application_name)