on xenial help sign in
Start of AP-tests for modal snap-decision notifications.
commitbcdd69ca28f9e52c06639fd41c059c247402ce4c authorMirco Müller <mirco.mueller@canonical.com> dateThu 13 Mar 2014, 17:47 (13 years ago) parent809daa9
1 file changed+71−1
tests/autopilot/unity8/shell/tests/test_notifications.py+71−1
tests/autopilot/unity8/shell/tests/test_notifications.py+71−1
@@ -196,7 +196,7 @@ class InteractiveNotificationBase(NotificationsBase):
196196 get_notification = lambda: notify_list.wait_select_single(
197197 'Notification', objectName='notification0')
198198 notification = get_notification()
199− self._assert_notification(notification, None, None, True, True, 1.0)
199+ self._assert_notification(notification, summary, body, True, True, 1.0)
200200 initial_height = notification.height
201201 self.touch.tap_object(notification.select_single(objectName="button1"))
202202 self.assertThat(
@@ -209,6 +209,76 @@ class InteractiveNotificationBase(NotificationsBase):
209209 self.touch.tap_object(notification.select_single(objectName="button4"))
210210 self.assert_notification_action_id_was_called("action_decline_4")
211211
212+ def test_modal_sd_without_greeter (self):
213+ """A snap-decision on a phone should block input to shell beneath it when there's no greeter."""
214+ unity_proxy = self.launch_unity()
215+ unlock_unity(unity_proxy)
216+
217+ summary = "Incoming file"
218+ body = "Frank would like to send you the file: essay.pdf"
219+ icon_path = "sync-idle"
220+ hints = [
221+ ("x-canonical-snap-decisions", "true"),
222+ ("x-canonical-non-shaped-icon", "true"),
223+ ]
224+
225+ actions = [
226+ ('action_accept', 'Accept'),
227+ ('action_decline_1', 'Decline'),
228+ ]
229+
230+ self._create_interactive_notification(
231+ summary,
232+ body,
233+ icon_path,
234+ "NORMAL",
235+ actions,
236+ hints
237+ )
238+
239+ notify_list = self._get_notifications_list()
240+ get_notification = lambda: notify_list.wait_select_single(
241+ 'Notification', objectName='notification0')
242+ notification = get_notification()
243+ self._assert_notification(notification, summary, body, True, False, 1.0)
244+ self.touch.tap_object(notification.select_single(objectName="button0"))
245+ self.assert_notification_action_id_was_called("action_accept")
246+
247+ def test_modal_sd_with_greeter (self):
248+ """A snap-decision on a phone should not block input to the greeter beneath it."""
249+ unity_proxy = self.launch_unity()
250+ greeter = self.main_window.get_greeter()
251+
252+ summary = "Incoming file"
253+ body = "Frank would like to send you the file: essay.pdf"
254+ icon_path = "sync-idle"
255+ hints = [
256+ ("x-canonical-snap-decisions", "true"),
257+ ("x-canonical-non-shaped-icon", "true"),
258+ ]
259+
260+ actions = [
261+ ('action_accept', 'Accept'),
262+ ('action_decline_1', 'Decline'),
263+ ]
264+
265+ self._create_interactive_notification(
266+ summary,
267+ body,
268+ icon_path,
269+ "NORMAL",
270+ actions,
271+ hints
272+ )
273+
274+ notify_list = self._get_notifications_list()
275+ get_notification = lambda: notify_list.wait_select_single(
276+ 'Notification', objectName='notification0')
277+ notification = get_notification()
278+ self._assert_notification(notification, summary, body, True, False, 1.0)
279+ self.touch.tap_object(notification.select_single(objectName="button0"))
280+ self.assert_notification_action_id_was_called("action_accept")
281+
212282 def _create_interactive_notification(
213283 self,
214284 summary="",