Merge lp:~saviq/unity8/fix-qml-tests into lp:unity8

Proposed by Michał Sawicz
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1153
Merged at revision: 1155
Proposed branch: lp:~saviq/unity8/fix-qml-tests
Merge into: lp:unity8
Diff against target: 83 lines (+12/-10)
3 files modified
tests/mocks/Unity/fake_scopesoverview.cpp (+4/-2)
tests/qmltests/Dash/tst_Dash.qml (+7/-7)
tests/qmltests/Dash/tst_DashContent.qml (+1/-1)
To merge this branch: bzr merge lp:~saviq/unity8/fix-qml-tests
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michael Zanetti (community) Approve
Review via email: mp+230731@code.launchpad.net

Commit message

Fix qml tests - loader around PageHeader, more retries for selecting a scope and undefined attributes in mock overview scope.

Description of the change

 * 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. Test only changes, tests pass now.

 * 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.
lp:~saviq/unity8/fix-qml-tests updated
1152. By Michał Sawicz

Fix Dash test better.

1153. By Michał Sawicz

Simplify setCurrentScope test.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

yip yip. thanks

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yeah, passing now

 * Did CI run pass? If not, please explain why.

fingers crossed

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/mocks/Unity/fake_scopesoverview.cpp'
2--- tests/mocks/Unity/fake_scopesoverview.cpp 2014-08-07 08:52:59 +0000
3+++ tests/mocks/Unity/fake_scopesoverview.cpp 2014-08-13 23:50:19 +0000
4@@ -105,11 +105,12 @@
5 }
6 case RoleComponents:
7 {
8- QVariantMap map, artMap;
9+ QVariantMap map, artMap, attributesMap;
10 artMap["aspect-ratio"] = "0.5";
11 artMap["field"] = "art";
12 map["art"] = artMap;
13 map["title"] = "HOLA";
14+ map["attributes"] = attributesMap;
15 return map;
16 }
17 case RoleResults:
18@@ -188,11 +189,12 @@
19 }
20 case RoleComponents:
21 {
22- QVariantMap map, artMap;
23+ QVariantMap map, artMap, attributesMap;
24 artMap["aspect-ratio"] = "1";
25 artMap["field"] = "art";
26 map["art"] = artMap;
27 map["title"] = "HOLA";
28+ map["attributes"] = attributesMap;
29 return map;
30 }
31 case RoleResults:
32
33=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
34--- tests/qmltests/Dash/tst_Dash.qml 2014-08-07 09:20:38 +0000
35+++ tests/qmltests/Dash/tst_Dash.qml 2014-08-13 23:50:19 +0000
36@@ -54,6 +54,7 @@
37 tryCompare(dashContentList, "count", 0);
38 scopes.load();
39 tryCompare(dashContentList, "currentIndex", 0);
40+ tryCompare(dashContentList, "count", 6);
41 }
42
43 function get_scope_data() {
44@@ -273,6 +274,8 @@
45 // Click on a temp scope in the search
46 var dashCategorysearchA = findChild(searchResultsViewer, "dashCategorysearchA");
47 var cardTempScope = findChild(dashCategorysearchA, "delegate2");
48+ verify(cardTempScope, "Could not find delegate2");
49+
50 waitForRendering(cardTempScope);
51 mouseClick(cardTempScope, cardTempScope.width / 2, cardTempScope.height / 2);
52
53@@ -313,13 +316,10 @@
54 var startY = dash.height / 2;
55 var stopX = units.gu(1)
56 var stopY = startY;
57- var retry = 0;
58- while (dashContentList.currentIndex != 2 && retry <= 5) {
59- mouseFlick(dash, startX, startY, stopX, stopY)
60- waitForRendering(dashContentList)
61- retry++;
62- }
63- compare(dashContentList.currentIndex, 2);
64+ waitForRendering(dashContentList)
65+ mouseFlick(dash, startX, startY, stopX, stopY);
66+ mouseFlick(dash, startX, startY, stopX, stopY);
67+ compare(dashContentList.currentIndex, 2, "Could not flick to scope id 2");
68 var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
69 dashCommunicatorService.mockSetCurrentScope("clickscope", true, true);
70 tryCompare(dashContentList, "currentIndex", 1)
71
72=== modified file 'tests/qmltests/Dash/tst_DashContent.qml'
73--- tests/qmltests/Dash/tst_DashContent.qml 2014-08-07 15:33:01 +0000
74+++ tests/qmltests/Dash/tst_DashContent.qml 2014-08-13 23:50:19 +0000
75@@ -390,7 +390,7 @@
76 var categoryListView = findChild(scope, "categoryListView");
77 waitForRendering(categoryListView);
78
79- compare(categoryListView.pageHeader.searchHint, "Search People");
80+ compare(categoryListView.pageHeader.item.searchHint, "Search People");
81 }
82 }
83 }

Subscribers

People subscribed via source and target branches