on xenial help sign in
Start adapting the notification autopilot test for snap-decisions with ComboButton.
a757687Mirco Müller
tests/autopilot/unity8/shell/tests/test_notifications.py+9−13
@@ -178,11 +178,13 @@ class InteractiveNotificationBase(NotificationsBase):
178 ]
178 ]
179
179
180 actions = [
180 actions = [
181− ('action_accept', 'Accept'),
181+ ('action_accept', 'Hold + Answer'),
182− ('action_decline_1', 'Decline'),
182+ ('action_decline_1', 'End + Answer'),
183− ('action_decline_2', '"Can\'t talk now, what\'s up?"'),
183+ ('action_decline_2', 'Decline'),
184− ('action_decline_3', '"I call you back."'),
184+ ('action_decline_3', 'messages:I missed your call - can you call me now?'),
185− ('action_decline_4', 'Send custom message...'),
185+ ('action_decline_4', 'messages:I\'m running late. I\'m on my way.'),
186+ ('action_decline_5', 'messages:I\'m busy at the moment. I\'ll call later.'),
187+ ('action_decline_6', 'edit:Custom'),
186 ]
188 ]
187
189
188 self._create_interactive_notification(
190 self._create_interactive_notification(
@@ -200,14 +202,8 @@ class InteractiveNotificationBase(NotificationsBase):
200 notification = get_notification()
202 notification = get_notification()
201 self._assert_notification(notification, summary, body, True, True, 1.0)
203 self._assert_notification(notification, summary, body, True, True, 1.0)
202 initial_height = notification.height
204 initial_height = notification.height
203− self.touch.tap_object(notification.select_single(objectName="button1"))
205+ self.touch.tap_object(notification.select_single(objectName="combobutton_dropdown"))
204− self.assertThat(
206+ self.assertThat(notification.select_single(objectName="button2").expanded, Eventually(Equals(True)))
205− notification.height,
206− Eventually(Equals(initial_height +
207− 3 * notification.select_single(
208− objectName="buttonColumn").spacing +
209− 3 * notification.select_single(
210− objectName="button4").height)))
211 self.touch.tap_object(notification.select_single(objectName="button4"))
207 self.touch.tap_object(notification.select_single(objectName="button4"))
212 self.assert_notification_action_id_was_called("action_decline_4")
208 self.assert_notification_action_id_was_called("action_decline_4")
213
209