Lomiri
lomiri.shell.ShellView Class Reference

Inherits LomiriUIToolkitCustomProxyObjectBase.

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 98 of file __init__.py.

Member Function Documentation

◆ close_indicator_page()

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

Definition at line 152 of file __init__.py.

152  def close_indicator_page(self):
153  """Swipe to close the opened indicator, wait until it's closed."""
154  indicators_menu = self.wait_select_single('IndicatorsMenu')
155  end_x, end_y = input.get_center_point(indicators_menu)
156  start_x = end_x
157  start_y = self.height
158  self.pointing_device.drag(start_x, start_y, end_x, end_y)
159  indicators_menu.fullyClosed.wait_for(True)
160 

◆ enter_pin_code()

def lomiri.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 211 of file __init__.py.

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

◆ get_current_focused_app_id()

def lomiri.shell.ShellView.get_current_focused_app_id (   self)
Return the id of the focused application.

Definition at line 175 of file __init__.py.

175  def get_current_focused_app_id(self):
176  """Return the id of the focused application."""
177  return self._get_shell().focusedApplicationId
178 

◆ launch_application()

def lomiri.shell.ShellView.launch_application (   self,
  application_name 
)
Launch an application.

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

Definition at line 200 of file __init__.py.

200  def launch_application(self, application_name):
201  """Launch an application.
202 
203  :parameter application_name: The name of the application to launch.
204 
205  """
206  launcher = self.open_launcher()
207  launcher.click_application_launcher_icon(application_name)
208  self.get_current_focused_app_id().wait_for(application_name)
209  launcher.shown.wait_for(False)
210 

◆ open_indicator_page()

def lomiri.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 138 of file __init__.py.

138  def open_indicator_page(self, indicator_name):
139  """Swipe to open the indicator, wait until it's open.
140 
141  :returns: The indicator page.
142  """
143  widget = self._get_indicator_panel_item(indicator_name)
144  start_x, start_y = input.get_center_point(widget)
145  end_x = start_x
146  end_y = self.height
147  self.pointing_device.drag(start_x, start_y, end_x, end_y)
148  self.wait_select_single('IndicatorsMenu', fullyOpened=True)
149  return self._get_indicator_page(indicator_name)
150 

◆ show_dash_from_launcher()

def lomiri.shell.ShellView.show_dash_from_launcher (   self)
Open the dash clicking the dash icon on the launcher.

Definition at line 180 of file __init__.py.

180  def show_dash_from_launcher(self):
181  """Open the dash clicking the dash icon on the launcher."""
182  launcher = self.open_launcher()
183  launcher.click_dash_icon()
184  self.get_current_focused_app_id().wait_for('lomiri-dash')
185  launcher.shown.wait_for(False)
186 

◆ show_dash_swiping()

def lomiri.shell.ShellView.show_dash_swiping (   self)
Show the dash swiping from the left.

Definition at line 162 of file __init__.py.

162  def show_dash_swiping(self):
163  """Show the dash swiping from the left."""
164  x, y, width, height = self._get_shell().globalRect
165  start_x = x
166  end_x = x + width
167  start_y = end_y = y + height // 2
168 
169  self.pointing_device.drag(start_x, start_y, end_x, end_y)
170  self.get_current_focused_app_id().wait_for('lomiri-dash')
171 

◆ wait_for_notification()

def lomiri.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 251 of file __init__.py.

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

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