Unity 8
unity8.dash.GenericScopeView Class Reference

Inherits UbuntuUIToolkitCustomProxyObjectBase.

Public Member Functions

def open_preview (self, category, app_name, press_duration=0.10)
 
def click_scope_item (self, category, title, press_duration=0.10)
 
def get_applications (self, category)
 

Detailed Description

Autopilot helper for generic scopes.

Definition at line 190 of file dash.py.

Member Function Documentation

def unity8.dash.GenericScopeView.click_scope_item (   self,
  category,
  title,
  press_duration = 0.10 
)
Click an item from the scope.

:parameter category: The name of the category where the item is.
:parameter title: The title of the item.

Definition at line 216 of file dash.py.

216  def click_scope_item(self, category, title, press_duration=0.10):
217  """Click an item from the scope.
218 
219  :parameter category: The name of the category where the item is.
220  :parameter title: The title of the item.
221 
222  """
223  category_element = self._get_category_element(category)
224  icon = category_element.wait_select_single(
225  'UCAbstractButton', title=title)
226  list_view = self.select_single(
227  ListViewWithPageHeader, objectName='categoryListView')
228  list_view.swipe_child_into_view(icon)
229  self.pointing_device.click_object(icon, press_duration=press_duration)
230 
def click_scope_item(self, category, title, press_duration=0.10)
Definition: dash.py:216
def _get_category_element(self, category)
Definition: dash.py:231
def unity8.dash.GenericScopeView.get_applications (   self,
  category 
)
Return the list of applications on a category.

:parameter category: The name of the category.

Definition at line 240 of file dash.py.

240  def get_applications(self, category):
241  """Return the list of applications on a category.
242 
243  :parameter category: The name of the category.
244 
245  """
246  category_element = self._get_category_element(category)
247  see_all = category_element.select_single(objectName='seeAll')
248  application_cards = category_element.select_many('UCAbstractButton')
249 
250  application_cards = sorted(
251  (card for card in application_cards
252  if card.globalRect.y < see_all.globalRect.y),
253  key=lambda card: (card.globalRect.y, card.globalRect.x))
254 
255  result = []
256  for card in application_cards:
257  if card.objectName not in ('cardToolCard', 'seeAll'):
258  result.append(card.title)
259  return result
260 
261 
def _get_category_element(self, category)
Definition: dash.py:231
def get_applications(self, category)
Definition: dash.py:240
def unity8.dash.GenericScopeView.open_preview (   self,
  category,
  app_name,
  press_duration = 0.10 
)
Open the preview of an application.

:parameter category: The name of the category where the application is.
:parameter app_name: The name of the application.
:return: The opened preview.

Definition at line 194 of file dash.py.

194  def open_preview(self, category, app_name, press_duration=0.10):
195  """Open the preview of an application.
196 
197  :parameter category: The name of the category where the application is.
198  :parameter app_name: The name of the application.
199  :return: The opened preview.
200 
201  """
202  # FIXME some categories need a long press in order to see the preview.
203  # Some categories do not show previews, like recent apps.
204  # --elopio - 2014-1-14
205  self.click_scope_item(category, app_name, press_duration)
206  preview_list = self.wait_select_single(
207  'QQuickLoader', objectName='subPageLoader')
208  preview_list.subPageShown.wait_for(True)
209  preview_list.x.wait_for(0)
210  self.get_root_instance().select_single(
211  objectName='processingIndicator').visible.wait_for(False)
212  return preview_list.select_single(
213  Preview, objectName='preview')
214 
def click_scope_item(self, category, title, press_duration=0.10)
Definition: dash.py:216
def open_preview(self, category, app_name, press_duration=0.10)
Definition: dash.py:194

The documentation for this class was generated from the following file: