Lomiri
lomiri.shell.ShellView Class Reference

Inherits lomiriuitoolkit.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_bottombar()

def lomiri.shell.ShellView.get_bottombar (   self)

Definition at line 110 of file __init__.py.

110 def get_bottombar(self):
111 return self.select_single("Bottombar")
112

◆ 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

◆ get_greeter()

def lomiri.shell.ShellView.get_greeter (   self)

Definition at line 101 of file __init__.py.

101 def get_greeter(self):
102 return self.select_single(greeter.Greeter)
103

◆ get_lockscreen()

def lomiri.shell.ShellView.get_lockscreen (   self)

Definition at line 119 of file __init__.py.

119 def get_lockscreen(self):
120 return self.select_single("Lockscreen")
121

◆ get_login_list()

def lomiri.shell.ShellView.get_login_list (   self)

Definition at line 107 of file __init__.py.

107 def get_login_list(self):
108 return self.select_single("LoginList")
109

◆ get_login_loader()

def lomiri.shell.ShellView.get_login_loader (   self)

Definition at line 104 of file __init__.py.

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

◆ get_pinentryField()

def lomiri.shell.ShellView.get_pinentryField (   self)

Definition at line 122 of file __init__.py.

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

◆ get_pinPadLoader()

def lomiri.shell.ShellView.get_pinPadLoader (   self)

Definition at line 113 of file __init__.py.

113 def get_pinPadLoader(self):
114 return self.select_single(
115 "QQuickLoader",
116 objectName="pinPadLoader"
117 )
118

◆ get_shell_native_orientation()

def lomiri.shell.ShellView.get_shell_native_orientation (   self)

Definition at line 247 of file __init__.py.

247 def get_shell_native_orientation(self):
248 return self._get_shell().nativeOrientation
249

◆ get_shell_orientation()

def lomiri.shell.ShellView.get_shell_orientation (   self)

Definition at line 241 of file __init__.py.

241 def get_shell_orientation(self):
242 return self._get_shell().orientation
243

◆ get_shell_orientation_angle()

def lomiri.shell.ShellView.get_shell_orientation_angle (   self)

Definition at line 238 of file __init__.py.

238 def get_shell_orientation_angle(self):
239 return self._get_shell().orientationAngle
240

◆ get_shell_primary_orientation()

def lomiri.shell.ShellView.get_shell_primary_orientation (   self)

Definition at line 244 of file __init__.py.

244 def get_shell_primary_orientation(self):
245 return self._get_shell().primaryOrientation
246

◆ is_launcher_open()

def lomiri.shell.ShellView.is_launcher_open (   self)

Definition at line 196 of file __init__.py.

196 def is_launcher_open(self):
197 return self._get_launcher().shown
198

◆ 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

◆ open_launcher()

def lomiri.shell.ShellView.open_launcher (   self)

Definition at line 188 of file __init__.py.

188 def open_launcher(self):
189 launcher = self._get_launcher()
190 launcher.show()
191 return launcher
192

◆ 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: