@@ -84,10 +84,7 @@ class Dash(emulators.UnityEmulatorBase):
84 'No scope found with id {0}'.format(scope_id))
84 'No scope found with id {0}'.format(scope_id))
86 def _get_scope_from_loader(self, loader):
86 def _get_scope_from_loader(self, loader):
87− if loader.scopeId == 'applications.scope':
88− return loader.select_single(DashApps)
90− return loader.select_single(GenericScopeView)
87+ return loader.select_single(GenericScopeView)
92 def _open_scope_scrolling(self, scope_loader):
89 def _open_scope_scrolling(self, scope_loader):
93 scroll = self._get_scroll_direction(scope_loader)
90 scroll = self._get_scroll_direction(scope_loader)
@@ -170,7 +167,7 @@ class GenericScopeView(emulators.UnityEmulatorBase):
170 # --elopio - 2014-1-14
167 # --elopio - 2014-1-14
171 self.pointing_device.click_object(icon)
168 self.pointing_device.click_object(icon)
172 preview = self.get_root_instance().wait_select_single(
169 preview = self.get_root_instance().wait_select_single(
173− self.preview_class, isCurrent=True)
170+ objectName="dashPreview", isCurrent=True)
174 preview.showProcessingAction.wait_for(False)
171 preview.showProcessingAction.wait_for(False)
175 return preview
172 return preview
@@ -182,6 +179,18 @@ class GenericScopeView(emulators.UnityEmulatorBase):
182 raise emulators.UnityEmulatorException(
179 raise emulators.UnityEmulatorException(
183 'No category found with name {}'.format(category))
180 'No category found with name {}'.format(category))
182+ def get_applications(self, category):
183+ """Return the list of applications on a category.
185+ :parameter category: The name of the category.
188+ category_element = self._get_category_element(category)
189+ application_tiles = category_element.select_many('Tile')
190+ # TODO return them on the same order they are displayed.
191+ # --elopio - 2014-1-15
192+ return [tile.text for tile in application_tiles]
186class AppPreview(DashPreview):
195class AppPreview(DashPreview):
187 """Autopilot emulator for the application preview."""
196 """Autopilot emulator for the application preview."""
@@ -195,20 +204,3 @@ class AppPreview(DashPreview):
195 title=details.get('title'), publisher=details.get('subtitle'),
204 title=details.get('title'), publisher=details.get('subtitle'),
196 description=details.get('description'))
205 description=details.get('description'))
199−class DashApps(GenericScopeView):
200− """Autopilot emulator for the applications scope."""
202− preview_class = AppPreview
204− def get_applications(self, category):
205− """Return the list of applications on a category.
207− :parameter category: The name of the category.
210− category_element = self._get_category_element(category)
211− application_tiles = category_element.select_many('Tile')
212− # TODO return them on the same order they are displayed.
213− # --elopio - 2014-1-15
214− return [tile.text for tile in application_tiles]