on xenial help sign in
Remove the usage of address book and the rest of messaging app.
commit0f38e63ec1165fb171e0ba8fddccb543a16f8aa7 authorLeo Arias <leo.arias@canonical.com> dateMon 7 Apr 2014, 15:00 (13 years ago) parent4916d87
1 file changed+11−44
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+11−44
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+11−44
@@ -24,9 +24,7 @@ from __future__ import absolute_import
2424import logging
2525import os
2626
27−from autopilot.matchers import Eventually
2827from autopilot.platform import model
29−from testtools.matchers import Equals
3028from ubuntuuitoolkit import (
3129 base,
3230 emulators as toolkit_emulators,
@@ -61,24 +59,6 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
6159 logger.info("Swiping screen from the right edge")
6260 self.touch.drag(start_x, start_y, end_x, end_y)
6361
64− def _launch_app(self, app_name):
65− """Launches the application *app_name*
66−
67− Assumes that the desktop file resides at:
68− /usr/share/applications/{app_name}.desktop
69−
70− """
71− desktop_file = "--desktop_file_hint="\
72− "/usr/share/applications/{app_name}.desktop".format(
73− app_name=app_name
74− )
75− return self.launch_test_application(
76− app_name,
77− desktop_file,
78− "--stage_hint=main_stage",
79− app_type='qt'
80− )
81−
8262 def launch_fake_app(self):
8363 qml_file_path, desktop_file_path = self.create_test_application()
8464 desktop_file_name = os.path.basename(desktop_file_path)
@@ -107,17 +87,12 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
10787 unity_proxy = self.launch_unity()
10888 unlock_unity(unity_proxy)
10989
110− self._launch_app("messaging-app")
111− self.assertThat(
112− self.main_window.get_current_focused_app_id(),
113− Eventually(Equals("messaging-app"))
114− )
90+ application1_name = self.launch_fake_app()
91+ self.assert_current_focused_application(application1_name)
11592
116− self._launch_app("address-book-app")
117− self.assertThat(
118− self.main_window.get_current_focused_app_id(),
119− Eventually(Equals("address-book-app"))
120− )
93+ application2_name = self.launch_fake_app()
94+ self.assertFalse(application1_name == application2_name)
95+ self.assert_current_focused_application(application2_name)
12196
12297 @disable_qml_mocking
12398 def test_app_moves_from_unfocused_to_focused(self):
@@ -128,21 +103,13 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
128103 unity_proxy = self.launch_unity()
129104 unlock_unity(unity_proxy)
130105
131− self._launch_app("messaging-app")
132− self.assertThat(
133− self.main_window.get_current_focused_app_id(),
134− Eventually(Equals("messaging-app"))
135− )
106+ application1_name = self.launch_fake_app()
107+ self.assert_current_focused_application(application1_name)
136108
137− self._launch_app("address-book-app")
138− self.assertThat(
139− self.main_window.get_current_focused_app_id(),
140− Eventually(Equals("address-book-app"))
141− )
109+ application2_name = self.launch_fake_app()
110+ self.assertFalse(application1_name == application2_name)
111+ self.assert_current_focused_application(application2_name)
142112
143113 self.swipe_screen_from_right()
144114
145− self.assertThat(
146− self.main_window.get_current_focused_app_id(),
147− Eventually(Equals("messaging-app"))
148− )
115+ self.assert_current_focused_application(application1_name)