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 191 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 217 of file dash.py.

217  def click_scope_item(self, category, title, press_duration=0.10):
218  """Click an item from the scope.
219 
220  :parameter category: The name of the category where the item is.
221  :parameter title: The title of the item.
222 
223  """
224  category_element = self._get_category_element(category)
225  icon = category_element.wait_select_single(
226  'UCAbstractButton', title=title)
227  list_view = self.select_single(
228  ListViewWithPageHeader, objectName='categoryListView')
229  list_view.swipe_child_into_view(icon)
230  self.pointing_device.click_object(icon, press_duration=press_duration)
231 
def click_scope_item(self, category, title, press_duration=0.10)
Definition: dash.py:217
def _get_category_element(self, category)
Definition: dash.py:232
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 241 of file dash.py.

241  def get_applications(self, category):
242  """Return the list of applications on a category.
243 
244  :parameter category: The name of the category.
245 
246  """
247  category_element = self._get_category_element(category)
248  see_all = category_element.select_single(objectName='seeAll')
249  application_cards = category_element.select_many('UCAbstractButton')
250 
251  application_cards = sorted(
252  (card for card in application_cards
253  if card.globalRect.y < see_all.globalRect.y),
254  key=lambda card: (card.globalRect.y, card.globalRect.x))
255 
256  result = []
257  for card in application_cards:
258  if card.objectName not in ('cardToolCard', 'seeAll'):
259  result.append(card.title)
260  return result
261 
262 
def _get_category_element(self, category)
Definition: dash.py:232
def get_applications(self, category)
Definition: dash.py:241
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 195 of file dash.py.

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

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