@@ -192,7 +192,7 @@ class GenericScopeView(emulators.UnityEmulatorBase):
192 """Autopilot emulator for generic scopes."""
192 """Autopilot emulator for generic scopes."""
194 @autopilot_logging.log_action(logger.info)
194 @autopilot_logging.log_action(logger.info)
195− def open_preview(self, category, app_name):
195+ def open_preview(self, category, app_name, press_duration=0.10):
196 """Open the preview of an application.
196 """Open the preview of an application.
198 :parameter category: The name of the category where the application is.
198 :parameter category: The name of the category where the application is.
@@ -203,16 +203,18 @@ class GenericScopeView(emulators.UnityEmulatorBase):
203 # FIXME some categories need a long press in order to see the preview.
203 # FIXME some categories need a long press in order to see the preview.
204 # Some categories do not show previews, like recent apps.
204 # Some categories do not show previews, like recent apps.
205 # --elopio - 2014-1-14
205 # --elopio - 2014-1-14
206− self.click_scope_item(category, app_name)
206+ self.click_scope_item(category, app_name, press_duration)
207 preview_list = self.wait_select_single(
207 preview_list = self.wait_select_single(
208 'QQuickLoader', objectName='subPageLoader')
208 'QQuickLoader', objectName='subPageLoader')
209 preview_list.subPageShown.wait_for(True)
209 preview_list.subPageShown.wait_for(True)
210 preview_list.x.wait_for(0)
210 preview_list.x.wait_for(0)
211+ self.get_root_instance().select_single(
212+ objectName='processingIndicator').visible.wait_for(False)
211 return preview_list.select_single(
213 return preview_list.select_single(
212 Preview, objectName='preview{}'.format(preview_list.currentIndex))
214 Preview, objectName='preview{}'.format(preview_list.currentIndex))
214 @autopilot_logging.log_action(logger.debug)
216 @autopilot_logging.log_action(logger.debug)
215− def click_scope_item(self, category, title):
217+ def click_scope_item(self, category, title, press_duration=0.10):
216 """Click an item from the scope.
218 """Click an item from the scope.
218 :parameter category: The name of the category where the item is.
220 :parameter category: The name of the category where the item is.
@@ -225,7 +227,7 @@ class GenericScopeView(emulators.UnityEmulatorBase):
225 list_view = self.select_single(
227 list_view = self.select_single(
226 ListViewWithPageHeader, objectName='categoryListView')
228 ListViewWithPageHeader, objectName='categoryListView')
227 list_view.swipe_child_into_view(icon)
229 list_view.swipe_child_into_view(icon)
228− self.pointing_device.click_object(icon)
230+ self.pointing_device.click_object(icon, press_duration=press_duration)
230 def _get_category_element(self, category):
232 def _get_category_element(self, category):