Merge lp:~paulliu/unity8/notification_helper into lp:unity8

Proposed by Ying-Chun Liu
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1597
Merged at revision: 1624
Proposed branch: lp:~paulliu/unity8/notification_helper
Merge into: lp:unity8
Diff against target: 63 lines (+37/-0)
3 files modified
tests/autopilot/unity8/shell/__init__.py (+1/-0)
tests/autopilot/unity8/shell/emulators/main_window.py (+17/-0)
tests/autopilot/unity8/shell/tests/test_notifications.py (+19/-0)
To merge this branch: bzr merge lp:~paulliu/unity8/notification_helper
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
Allan LeSage (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Leo Arias (community) Approve
Review via email: mp+249211@code.launchpad.net

Commit message

Add Autopilot Notification helper.

Description of the change

Implement helper based on
http://people.canonical.com/~thomir/ueqa-code-proposals/proposals/indicator-power/index.html

 * Are there any related MPs required for this MP to build/function as expected? Please list.
no
 * Did you perform an exploratory manual test run of your code change and any related functionality?
yes
 * Did you make sure that your branch does not contain spurious tags?
yes
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1595. By Ying-Chun Liu

fix whitespace

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

There is tags that don't belong here, please fix

0.1+14.04.20140221-0ubuntu1 ?
0.1+14.04.20140306-0ubuntu1 ?
0.1+14.10.20140502-0ubuntu1 ?
0.2+14.10.20140701.2-0ubuntu1 ?
0.3+14.10.20140708-0ubuntu1 ?
0.4+14.10.20140918-0ubuntu1 ?
0.4+14.10.20140926-0ubuntu1 ?
0.4+15.04.20141104-0ubuntu1 ?
0.4+15.04.20141105-0ubuntu1 ?

review: Needs Fixing
Revision history for this message
Allan LeSage (allanlesage) wrote :

Some comments inline, let's get Leo's feedback too. . . .

review: Needs Fixing
Revision history for this message
Leo Arias (elopio) :
review: Needs Fixing
1596. By Ying-Chun Liu

Move to main_window.
Update test_notifications.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Tags are gone, I'll leave the review up to Leo and Allan

review: Abstain
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

Some minor pita style complaints.
This is good, thanks Paul!

review: Needs Fixing
1597. By Ying-Chun Liu

Fix minor issues.

Revision history for this message
Leo Arias (elopio) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Allan LeSage (allanlesage) wrote :

This is great, much cleaner, well done.

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
No, it's a test change only and the users of the test code are happy :)

 * Did CI run pass?
No, known broken stuff

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/unity8/shell/__init__.py'
--- tests/autopilot/unity8/shell/__init__.py 2015-01-21 13:50:14 +0000
+++ tests/autopilot/unity8/shell/__init__.py 2015-02-17 15:42:02 +0000
@@ -27,6 +27,7 @@
2727
28logger = logging.getLogger(__name__)28logger = logging.getLogger(__name__)
2929
30
30def disable_qml_mocking(fn):31def disable_qml_mocking(fn):
31 """Simple decorator that disables the QML mocks from being loaded."""32 """Simple decorator that disables the QML mocks from being loaded."""
32 @wraps(fn)33 @wraps(fn)
3334
=== modified file 'tests/autopilot/unity8/shell/emulators/main_window.py'
--- tests/autopilot/unity8/shell/emulators/main_window.py 2015-01-21 04:11:36 +0000
+++ tests/autopilot/unity8/shell/emulators/main_window.py 2015-02-17 15:42:02 +0000
@@ -174,3 +174,20 @@
174 'PinPadButton',174 'PinPadButton',
175 objectName='pinPadButton{}'.format(button_id)175 objectName='pinPadButton{}'.format(button_id)
176 )176 )
177
178 @autopilot_logging.log_action(logger.info)
179 def wait_for_notification(self):
180 """Wait for a notification dialog to appear.
181
182 :return: An object for the notification dialog data.
183 :raise StateNotFoundError: if the timeout expires when the
184 notification has not appeared.
185
186 """
187 notify_list = self.select_single('Notifications',
188 objectName='notificationList')
189 visible_notification = notify_list.wait_select_single('Notification',
190 visible=True)
191 return {'summary': visible_notification.summary,
192 'body': visible_notification.body,
193 'iconSource': visible_notification.iconSource}
177194
=== modified file 'tests/autopilot/unity8/shell/tests/test_notifications.py'
--- tests/autopilot/unity8/shell/tests/test_notifications.py 2014-10-31 10:08:38 +0000
+++ tests/autopilot/unity8/shell/tests/test_notifications.py 2015-02-17 15:42:02 +0000
@@ -701,3 +701,22 @@
701 self.assertThat(get_notification, Eventually(NotEquals(None)))701 self.assertThat(get_notification, Eventually(NotEquals(None)))
702 self._assert_notification(702 self._assert_notification(
703 get_notification(), summary, body, False, False, 1.0)703 get_notification(), summary, body, False, False, 1.0)
704
705 def test_notification_helper(self):
706 """ use the create notification script to get a notification dialog.
707 Check that the arguments passed to the script match the fields. """
708
709 unity_proxy = self.launch_unity()
710 unlock_unity(unity_proxy)
711
712 summary = 'Helper summary'
713 body = 'Helper body'
714
715 notification = shell.create_ephemeral_notification(summary, body)
716 notification.show()
717
718 notification_data = self.main_window.wait_for_notification()
719
720 self.assertThat(notification_data['summary'],
721 Eventually(Equals(summary)))
722 self.assertThat(notification_data['body'], Eventually(Equals(body)))

Subscribers

People subscribed via source and target branches