@@ -307,9 +307,14 @@ class UnityTestCase(AutopilotTestCase):
307307
308308 # Ensure that the dash is visible before we return:
309309 logger.debug("Unity started, waiting for it to be ready.")
310− self.assertUnityReady()
310+ self.wait_for_unity()
311311 logger.debug("Unity loaded and ready.")
312312
313+ if model() == 'Desktop':
314+ # On desktop, close the dash because it's opened in a separate
315+ # window and it gets on the way.
316+ process_helpers.stop_job('unity8-dash')
317+
313318 return app_proxy
314319
315320 def _launch_unity_with_upstart(self, binary_path, args):
@@ -379,18 +384,10 @@ class UnityTestCase(AutopilotTestCase):
379384 def _clear_proxy(self):
380385 self._proxy = None
381386
382− def assertUnityReady(self):
383− dash = self.get_dash()
384− home_scope = dash.get_scope('clickscope')
385−
386− # FIXME! There is a huge timeout here for when we're doing CI on
387− # VMs. See lp:1203715
388− self.assertThat(
389− home_scope.isLoaded,
390− Eventually(Equals(True), timeout=60)
391− )
392− self.assertThat(home_scope.isCurrent, Eventually(Equals(True)))
393−
387+ def wait_for_unity(self):
388+ greeter_content_loader = self.main_window.wait_select_single(
389+ objectName='greeterContentLoader')
390+ greeter_content_loader.progress.wait_for(1)
394391
395392 def get_dash(self):
396393 pid = process_helpers.get_job_pid('unity8-dash')
@@ -439,6 +436,7 @@ class DashBaseTestCase(AutopilotTestCase):
439436
440437 self.dash_app = dash_helpers.DashApp(dash_proxy)
441438 self.dash = self.dash_app.dash
439+ self.wait_for_dash()
442440
443441 def launch_dash(self, binary_path, variables):
444442 launch_dash_app_fixture = fixture_setup.LaunchDashApp(
@@ -446,6 +444,16 @@ class DashBaseTestCase(AutopilotTestCase):
446444 self.useFixture(launch_dash_app_fixture)
447445 return launch_dash_app_fixture.application_proxy
448446
447+ def wait_for_dash(self):
448+ home_scope = self.dash.get_scope('clickscope')
449+ # FIXME! There is a huge timeout here for when we're doing CI on
450+ # VMs. See lp:1203715
451+ self.assertThat(
452+ home_scope.isLoaded,
453+ Eventually(Equals(True), timeout=60)
454+ )
455+ self.assertThat(home_scope.isCurrent, Eventually(Equals(True)))
456+
449457 def should_simulate_device(self):
450458 return (hasattr(self, 'app_width') and hasattr(self, 'app_height') and
451459 hasattr(self, 'grid_unit_px'))