on xenial help sign in
First changes to check for dash/home scope loaded.
commita465ea87954a64192998cd5a535c7536ba7705b4 authorChristopher Lee <chris.lee@canonical.com> dateTue 23 Jul 2013, 13:51 (13 years ago) parent8fe2b7b
2 files changed+28−8
Dash/DashContent.qml+3 tests/autopilot/unity8/shell/tests/__init__.py+25−8
Dash/DashContent.qml+3
@@ -114,6 +114,9 @@ Item {
114114 height: ListView.view.height
115115 asynchronous: true
116116 source: scopeMapper.map(scope.id)
117+ readonly property string scopeId: scope.id
118+ readonly property bool isCurrent: ListView.isCurrentItem
119+ readonly property bool isLoaded: status == Loader.Ready
117120
118121 onLoaded: {
119122 item.scope = Qt.binding(function() { return scope })
tests/autopilot/unity8/shell/tests/__init__.py+25−8
@@ -144,14 +144,10 @@ class Unity8TestCase(AutopilotTestCase):
144144 self._set_proxy(app_proxy)
145145
146146 # Ensure that the dash is visible before we return:
147− logger.debug("Unity8 started, waiting for Dash.")
148− # FIXME! There is a huge timeout here for when we're doing CI on
149− # VMs. See lp:1203715
150− self.assertThat(
151− self.get_dash().showScopeOnLoaded,
152− Eventually(Equals(""), timeout=40)
153− )
154− logger.debug("Unity8 Dash loaded and ready.")
147+ logger.debug("Unity8 started, waiting for it to be ready.")
148+ self.assertUnityReady()
149+ logger.debug("Unity8 loaded and ready.")
150+
155151 return app_proxy
156152
157153 def _setup_extra_mock_environment_patch(self):
@@ -169,11 +165,32 @@ class Unity8TestCase(AutopilotTestCase):
169165 def _clear_proxy(self):
170166 self._proxy = None
171167
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
174+ self.assertThat(
175+ home_scope.isLoaded,
176+ Eventually(Equals(True), timeout=40)
177+ )
178+ self.assertThat(home_scope.isCurrent, Eventually(Equals(True)))
179+
172180 def get_dash(self):
173181 dash = self._proxy.select_single(Dash)
174182 self.assertThat(dash, NotEquals(None))
175183 return dash
176184
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+
177194 @property
178195 def main_window(self):
179196 return MainWindow(self._proxy)