@@ -45,7 +45,7 @@ class NotificationsBase(UnityTestCase):
45 """Given an icons file name returns the full path (either system or
45 """Given an icons file name returns the full path (either system or
46 source tree.
46 source tree.
48− Consider the graphics directory as root so for example (runnign tests
48+ Consider the graphics directory as root so for example (running tests
49 from installed unity8-autopilot package):
49 from installed unity8-autopilot package):
50 >>> self.get_icon_path('clock.png')
50 >>> self.get_icon_path('clock.png')
51 /usr/share/unity8/graphics/clock.png
51 /usr/share/unity8/graphics/clock.png
@@ -63,7 +63,7 @@ class NotificationsBase(UnityTestCase):
64 def _get_notifications_list(self):
64 def _get_notifications_list(self):
65 main_view = self.main_window.get_qml_view()
65 main_view = self.main_window.get_qml_view()
66− return main_view.select_single(
66+ return main_view.wait_select_single(
67 "QQuickListView",
67 "QQuickListView",
68 objectName='notificationList'
68 objectName='notificationList'
@@ -145,8 +145,8 @@ class InteractiveNotificationBase(NotificationsBase):
148+ get_notification = lambda: notify_list.wait_select_single(
148− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
149+ 'Notification', objectName='notification1')
149− self.assertThat(get_notification, Eventually(NotEquals(None)))
150 notification = get_notification()
150 notification = get_notification()
152 self.touch.tap_object(
152 self.touch.tap_object(
@@ -156,7 +156,8 @@ class InteractiveNotificationBase(NotificationsBase):
156 self.assert_notification_action_id_was_called('action_id')
156 self.assert_notification_action_id_was_called('action_id')
158 def test_sd_incoming_call(self):
158 def test_sd_incoming_call(self):
159− """Rejecting a call should make notification expand and offer more options."""
159+ """Rejecting a call should make notification expand and
160+ offer more options."""
160 self.launch_unity()
161 self.launch_unity()
161 greeter = self.main_window.get_greeter()
162 greeter = self.main_window.get_greeter()
162 greeter.swipe()
163 greeter.swipe()
@@ -191,8 +192,8 @@ class InteractiveNotificationBase(NotificationsBase):
195+ get_notification = lambda: notify_list.wait_select_single(
194− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
196+ 'Notification', objectName='notification1')
195− self.assertThat(get_notification, Eventually(NotEquals(None)))
196 notification = get_notification()
197 notification = get_notification()
197 self._assert_notification(notification, None, None, True, True, 1.0)
198 self._assert_notification(notification, None, None, True, True, 1.0)
198 initial_height = notification.height
199 initial_height = notification.height
@@ -200,8 +201,10 @@ class InteractiveNotificationBase(NotificationsBase):
200 self.assertThat(
201 self.assertThat(
201 notification.height,
202 notification.height,
202 Eventually(Equals(initial_height +
203 Eventually(Equals(initial_height +
204+ 3 * notification.select_single(
203− 3 * notification.select_single(objectName="buttonColumn").spacing +
205+ objectName="buttonColumn").spacing +
204− 3 * notification.select_single(objectName="button4").height)))
206+ 3 * notification.select_single(
207+ objectName="button4").height)))
205 self.touch.tap_object(notification.select_single(objectName="button4"))
208 self.touch.tap_object(notification.select_single(objectName="button4"))
206 self.assert_notification_action_id_was_called("action_decline_4")
209 self.assert_notification_action_id_was_called("action_decline_4")
@@ -360,13 +363,13 @@ class EphemeralNotificationsTests(NotificationsBase):
361 notification.show()
364 notification.show()
366+ notification = lambda: notify_list.wait_select_single(
363− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
367+ 'Notification', objectName='notification1')
364− self.assertThat(get_notification, Eventually(NotEquals(None)))
365− notification = get_notification()
366− self._assert_notification(notification, summary, body, True, True, 1.0)
368+ self._assert_notification(notification(), summary, body, True, True, 1.0)
368 def test_icon_summary(self):
370 def test_icon_summary(self):
369− """Notification must display the expected summary and secondary icon."""
371+ """Notification must display the expected summary and secondary
370 self.launch_unity()
373 self.launch_unity()
371 greeter = self.main_window.get_greeter()
374 greeter = self.main_window.get_greeter()
372 greeter.swipe()
375 greeter.swipe()
@@ -391,11 +394,11 @@ class EphemeralNotificationsTests(NotificationsBase):
392 notification.show()
395 notification.show()
397+ notification = lambda: notify_list.wait_select_single(
394− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
398+ 'Notification', objectName='notification1')
395− self.assertThat(get_notification, Eventually(NotEquals(None)))
399+
396− notification = get_notification()
397 self._assert_notification(
400 self._assert_notification(
398− notification,
401+ notification(),
@@ -404,7 +407,8 @@ class EphemeralNotificationsTests(NotificationsBase):
406 def test_urgency_order(self):
409 def test_urgency_order(self):
407− """Notifications must be displayed in order according to their urgency."""
410+ """Notifications must be displayed in order according to their
408 self.launch_unity()
412 self.launch_unity()
409 greeter = self.main_window.get_greeter()
413 greeter = self.main_window.get_greeter()
410 greeter.swipe()
414 greeter.swipe()
@@ -448,11 +452,10 @@ class EphemeralNotificationsTests(NotificationsBase):
449 notification_critical.show()
453 notification_critical.show()
451− get_notification = lambda: notify_list.select_single(
455+ get_notification = lambda: notify_list.wait_select_single(
452 'Notification',
456 'Notification',
453 summary=summary_critical
457 summary=summary_critical
455− self.assertThat(get_notification, Eventually(NotEquals(None)))
457 notification = get_notification()
460 notification = get_notification()
458 self._assert_notification(
461 self._assert_notification(
@@ -464,11 +467,10 @@ class EphemeralNotificationsTests(NotificationsBase):
467− get_normal_notification = lambda: notify_list.select_single(
470+ get_normal_notification = lambda: notify_list.wait_select_single(
468 'Notification',
471 'Notification',
469 summary=summary_normal
472 summary=summary_normal
471− self.assertThat(get_normal_notification, Eventually(NotEquals(None)))
472 notification = get_normal_notification()
474 notification = get_normal_notification()
473 self._assert_notification(
475 self._assert_notification(
474 notification,
476 notification,
@@ -479,11 +481,10 @@ class EphemeralNotificationsTests(NotificationsBase):
482− get_low_notification = lambda: notify_list.select_single(
484+ get_low_notification = lambda: notify_list.wait_select_single(
483 'Notification',
485 'Notification',
484 summary=summary_low
486 summary=summary_low
486− self.assertThat(get_low_notification, Eventually(NotEquals(None)))
487 notification = get_low_notification()
488 notification = get_low_notification()
488 self._assert_notification(
489 self._assert_notification(
489 notification,
490 notification,
@@ -508,9 +509,8 @@ class EphemeralNotificationsTests(NotificationsBase):
508 notification = self._create_ephemeral_notification(summary, body)
509 notification = self._create_ephemeral_notification(summary, body)
509 notification.show()
510 notification.show()
512+ notification = notify_list.wait_select_single(
511− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
513+ 'Notification', objectName='notification1')
512− self.assertThat(get_notification, Eventually(NotEquals(None)))
513− notification = get_notification()
514 self._assert_notification(
514 self._assert_notification(
515 notification,
515 notification,
@@ -533,14 +533,14 @@ class EphemeralNotificationsTests(NotificationsBase):
533 notification = self._create_ephemeral_notification(summary)
533 notification = self._create_ephemeral_notification(summary)
534 notification.show()
534 notification.show()
536+ notification = notify_list.wait_select_single(
536− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
537+ 'Notification', objectName='notification1')
537− self.assertThat(get_notification, Eventually(NotEquals(None)))
538− notification = get_notification()
540 self._assert_notification(notification, summary, '', False, False, 1.0)
539 self._assert_notification(notification, summary, '', False, False, 1.0)
542 def test_update_notification_same_layout(self):
541 def test_update_notification_same_layout(self):
543− """Notification must allow updating its contents while being displayed."""
542+ """Notification must allow updating its contents while being
544 self.launch_unity()
544 self.launch_unity()
545 greeter = self.main_window.get_greeter()
545 greeter = self.main_window.get_greeter()
546 greeter.swipe()
546 greeter.swipe()
@@ -558,8 +558,8 @@ class EphemeralNotificationsTests(NotificationsBase):
559 notification.show()
559 notification.show()
561− get_notification = lambda: notify_list.select_single('Notification', summary=summary)
561+ get_notification = lambda: notify_list.wait_select_single(
562− self.assertThat(get_notification, Eventually(NotEquals(None)))
562+ 'Notification', summary=summary)
563 self._assert_notification(
563 self._assert_notification(
564 get_notification(),
564 get_notification(),
@@ -575,11 +575,11 @@ class EphemeralNotificationsTests(NotificationsBase):
575 icon_path = self._get_icon_path('avatars/amanda.png')
575 icon_path = self._get_icon_path('avatars/amanda.png')
576 notification.update(summary, body, icon_path)
576 notification.update(summary, body, icon_path)
577 notification.show()
577 notification.show()
578− self.assertThat(get_notification, Eventually(NotEquals(None)))
579 self._assert_notification(get_notification(), summary, body)
578 self._assert_notification(get_notification(), summary, body)
581 def test_update_notification_layout_change(self):
580 def test_update_notification_layout_change(self):
582− """Notification must allow updating its contents and layout while being displayed."""
581+ """Notification must allow updating its contents and layout while
583 self.launch_unity()
583 self.launch_unity()
584 greeter = self.main_window.get_greeter()
584 greeter = self.main_window.get_greeter()
585 greeter.swipe()
585 greeter.swipe()
@@ -603,8 +603,8 @@ class EphemeralNotificationsTests(NotificationsBase):
604 notification.show()
604 notification.show()
606+ get_notification = lambda: notify_list.wait_select_single(
606− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
607+ 'Notification', objectName='notification1')
607− self.assertThat(get_notification, Eventually(NotEquals(None)))
608 self._assert_notification(
608 self._assert_notification(
609 get_notification(),
609 get_notification(),
@@ -645,8 +645,8 @@ class EphemeralNotificationsTests(NotificationsBase):
646 notification.show()
646 notification.show()
648+ get_notification = lambda: notify_list.wait_select_single(
648− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
649+ 'Notification', objectName='notification1')
649− self.assertThat(get_notification, Eventually(NotEquals(None)))
650 notification = get_notification()
650 notification = get_notification()
651 self._assert_notification(
651 self._assert_notification(
652 notification,
652 notification,
@@ -662,7 +662,8 @@ class EphemeralNotificationsTests(NotificationsBase):
662 'Did you watch the air-race in Oshkosh last week?',
662 'Did you watch the air-race in Oshkosh last week?',
663 'Phil owned the place like no one before him!',
663 'Phil owned the place like no one before him!',
664 'Did really everything in the race work according to regulations?',
664 'Did really everything in the race work according to regulations?',
665− 'Somehow I think to remember Burt Williams did cut corners and was not punished for this.',
665+ 'Somehow I think to remember Burt Williams did cut corners and '
666+ 'was not punished for this.',
666 'Hopefully the referees will watch the videos of the race.',
667 'Hopefully the referees will watch the videos of the race.',
667 'Burt could get fined with US$ 50000 for that rule-violation :)'
668 'Burt could get fined with US$ 50000 for that rule-violation :)'
@@ -677,11 +678,10 @@ class EphemeralNotificationsTests(NotificationsBase):
677 hints=[('x-canonical-append', 'true')]
678 hints=[('x-canonical-append', 'true')]
679 notification.show()
680 notification.show()
680− get_notification = lambda: notify_list.select_single(
681+ get_notification = lambda: notify_list.wait_select_single(
681 'Notification',
682 'Notification',
682 objectName='notification1'
683 objectName='notification1'
684− self.assertThat(get_notification, Eventually(NotEquals(None)))
685 notification = get_notification()
685 notification = get_notification()
686 self._assert_notification(
686 self._assert_notification(
687 notification,
687 notification,