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