on xenial help sign in
Remove the usage of address book and the rest of messaging app.
0f38e63Leo Arias
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+11−44
@@ -24,9 +24,7 @@ from __future__ import absolute_import
24import logging
24import logging
25import os
25import os
26
26
27−from autopilot.matchers import Eventually
28from autopilot.platform import model
27from autopilot.platform import model
29−from testtools.matchers import Equals
30from ubuntuuitoolkit import (
28from ubuntuuitoolkit import (
31 base,
29 base,
32 emulators as toolkit_emulators,
30 emulators as toolkit_emulators,
@@ -61,24 +59,6 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
61 logger.info("Swiping screen from the right edge")
59 logger.info("Swiping screen from the right edge")
62 self.touch.drag(start_x, start_y, end_x, end_y)
60 self.touch.drag(start_x, start_y, end_x, end_y)
63
61
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−
82 def launch_fake_app(self):
62 def launch_fake_app(self):
83 qml_file_path, desktop_file_path = self.create_test_application()
63 qml_file_path, desktop_file_path = self.create_test_application()
84 desktop_file_name = os.path.basename(desktop_file_path)
64 desktop_file_name = os.path.basename(desktop_file_path)
@@ -107,17 +87,12 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
107 unity_proxy = self.launch_unity()
87 unity_proxy = self.launch_unity()
108 unlock_unity(unity_proxy)
88 unlock_unity(unity_proxy)
109
89
110− self._launch_app("messaging-app")
90+ application1_name = self.launch_fake_app()
111− self.assertThat(
91+ self.assert_current_focused_application(application1_name)
112− self.main_window.get_current_focused_app_id(),
113− Eventually(Equals("messaging-app"))
114− )
115
92
116− self._launch_app("address-book-app")
93+ application2_name = self.launch_fake_app()
117− self.assertThat(
94+ self.assertFalse(application1_name == application2_name)
118− self.main_window.get_current_focused_app_id(),
95+ self.assert_current_focused_application(application2_name)
119− Eventually(Equals("address-book-app"))
120− )
121
96
122 @disable_qml_mocking
97 @disable_qml_mocking
123 def test_app_moves_from_unfocused_to_focused(self):
98 def test_app_moves_from_unfocused_to_focused(self):
@@ -128,21 +103,13 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
128 unity_proxy = self.launch_unity()
103 unity_proxy = self.launch_unity()
129 unlock_unity(unity_proxy)
104 unlock_unity(unity_proxy)
130
105
131− self._launch_app("messaging-app")
106+ application1_name = self.launch_fake_app()
132− self.assertThat(
107+ self.assert_current_focused_application(application1_name)
133− self.main_window.get_current_focused_app_id(),
134− Eventually(Equals("messaging-app"))
135− )
136
108
137− self._launch_app("address-book-app")
109+ application2_name = self.launch_fake_app()
138− self.assertThat(
110+ self.assertFalse(application1_name == application2_name)
139− self.main_window.get_current_focused_app_id(),
111+ self.assert_current_focused_application(application2_name)
140− Eventually(Equals("address-book-app"))
141− )
142
112
143 self.swipe_screen_from_right()
113 self.swipe_screen_from_right()
144
114
145− self.assertThat(
115+ self.assert_current_focused_application(application1_name)
146− self.main_window.get_current_focused_app_id(),
147− Eventually(Equals("messaging-app"))
148− )