on xenial help sign in
Cleanup of new dash home scope checking
7b31b2bChristopher Lee
tests/autopilot/unity8/shell/emulators/dash.py+8
@@ -42,3 +42,11 @@ class Dash(Unity8EmulatorBase):
42 app_grid = self.get_home_applications_grid()
42 app_grid = self.get_home_applications_grid()
43 resp_grid = app_grid.select_single('ResponsiveGridView')
43 resp_grid = app_grid.select_single('ResponsiveGridView')
44 return resp_grid.select_single('Tile', text=text)
44 return resp_grid.select_single('Tile', text=text)
45+
46+ def get_scope(self, scope_name='home'):
47+ dash_content = self.select_single(
48+ 'QQuickListView',
49+ objectName='dashContentList'
50+ )
51+ scope_id = "%s.scope" % scope_name
52+ return dash_content.select_single('QQuickLoader', scopeId=scope_id)
tests/autopilot/unity8/shell/tests/__init__.py+3−12
@@ -166,11 +166,11 @@ class Unity8TestCase(AutopilotTestCase):
166 self._proxy = None
166 self._proxy = None
167
167
168 def assertUnityReady(self):
168 def assertUnityReady(self):
169+ dash = self.get_dash()
170+ home_scope = dash.get_scope('home')
171+
169 # FIXME! There is a huge timeout here for when we're doing CI on
172 # FIXME! There is a huge timeout here for when we're doing CI on
170 # VMs. See lp:1203715
173 # VMs. See lp:1203715
171− home_scope = self.get_dash_home_scope()
172− # home_scope_is_loaded = lambda: home_scope.isCurrent
173− # home_scope_is_current = lambda: get_home_scope().isLoaded
174 self.assertThat(
174 self.assertThat(
175 home_scope.isLoaded,
175 home_scope.isLoaded,
176 Eventually(Equals(True), timeout=40)
176 Eventually(Equals(True), timeout=40)
@@ -182,15 +182,6 @@ class Unity8TestCase(AutopilotTestCase):
182 self.assertThat(dash, NotEquals(None))
182 self.assertThat(dash, NotEquals(None))
183 return dash
183 return dash
184
184
185− # change this to get_scope(name='home') and add the .scope to it
186− def get_dash_home_scope(self):
187− dash = self.get_dash()
188− dash_content = dash.select_single(
189− 'QQuickListView',
190− objectName='dashContentList'
191− )
192− return dash_content.select_single('QQuickLoader', scopeId='home.scope')
193−
194 @property
185 @property
195 def main_window(self):
186 def main_window(self):
196 return MainWindow(self._proxy)
187 return MainWindow(self._proxy)