Loading...
Searching...
No Matches
lomiri.shell.ShellView Class Reference

## Public Member Functions

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

## Protected Member Functions

| _get_indicator_panel_item (self, indicator_name)
| _get_indicator_page (self, indicator_name)
| _get_shell (self)
| _get_launcher (self)
| _get_pinpad_button (self, button_id)

## 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

## _get_indicator_page()

lomiri.shell.ShellView._get_indicator_page | ( |  | self,
|  |  | indicator_name )

protected

Definition at line 131 of file __init__.py.

def _get_indicator_page(self, indicator_name):
return self.select_single(
'IndicatorPage',
objectName=indicator_name+'-page'
)

## _get_indicator_panel_item()

lomiri.shell.ShellView._get_indicator_panel_item | ( |  | self,
|  |  | indicator_name )

protected

Definition at line 125 of file __init__.py.

def _get_indicator_panel_item(self, indicator_name):
return self.select_single(
'IndicatorItem',
objectName=indicator_name+'-panelItem'
)

## _get_launcher()

lomiri.shell.ShellView._get_launcher | ( |  | self | ) |

protected

Definition at line 193 of file __init__.py.

def _get_launcher(self):
return self.select_single(launcher_helpers.Launcher)

## _get_pinpad_button()

lomiri.shell.ShellView._get_pinpad_button | ( |  | self,
|  |  | button_id )

protected

Definition at line 232 of file __init__.py.

def _get_pinpad_button(self, button_id):
return self.select_single(
'PinPadButton',
objectName='pinPadButton{}'.format(button_id)
)

## _get_shell()

lomiri.shell.ShellView._get_shell | ( |  | self | ) |

protected

Definition at line 172 of file __init__.py.

def _get_shell(self):
return self.select_single('Shell')

## close_indicator_page()

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.

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

## enter_pin_code()

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.

def 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.
"""
if not isinstance(code, str):
raise TypeError(
"'code' parameter must be a string, not %r."
% type(code)
)
for num in code:
if not num.isdigit():
raise ValueError(
"'code' parameter contains non-numeric characters."
)
self.pointing_device.click_object(
self._get_pinpad_button(int(num)))

## get_bottombar()

lomiri.shell.ShellView.get_bottombar | ( |  | self | ) |

Definition at line 110 of file __init__.py.

def get_bottombar(self):
return self.select_single("Bottombar")

## get_current_focused_app_id()

lomiri.shell.ShellView.get_current_focused_app_id | ( |  | self | ) |

    Return the id of the focused application.

Definition at line 175 of file __init__.py.

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

## get_greeter()

lomiri.shell.ShellView.get_greeter | ( |  | self | ) |

Definition at line 101 of file __init__.py.

def get_greeter(self):
return self.select_single(greeter.Greeter)

## get_lockscreen()

lomiri.shell.ShellView.get_lockscreen | ( |  | self | ) |

Definition at line 119 of file __init__.py.

def get_lockscreen(self):
return self.select_single("Lockscreen")

## get_login_list()

lomiri.shell.ShellView.get_login_list | ( |  | self | ) |

Definition at line 107 of file __init__.py.

def get_login_list(self):
return self.select_single("LoginList")

## get_login_loader()

lomiri.shell.ShellView.get_login_loader | ( |  | self | ) |

Definition at line 104 of file __init__.py.

def get_login_loader(self):
return self.select_single("QQuickLoader", objectName="loginLoader")

## get_pinentryField()

lomiri.shell.ShellView.get_pinentryField | ( |  | self | ) |

Definition at line 122 of file __init__.py.

def get_pinentryField(self):
return self.select_single(objectName="pinentryField")

## get_pinPadLoader()

lomiri.shell.ShellView.get_pinPadLoader | ( |  | self | ) |

Definition at line 113 of file __init__.py.

def get_pinPadLoader(self):
return self.select_single(
"QQuickLoader",
objectName="pinPadLoader"
)

## get_shell_native_orientation()

lomiri.shell.ShellView.get_shell_native_orientation | ( |  | self | ) |

Definition at line 247 of file __init__.py.

def get_shell_native_orientation(self):
return self._get_shell().nativeOrientation

## get_shell_orientation()

lomiri.shell.ShellView.get_shell_orientation | ( |  | self | ) |

Definition at line 241 of file __init__.py.

def get_shell_orientation(self):
return self._get_shell().orientation

## get_shell_orientation_angle()

lomiri.shell.ShellView.get_shell_orientation_angle | ( |  | self | ) |

Definition at line 238 of file __init__.py.

def get_shell_orientation_angle(self):
return self._get_shell().orientationAngle

## get_shell_primary_orientation()

lomiri.shell.ShellView.get_shell_primary_orientation | ( |  | self | ) |

Definition at line 244 of file __init__.py.

def get_shell_primary_orientation(self):
return self._get_shell().primaryOrientation

## is_launcher_open()

lomiri.shell.ShellView.is_launcher_open | ( |  | self | ) |

Definition at line 196 of file __init__.py.

def is_launcher_open(self):
return self._get_launcher().shown

## launch_application()

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.

def launch_application(self, application_name):
"""Launch an application.
:parameter application_name: The name of the application to launch.
"""
launcher = self.open_launcher()
launcher.click_application_launcher_icon(application_name)
self.get_current_focused_app_id().wait_for(application_name)
launcher.shown.wait_for(False)

## open_indicator_page()

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.

def open_indicator_page(self, indicator_name):
"""Swipe to open the indicator, wait until it's open.
:returns: The indicator page.
"""
widget = self._get_indicator_panel_item(indicator_name)
start_x, start_y = input.get_center_point(widget)
end_x = start_x
end_y = self.height
self.pointing_device.drag(start_x, start_y, end_x, end_y)
self.wait_select_single('IndicatorsMenu', fullyOpened=True)
return self._get_indicator_page(indicator_name)

## open_launcher()

lomiri.shell.ShellView.open_launcher | ( |  | self | ) |

Definition at line 188 of file __init__.py.

def open_launcher(self):
launcher = self._get_launcher()
launcher.show()
return launcher

## show_dash_from_launcher()

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.

def show_dash_from_launcher(self):
"""Open the dash clicking the dash icon on the launcher."""
launcher = self.open_launcher()
launcher.click_dash_icon()
self.get_current_focused_app_id().wait_for('lomiri-dash')
launcher.shown.wait_for(False)

## show_dash_swiping()

lomiri.shell.ShellView.show_dash_swiping | ( |  | self | ) |

    Show the dash swiping from the left.

Definition at line 162 of file __init__.py.

def show_dash_swiping(self):
"""Show the dash swiping from the left."""
x, y, width, height = self._get_shell().globalRect
start_x = x
end_x = x + width
start_y = end_y = y + height // 2
self.pointing_device.drag(start_x, start_y, end_x, end_y)
self.get_current_focused_app_id().wait_for('lomiri-dash')

## wait_for_notification()

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.

def 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.
"""
notify_list = self.select_single('Notifications',
objectName='notificationList')
visible_notification = notify_list.wait_select_single('Notification',
visible=True)
return {'summary': visible_notification.summary,
'body': visible_notification.body,
'iconSource': visible_notification.iconSource}

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

- tests/autopilot/lomiri/shell/__init__.py