@@ -144,14 +144,10 @@ class Unity8TestCase(AutopilotTestCase):
144 self._set_proxy(app_proxy)
144 self._set_proxy(app_proxy)
146 # Ensure that the dash is visible before we return:
146 # Ensure that the dash is visible before we return:
147− logger.debug("Unity8 started, waiting for Dash.")
147+ logger.debug("Unity8 started, waiting for it to be ready.")
148− # FIXME! There is a huge timeout here for when we're doing CI on
148+ self.assertUnityReady()
149− # VMs. See lp:1203715
151− self.get_dash().showScopeOnLoaded,
152− Eventually(Equals(""), timeout=40)
154− logger.debug("Unity8 Dash loaded and ready.")
149+ logger.debug("Unity8 loaded and ready.")
155 return app_proxy
151 return app_proxy
157 def _setup_extra_mock_environment_patch(self):
153 def _setup_extra_mock_environment_patch(self):
@@ -169,11 +165,32 @@ class Unity8TestCase(AutopilotTestCase):
169 def _clear_proxy(self):
165 def _clear_proxy(self):
170 self._proxy = None
166 self._proxy = None
168+ def assertUnityReady(self):
169+ # FIXME! There is a huge timeout here for when we're doing CI on
170+ # 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
175+ home_scope.isLoaded,
176+ Eventually(Equals(True), timeout=40)
178+ self.assertThat(home_scope.isCurrent, Eventually(Equals(True)))
172 def get_dash(self):
180 def get_dash(self):
173 dash = self._proxy.select_single(Dash)
181 dash = self._proxy.select_single(Dash)
174 self.assertThat(dash, NotEquals(None))
182 self.assertThat(dash, NotEquals(None))
175 return dash
183 return dash
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(
190+ objectName='dashContentList'
192+ return dash_content.select_single('QQuickLoader', scopeId='home.scope')
177 @property
194 @property
178 def main_window(self):
195 def main_window(self):
179 return MainWindow(self._proxy)
196 return MainWindow(self._proxy)