|
| lomiri_geometry_args |
|
| grid_size |
|
| scenarios |
|
Collection of test for Interactive tests including snap decisions.
Definition at line 112 of file test_notifications.py.
◆ assert_notification_action_id_was_called()
def lomiri.shell.tests.test_notifications.InteractiveNotificationBase.assert_notification_action_id_was_called |
( |
|
self, |
|
|
|
action_id, |
|
|
|
timeout = 10 |
|
) |
| |
Assert that the interactive notification callback of id *action_id*
was called.
:raises AssertionError: If no interactive notification has actually
been created.
:raises AssertionError: When *action_id* does not match the actual
returned.
:raises AssertionError: If no callback was called at all.
Definition at line 377 of file test_notifications.py.
377 def assert_notification_action_id_was_called(self, action_id, timeout=10):
378 """Assert that the interactive notification callback of id *action_id*
381 :raises AssertionError: If no interactive notification has actually
383 :raises AssertionError: When *action_id* does not match the actual
385 :raises AssertionError: If no callback was called at all.
388 if self._notify_proc
is None:
389 raise AssertionError(
"No interactive notification was created.")
391 for i
in range(timeout):
392 self._notify_proc.poll()
393 if self._notify_proc.returncode
is not None:
394 output = self._notify_proc.communicate()
395 actual_action_id = output[0].strip(
"\n")
396 if actual_action_id != action_id:
397 raise AssertionError(
398 "action id '%s' does not match actual returned '%s'"
399 % (action_id, actual_action_id)
405 os.killpg(self._notify_proc.pid, signal.SIGTERM)
406 self._notify_proc =
None
407 raise AssertionError(
408 "No callback was called, killing interactivenotification script"
◆ test_interactive()
def lomiri.shell.tests.test_notifications.InteractiveNotificationBase.test_interactive |
( |
|
self | ) |
|
Interactive notification must react upon click on itself.
Definition at line 120 of file test_notifications.py.
120 def test_interactive(self):
121 """Interactive notification must react upon click on itself."""
125 notify_list = self._get_notifications_list()
127 summary =
"Interactive notification"
128 body =
"This notification can be clicked on to trigger an action."
129 icon_path = self._get_icon_path(
'avatars/anna_olsson.png')
130 actions = [(
"action_id",
"dummy")]
132 (
"x-lomiri-switch-to-application",
"true"),
133 (
"x-lomiri-secondary-icon",
"dialer")
136 self._create_interactive_notification(
145 get_notification =
lambda: notify_list.wait_select_single(
146 'Notification', objectName=
'notification0')
147 notification = get_notification()
149 notification.pointing_device.click_object(
150 notification.select_single(objectName=
"interactiveArea")
153 self.assert_notification_action_id_was_called(
'action_id')
◆ test_modal_sd_with_greeter()
def lomiri.shell.tests.test_notifications.InteractiveNotificationBase.test_modal_sd_with_greeter |
( |
|
self | ) |
|
A snap-decision should block input to the
greeter/lockscreen beneath it.
Definition at line 245 of file test_notifications.py.
245 def test_modal_sd_with_greeter(self):
246 """A snap-decision should block input to the
247 greeter/lockscreen beneath it.
251 summary =
"Incoming file"
252 body =
"Frank would like to send you the file: essay.pdf"
253 icon_path =
"sync-idle"
255 (
"x-lomiri-snap-decisions",
"true"),
256 (
"x-lomiri-non-shaped-icon",
"true"),
257 (
"x-lomiri-private-affirmative-tint",
"true"),
258 (
"x-lomiri-private-rejection-tint",
"true"),
262 (
'action_accept',
'Accept'),
263 (
'action_decline_1',
'Decline'),
266 self._create_interactive_notification(
278 self.main_window.show_dash_swiping()
280 self.main_window.is_launcher_open, Eventually(Equals(
False)))
283 notify_list = self._get_notifications_list()
284 get_notification =
lambda: notify_list.wait_select_single(
285 'Notification', objectName=
'notification0')
286 notification = get_notification()
287 self._assert_notification(
288 notification, summary, body,
True,
False, 1.0)
289 notification.pointing_device.click_object(
290 notification.select_single(objectName=
"notify_button0"))
291 self.assert_notification_action_id_was_called(
"action_accept")
◆ test_modal_sd_without_greeter()
def lomiri.shell.tests.test_notifications.InteractiveNotificationBase.test_modal_sd_without_greeter |
( |
|
self | ) |
|
Snap-decision should block input to shell
without greeter/lockscreen.
Definition at line 196 of file test_notifications.py.
196 def test_modal_sd_without_greeter(self):
197 """Snap-decision should block input to shell
198 without greeter/lockscreen.
203 summary =
"Incoming file"
204 body =
"Frank would like to send you the file: essay.pdf"
205 icon_path =
"sync-idle"
207 (
"x-lomiri-snap-decisions",
"true"),
208 (
"x-lomiri-non-shaped-icon",
"true"),
209 (
"x-lomiri-private-affirmative-tint",
"true"),
210 (
"x-lomiri-private-rejection-tint",
"true"),
214 (
'action_accept',
'Accept'),
215 (
'action_decline_1',
'Decline'),
218 self._create_interactive_notification(
230 self.main_window.show_dash_swiping()
232 self.main_window.is_launcher_open, Eventually(Equals(
False)))
235 notify_list = self._get_notifications_list()
236 get_notification =
lambda: notify_list.wait_select_single(
237 'Notification', objectName=
'notification0')
238 notification = get_notification()
239 self._assert_notification(
240 notification, summary, body,
True,
False, 1.0)
241 notification.pointing_device.click_object(
242 notification.select_single(objectName=
"notify_button0"))
243 self.assert_notification_action_id_was_called(
"action_accept")
◆ test_sd_one_over_two_layout()
def lomiri.shell.tests.test_notifications.InteractiveNotificationBase.test_sd_one_over_two_layout |
( |
|
self | ) |
|
Snap-decision with three actions should use
one-over two button layout.
Definition at line 155 of file test_notifications.py.
155 def test_sd_one_over_two_layout(self):
156 """Snap-decision with three actions should use
157 one-over two button layout.
162 summary =
"Theatre at Ferria Stadium"
163 body =
"at Ferria Stadium in Bilbao, Spain\n07578545317"
165 (
"x-lomiri-snap-decisions",
"true"),
166 (
"x-lomiri-non-shaped-icon",
"true"),
167 (
"x-lomiri-private-affirmative-tint",
"true")
171 (
'action_accept',
'Ok'),
172 (
'action_decline_1',
'Snooze'),
173 (
'action_decline_2',
'View'),
176 self._create_interactive_notification(
186 notify_list = self._get_notifications_list()
187 get_notification =
lambda: notify_list.wait_select_single(
188 'Notification', objectName=
'notification0')
189 notification = get_notification()
190 self._assert_notification(
191 notification, summary, body,
False,
False, 1.0)
192 notification.pointing_device.click_object(
193 notification.select_single(objectName=
"notify_oot_button0"))
194 self.assert_notification_action_id_was_called(
"action_accept")
The documentation for this class was generated from the following file: