@@ -142,6 +142,7 @@ class GenericScopeView(emulators.UnityEmulatorBase):
143 :parameter category: The name of the category where the application is.
143 :parameter category: The name of the category where the application is.
144 :app_name: The name of the application.
144 :app_name: The name of the application.
145+ :return: The opened preview.
147 category_element = self._get_category_element(category)
148 category_element = self._get_category_element(category)
@@ -150,8 +151,11 @@ class GenericScopeView(emulators.UnityEmulatorBase):
150 # Some categories do not show previews, like recent apps.
151 # Some categories do not show previews, like recent apps.
151 # --elopio - 2014-1-14
152 # --elopio - 2014-1-14
152 self.pointing_device.click_object(icon)
153 self.pointing_device.click_object(icon)
153− return self.get_root_instance().wait_select_single(
154+ preview_list = self.get_root_instance().wait_select_single(
154 'PreviewListView', objectName='dashContentPreviewList')
155 'PreviewListView', objectName='dashContentPreviewList')
156+ preview_list.x.wait_for(0)
157+ return preview_list.select_single(
158+ Preview, objectName='preview{}'.format(preview_list.currentIndex))
156 def _get_category_element(self, category):
160 def _get_category_element(self, category):
@@ -180,3 +184,7 @@ class DashApps(GenericScopeView):
180 if card.objectName != 'cardToolCard':
184 if card.objectName != 'cardToolCard':
181 result.append(card)
185 result.append(card)
182 return result
186 return result
189+class Preview(emulators.UnityEmulatorBase):
190+ """Autopilot custom proxy object for generic previews."""