on xenial help sign in
Should finally fix autopilot tests...
commit37532e610c22750572e5e0becbeddbf8daf5ca98 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateTue 1 Oct 2013, 15:37 (13 years ago) parenta8a0901
2 files changed+18−7
tests/autopilot/unity8/shell/emulators/dash.py+15−6 tests/autopilot/unity8/shell/tests/test_hud.py+3−1
tests/autopilot/unity8/shell/emulators/dash.py+15−6
@@ -18,17 +18,22 @@
1818#
1919
2020from unity8.shell.emulators import UnityEmulatorBase
21−
21+from time import sleep
2222
2323class Dash(UnityEmulatorBase):
2424
2525 """An emulator that understands the Dash."""
2626
2727 def get_home_applications_grid(self):
28− return self.get_scope('home').select_single(
29− "GenericFilterGrid",
30− objectName="applications.scope"
31− )
28+ for i in range(1,10):
29+ get_grid = self.get_scope('home').select_single(
30+ "GenericFilterGrid",
31+ objectName="applications.scope"
32+ )
33+ if get_grid != None:
34+ break
35+ sleep(1)
36+ return get_grid
3237
3338 def get_application_icon(self, text):
3439 """Returns a 'Tile' icon that has the text 'text' from the application
@@ -40,7 +45,11 @@ class Dash(UnityEmulatorBase):
4045
4146 """
4247 app_grid = self.get_home_applications_grid()
43− resp_grid = app_grid.select_single('ResponsiveGridView')
48+ for i in range(1,10):
49+ resp_grid = app_grid.select_single('ResponsiveGridView')
50+ if resp_grid != None:
51+ break
52+ sleep(1)
4453 return resp_grid.select_single('Tile', text=text)
4554
4655 def get_scope(self, scope_name='home'):
tests/autopilot/unity8/shell/tests/test_hud.py+3−1
@@ -123,6 +123,7 @@ class TestHud(UnityTestCase):
123123 hud = self.main_window.get_hud()
124124
125125 self._launch_test_app_from_app_screen()
126+
126127 hud.show()
127128
128129 x, y = hud.get_close_button_coords()
@@ -136,10 +137,11 @@ class TestHud(UnityTestCase):
136137 """
137138 self.launch_unity()
138139 self.main_window.get_greeter().swipe()
139− hud = self.main_window.get_hud()
140140 window = self.main_window.get_qml_view()
141+ hud = self.main_window.get_hud()
141142
142143 self._launch_test_app_from_app_screen()
144+
143145 hud.show()
144146
145147 start_x, start_y = hud.get_close_button_coords()