Unity 8
unity8.shell.ShellView Class Reference

Inherits UbuntuUIToolkitCustomProxyObjectBase.

Public Member Functions

def get_greeter (self)
 
def get_login_loader (self)
 
def get_login_list (self)
 
def get_bottombar (self)
 
def get_pinPadLoader (self)
 
def get_lockscreen (self)
 
def get_pinentryField (self)
 
def open_indicator_page (self, indicator_name)
 
def close_indicator_page (self)
 
def show_dash_swiping (self)
 
def get_current_focused_app_id (self)
 
def show_dash_from_launcher (self)
 
def open_launcher (self)
 
def is_launcher_open (self)
 
def launch_application (self, application_name)
 
def enter_pin_code (self, code)
 
def get_shell_orientation_angle (self)
 
def get_shell_orientation (self)
 
def get_shell_primary_orientation (self)
 
def get_shell_native_orientation (self)
 
def wait_for_notification (self)
 

Detailed Description

An helper class that makes it easy to interact with the shell

Definition at line 96 of file __init__.py.

Member Function Documentation

def unity8.shell.ShellView.close_indicator_page (   self)
Swipe to close the opened indicator, wait until it's closed.

Definition at line 150 of file __init__.py.

151  """Swipe to close the opened indicator, wait until it's closed."""
152  indicators_menu = self.wait_select_single('IndicatorsMenu')
153  end_x, end_y = input.get_center_point(indicators_menu)
154  start_x = end_x
155  start_y = self.height
156  self.pointing_device.drag(start_x, start_y, end_x, end_y)
157  indicators_menu.fullyClosed.wait_for(True)
158 
def close_indicator_page(self)
Definition: __init__.py:150
def unity8.shell.ShellView.enter_pin_code (   self,
  code 
)
Enter code 'code' into the single-pin lightdm pincode entry screen.

:param code: must be a string of numeric characters.
:raises: TypeError if code is not a string.
:raises: ValueError if code contains non-numeric characters.

Definition at line 209 of file __init__.py.

209  def enter_pin_code(self, code):
210  """Enter code 'code' into the single-pin lightdm pincode entry screen.
211 
212  :param code: must be a string of numeric characters.
213  :raises: TypeError if code is not a string.
214  :raises: ValueError if code contains non-numeric characters.
215 
216  """
217  if not isinstance(code, str):
218  raise TypeError(
219  "'code' parameter must be a string, not %r."
220  % type(code)
221  )
222  for num in code:
223  if not num.isdigit():
224  raise ValueError(
225  "'code' parameter contains non-numeric characters."
226  )
227  self.pointing_device.click_object(
228  self._get_pinpad_button(int(num)))
229 
def _get_pinpad_button(self, button_id)
Definition: __init__.py:230
def enter_pin_code(self, code)
Definition: __init__.py:209
def unity8.shell.ShellView.get_current_focused_app_id (   self)
Return the id of the focused application.

Definition at line 173 of file __init__.py.

174  """Return the id of the focused application."""
175  return self._get_shell().focusedApplicationId
176 
def get_current_focused_app_id(self)
Definition: __init__.py:173
def _get_shell(self)
Definition: __init__.py:170
def unity8.shell.ShellView.launch_application (   self,
  application_name 
)
Launch an application.

:parameter application_name: The name of the application to launch.

Definition at line 198 of file __init__.py.

198  def launch_application(self, application_name):
199  """Launch an application.
200 
201  :parameter application_name: The name of the application to launch.
202 
203  """
204  launcher = self.open_launcher()
205  launcher.click_application_launcher_icon(application_name)
206  self.get_current_focused_app_id().wait_for(application_name)
207  launcher.shown.wait_for(False)
208 
def get_current_focused_app_id(self)
Definition: __init__.py:173
def open_launcher(self)
Definition: __init__.py:186
def launch_application(self, application_name)
Definition: __init__.py:198
def unity8.shell.ShellView.open_indicator_page (   self,
  indicator_name 
)
Swipe to open the indicator, wait until it's open.

:returns: The indicator page.

Definition at line 136 of file __init__.py.

136  def open_indicator_page(self, indicator_name):
137  """Swipe to open the indicator, wait until it's open.
138 
139  :returns: The indicator page.
140  """
141  widget = self._get_indicator_panel_item(indicator_name)
142  start_x, start_y = input.get_center_point(widget)
143  end_x = start_x
144  end_y = self.height
145  self.pointing_device.drag(start_x, start_y, end_x, end_y)
146  self.wait_select_single('IndicatorsMenu', fullyOpened=True)
147  return self._get_indicator_page(indicator_name)
148 
def open_indicator_page(self, indicator_name)
Definition: __init__.py:136
def _get_indicator_panel_item(self, indicator_name)
Definition: __init__.py:123
def _get_indicator_page(self, indicator_name)
Definition: __init__.py:129
def unity8.shell.ShellView.show_dash_from_launcher (   self)
Open the dash clicking the dash icon on the launcher.

Definition at line 178 of file __init__.py.

179  """Open the dash clicking the dash icon on the launcher."""
180  launcher = self.open_launcher()
181  launcher.click_dash_icon()
182  self.get_current_focused_app_id().wait_for('unity8-dash')
183  launcher.shown.wait_for(False)
184 
def get_current_focused_app_id(self)
Definition: __init__.py:173
def show_dash_from_launcher(self)
Definition: __init__.py:178
def open_launcher(self)
Definition: __init__.py:186
def unity8.shell.ShellView.show_dash_swiping (   self)
Show the dash swiping from the left.

Definition at line 160 of file __init__.py.

160  def show_dash_swiping(self):
161  """Show the dash swiping from the left."""
162  x, y, width, height = self._get_shell().globalRect
163  start_x = x
164  end_x = x + width
165  start_y = end_y = y + height // 2
166 
167  self.pointing_device.drag(start_x, start_y, end_x, end_y)
168  self.get_current_focused_app_id().wait_for('unity8-dash')
169 
def get_current_focused_app_id(self)
Definition: __init__.py:173
def show_dash_swiping(self)
Definition: __init__.py:160
def _get_shell(self)
Definition: __init__.py:170
def unity8.shell.ShellView.wait_for_notification (   self)
Wait for a notification dialog to appear.

:return: An object for the notification dialog data.
:raise StateNotFoundError: if the timeout expires when the
notification has not appeared.

Definition at line 249 of file __init__.py.

250  """Wait for a notification dialog to appear.
251 
252  :return: An object for the notification dialog data.
253  :raise StateNotFoundError: if the timeout expires when the
254  notification has not appeared.
255 
256  """
257  notify_list = self.select_single('Notifications',
258  objectName='notificationList')
259  visible_notification = notify_list.wait_select_single('Notification',
260  visible=True)
261  return {'summary': visible_notification.summary,
262  'body': visible_notification.body,
263  'iconSource': visible_notification.iconSource}
264 
def wait_for_notification(self)
Definition: __init__.py:249

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