@@ -45,7 +45,7 @@ class NotificationsBase(UnityTestCase):
4545 """Given an icons file name returns the full path (either system or
4646 source tree.
4747
48− Consider the graphics directory as root so for example (runnign tests
48+ Consider the graphics directory as root so for example (running tests
4949 from installed unity8-autopilot package):
5050 >>> self.get_icon_path('clock.png')
5151 /usr/share/unity8/graphics/clock.png
@@ -63,7 +63,7 @@ class NotificationsBase(UnityTestCase):
6363
6464 def _get_notifications_list(self):
6565 main_view = self.main_window.get_qml_view()
66− return main_view.select_single(
66+ return main_view.wait_select_single(
6767 "QQuickListView",
6868 objectName='notificationList'
6969 )
@@ -145,8 +145,8 @@ class InteractiveNotificationBase(NotificationsBase):
145145 hints,
146146 )
147147
148− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
149− self.assertThat(get_notification, Eventually(NotEquals(None)))
148+ get_notification = lambda: notify_list.wait_select_single(
149+ 'Notification', objectName='notification1')
150150 notification = get_notification()
151151
152152 self.touch.tap_object(
@@ -156,7 +156,8 @@ class InteractiveNotificationBase(NotificationsBase):
156156 self.assert_notification_action_id_was_called('action_id')
157157
158158 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."""
160161 self.launch_unity()
161162 greeter = self.main_window.get_greeter()
162163 greeter.swipe()
@@ -191,8 +192,8 @@ class InteractiveNotificationBase(NotificationsBase):
191192 hints
192193 )
193194
194− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
195− self.assertThat(get_notification, Eventually(NotEquals(None)))
195+ get_notification = lambda: notify_list.wait_select_single(
196+ 'Notification', objectName='notification1')
196197 notification = get_notification()
197198 self._assert_notification(notification, None, None, True, True, 1.0)
198199 initial_height = notification.height
@@ -200,8 +201,10 @@ class InteractiveNotificationBase(NotificationsBase):
200201 self.assertThat(
201202 notification.height,
202203 Eventually(Equals(initial_height +
203− 3 * notification.select_single(objectName="buttonColumn").spacing +
204− 3 * notification.select_single(objectName="button4").height)))
204+ 3 * notification.select_single(
205+ objectName="buttonColumn").spacing +
206+ 3 * notification.select_single(
207+ objectName="button4").height)))
205208 self.touch.tap_object(notification.select_single(objectName="button4"))
206209 self.assert_notification_action_id_was_called("action_decline_4")
207210
@@ -360,13 +363,13 @@ class EphemeralNotificationsTests(NotificationsBase):
360363
361364 notification.show()
362365
363− get_notification = lambda: notify_list.select_single('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)
366+ notification = lambda: notify_list.wait_select_single(
367+ 'Notification', objectName='notification1')
368+ self._assert_notification(notification(), summary, body, True, True, 1.0)
367369
368370 def test_icon_summary(self):
369− """Notification must display the expected summary and secondary icon."""
371+ """Notification must display the expected summary and secondary
372+ icon."""
370373 self.launch_unity()
371374 greeter = self.main_window.get_greeter()
372375 greeter.swipe()
@@ -391,11 +394,11 @@ class EphemeralNotificationsTests(NotificationsBase):
391394
392395 notification.show()
393396
394− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
395− self.assertThat(get_notification, Eventually(NotEquals(None)))
396− notification = get_notification()
397+ notification = lambda: notify_list.wait_select_single(
398+ 'Notification', objectName='notification1')
399+
397400 self._assert_notification(
398− notification,
401+ notification(),
399402 summary,
400403 None,
401404 False,
@@ -404,7 +407,8 @@ class EphemeralNotificationsTests(NotificationsBase):
404407 )
405408
406409 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
411+ urgency."""
408412 self.launch_unity()
409413 greeter = self.main_window.get_greeter()
410414 greeter.swipe()
@@ -448,11 +452,10 @@ class EphemeralNotificationsTests(NotificationsBase):
448452 )
449453 notification_critical.show()
450454
451− get_notification = lambda: notify_list.select_single(
455+ get_notification = lambda: notify_list.wait_select_single(
452456 'Notification',
453457 summary=summary_critical
454458 )
455− self.assertThat(get_notification, Eventually(NotEquals(None)))
456459
457460 notification = get_notification()
458461 self._assert_notification(
@@ -464,11 +467,10 @@ class EphemeralNotificationsTests(NotificationsBase):
464467 1.0
465468 )
466469
467− get_normal_notification = lambda: notify_list.select_single(
470+ get_normal_notification = lambda: notify_list.wait_select_single(
468471 'Notification',
469472 summary=summary_normal
470473 )
471− self.assertThat(get_normal_notification, Eventually(NotEquals(None)))
472474 notification = get_normal_notification()
473475 self._assert_notification(
474476 notification,
@@ -479,11 +481,10 @@ class EphemeralNotificationsTests(NotificationsBase):
479481 1.0
480482 )
481483
482− get_low_notification = lambda: notify_list.select_single(
484+ get_low_notification = lambda: notify_list.wait_select_single(
483485 'Notification',
484486 summary=summary_low
485487 )
486− self.assertThat(get_low_notification, Eventually(NotEquals(None)))
487488 notification = get_low_notification()
488489 self._assert_notification(
489490 notification,
@@ -508,9 +509,8 @@ class EphemeralNotificationsTests(NotificationsBase):
508509 notification = self._create_ephemeral_notification(summary, body)
509510 notification.show()
510511
511− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
512− self.assertThat(get_notification, Eventually(NotEquals(None)))
513− notification = get_notification()
512+ notification = notify_list.wait_select_single(
513+ 'Notification', objectName='notification1')
514514 self._assert_notification(
515515 notification,
516516 summary,
@@ -533,14 +533,14 @@ class EphemeralNotificationsTests(NotificationsBase):
533533 notification = self._create_ephemeral_notification(summary)
534534 notification.show()
535535
536− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
537− self.assertThat(get_notification, Eventually(NotEquals(None)))
538− notification = get_notification()
536+ notification = notify_list.wait_select_single(
537+ 'Notification', objectName='notification1')
539538
540539 self._assert_notification(notification, summary, '', False, False, 1.0)
541540
542541 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
543+ displayed."""
544544 self.launch_unity()
545545 greeter = self.main_window.get_greeter()
546546 greeter.swipe()
@@ -558,8 +558,8 @@ class EphemeralNotificationsTests(NotificationsBase):
558558 )
559559 notification.show()
560560
561− get_notification = lambda: notify_list.select_single('Notification', summary=summary)
562− self.assertThat(get_notification, Eventually(NotEquals(None)))
561+ get_notification = lambda: notify_list.wait_select_single(
562+ 'Notification', summary=summary)
563563 self._assert_notification(
564564 get_notification(),
565565 summary,
@@ -575,11 +575,11 @@ class EphemeralNotificationsTests(NotificationsBase):
575575 icon_path = self._get_icon_path('avatars/amanda.png')
576576 notification.update(summary, body, icon_path)
577577 notification.show()
578− self.assertThat(get_notification, Eventually(NotEquals(None)))
579578 self._assert_notification(get_notification(), summary, body)
580579
581580 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
582+ being displayed."""
583583 self.launch_unity()
584584 greeter = self.main_window.get_greeter()
585585 greeter.swipe()
@@ -603,8 +603,8 @@ class EphemeralNotificationsTests(NotificationsBase):
603603 )
604604 notification.show()
605605
606− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
607− self.assertThat(get_notification, Eventually(NotEquals(None)))
606+ get_notification = lambda: notify_list.wait_select_single(
607+ 'Notification', objectName='notification1')
608608 self._assert_notification(
609609 get_notification(),
610610 summary,
@@ -645,8 +645,8 @@ class EphemeralNotificationsTests(NotificationsBase):
645645
646646 notification.show()
647647
648− get_notification = lambda: notify_list.select_single('Notification', objectName='notification1')
649− self.assertThat(get_notification, Eventually(NotEquals(None)))
648+ get_notification = lambda: notify_list.wait_select_single(
649+ 'Notification', objectName='notification1')
650650 notification = get_notification()
651651 self._assert_notification(
652652 notification,
@@ -662,7 +662,8 @@ class EphemeralNotificationsTests(NotificationsBase):
662662 'Did you watch the air-race in Oshkosh last week?',
663663 'Phil owned the place like no one before him!',
664664 '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.',
666667 'Hopefully the referees will watch the videos of the race.',
667668 'Burt could get fined with US$ 50000 for that rule-violation :)'
668669 ]
@@ -677,11 +678,10 @@ class EphemeralNotificationsTests(NotificationsBase):
677678 hints=[('x-canonical-append', 'true')]
678679 )
679680 notification.show()
680− get_notification = lambda: notify_list.select_single(
681+ get_notification = lambda: notify_list.wait_select_single(
681682 'Notification',
682683 objectName='notification1'
683684 )
684− self.assertThat(get_notification, Eventually(NotEquals(None)))
685685 notification = get_notification()
686686 self._assert_notification(
687687 notification,