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

Member Function Documentation

◆ click_scope_item()

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

200  def click_scope_item(self, category, title, press_duration=0.10):
201  """Click an item from the scope.
202 
203  :parameter category: The name of the category where the item is.
204  :parameter title: The title of the item.
205 
206  """
207  category_element = self._get_category_element(category)
208  icon = category_element.wait_select_single(
209  'UCAbstractButton', title=title)
210  list_view = self.select_single(
211  ListViewWithPageHeader, objectName='categoryListView')
212  list_view.swipe_child_into_view(icon)
213  self.pointing_device.click_object(icon, press_duration=press_duration)
214 

◆ get_applications()

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

224  def get_applications(self, category):
225  """Return the list of applications on a category.
226 
227  :parameter category: The name of the category.
228 
229  """
230  category_element = self._get_category_element(category)
231  see_all = category_element.select_single(objectName='seeAll')
232  application_cards = category_element.select_many('UCAbstractButton')
233 
234  application_cards = sorted(
235  (card for card in application_cards
236  if card.globalRect.y < see_all.globalRect.y),
237  key=lambda card: (card.globalRect.y, card.globalRect.x))
238 
239  result = []
240  for card in application_cards:
241  if card.objectName not in ('cardToolCard', 'seeAll'):
242  result.append(card.title)
243  return result
244 
245 

◆ open_preview()

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

178  def open_preview(self, category, app_name, press_duration=0.10):
179  """Open the preview of an application.
180 
181  :parameter category: The name of the category where the application is.
182  :parameter app_name: The name of the application.
183  :return: The opened preview.
184 
185  """
186  # FIXME some categories need a long press in order to see the preview.
187  # Some categories do not show previews, like recent apps.
188  # --elopio - 2014-1-14
189  self.click_scope_item(category, app_name, press_duration)
190  preview_list = self.wait_select_single(
191  'QQuickLoader', objectName='subPageLoader')
192  preview_list.subPageShown.wait_for(True)
193  preview_list.x.wait_for(0)
194  self.get_root_instance().select_single(
195  objectName='processingIndicator').visible.wait_for(False)
196  return preview_list.select_single(
197  Preview, objectName='preview')
198 

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