Merge lp:~aacid/unity8/testNotificationsMoreStable into lp:unity8

Proposed by Albert Astals Cid on 2015-02-13
Status: Merged
Approved by: Mirco Müller on 2015-02-13
Approved revision: 1613
Merged at revision: 1616
Proposed branch: lp:~aacid/unity8/testNotificationsMoreStable
Merge into: lp:unity8
Diff against target: 25 lines (+8/-0)
1 file modified
tests/qmltests/Notifications/tst_Notifications.qml (+8/-0)
To merge this branch: bzr merge lp:~aacid/unity8/testNotificationsMoreStable
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-02-13
Mirco Müller (community) 2015-02-13 Approve on 2015-02-13
Review via email: mp+249625@code.launchpad.net

Commit Message

Make sure the height it's the height it will have

Otherwise it can happen that we go to the next test and height is still growing and then we try to flick/click on things that are no longer where we thought they were

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
No, test change only

 * 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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/qmltests/Notifications/tst_Notifications.qml'
2--- tests/qmltests/Notifications/tst_Notifications.qml 2015-02-06 15:15:37 +0000
3+++ tests/qmltests/Notifications/tst_Notifications.qml 2015-02-13 11:40:27 +0000
4@@ -563,6 +563,7 @@
5 verify(notification !== undefined, "notification wasn't found");
6
7 waitForRendering(notification);
8+ tryCompare(notification, "height", notification.state === "contracted" ? units.gu(10) : notification.implicitHeight);
9
10 var icon = findChild(notification, "icon")
11 var centeredIcon = findChild(notification, "centeredIcon")
12@@ -602,6 +603,13 @@
13 compare(bodyLabel.visible, data.bodyVisible, "body-text visibility is incorrect")
14 compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
15
16+ // After clicking the state of notifications can change so let's wait
17+ // for their height animations to finish before continuing
18+ for (var i = 0; i < mockModel.count; ++i) {
19+ var n = findChild(notifications, "notification" + i)
20+ tryCompare(n, "height", n.state === "contracted" ? units.gu(10) : n.implicitHeight);
21+ }
22+
23 if (data.hasSound) {
24 var audioItem = findInvisibleChild(notification, "sound")
25 compare(audioItem.playbackState, data.hasSound ? Audio.PlayingState : Audio.StoppedState, "Audio has wrong state")

Subscribers

People subscribed via source and target branches