on xenial help sign in
Fix various tests
5cc4f02Albert Astals Cid
qml/Dash/DashPageHeader.qml+1
@@ -258,6 +258,7 @@ Item {
258
258
259 AbstractButton {
259 AbstractButton {
260 id: settingsButton
260 id: settingsButton
261+ objectName: "settingsButton"
261
262
262 width: root.scopeHasFilters ? height : 0
263 width: root.scopeHasFilters ? height : 0
263 visible: width > 0
264 visible: width > 0
qml/Dash/Filters/FilterWidgetFactory.qml+1
@@ -53,6 +53,7 @@ Item {
53
53
54 Loader {
54 Loader {
55 id: loader
55 id: loader
56+ objectName: "loader"
56
57
57 anchors {
58 anchors {
58 top: title.bottom
59 top: title.bottom
tests/plugins/Dash/tst_ScopeStyle.qml+1−1
@@ -137,7 +137,7 @@ Rectangle {
137
137
138 function test_headerBackground_data() {
138 function test_headerBackground_data() {
139 return [
139 return [
140− { tag: "default", index: 0, headerBackground: "color:///#f5f5f5" },
140+ { tag: "default", index: 0, headerBackground: "color:///#ffffff" },
141 { tag: "black", index: 3, headerBackground: "gradient:///white/blue" },
141 { tag: "black", index: 3, headerBackground: "gradient:///white/blue" },
142 ];
142 ];
143 }
143 }
tests/qmltests/Dash/Filters/tst_FilterWidgetFactory.qml+2−1
@@ -51,7 +51,8 @@ Rectangle {
51 factory.widgetData = {};
51 factory.widgetData = {};
52 factory.widgetType = data.type;
52 factory.widgetType = data.type;
53
53
54+ var loader = findChild(factory, "loader");
54− verify((String(factory.source)).indexOf(data.source) != -1);
55+ verify((String(loader.source)).indexOf(data.source) != -1);
55 }
56 }
56 }
57 }
57}
58}
tests/qmltests/Dash/tst_DashContent.qml+8−23
@@ -215,7 +215,7 @@ Item {
215 verify(pageHeader, "Could not find the scope page header.");
215 verify(pageHeader, "Could not find the scope page header.");
216 var innerHeader = findChild(pageHeader, "innerPageHeader");
216 var innerHeader = findChild(pageHeader, "innerPageHeader");
217 verify(innerHeader, "Could not find the scope page header.");
217 verify(innerHeader, "Could not find the scope page header.");
218− compare(innerHeader.config.contents.text, scopesModel.getScope(data.index).name);
218+ compare(innerHeader.config.title, scopesModel.getScope(data.index).name);
219 }
219 }
220
220
221 function test_is_active_data() {
221 function test_is_active_data() {
@@ -285,11 +285,12 @@ Item {
285 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
285 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
286 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
286 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
287 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
287 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
288− var searchButton = findChild(dashContentList.currentItem, "search_action_button");
288+ var searchButton = findChild(dashContentList.currentItem, "search_button");
289 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
289 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
290 compare(peExtraPanel.visible, false);
290 compare(peExtraPanel.visible, false);
291 mouseClick(searchButton);
291 mouseClick(searchButton);
292 tryCompare(peExtraPanel, "visible", true);
292 tryCompare(peExtraPanel, "visible", true);
293+ peExtraPanel.searchHistory.clear();
293
294
294 var navigationListView = findChild(dashNavigation, "navigationListView");
295 var navigationListView = findChild(dashNavigation, "navigationListView");
295 tryCompareFunction(function() {
296 tryCompareFunction(function() {
@@ -405,7 +406,7 @@ Item {
405 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
406 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
406 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
407 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
407 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
408 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
408− var searchButton = findChild(dashContentList.currentItem, "search_action_button");
409+ var searchButton = findChild(dashContentList.currentItem, "search_button");
409 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
410 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
410 compare(peExtraPanel.visible, false);
411 compare(peExtraPanel.visible, false);
411 mouseClick(searchButton);
412 mouseClick(searchButton);
@@ -497,7 +498,7 @@ Item {
497
498
498 function test_clearSearchWithNavigationClosed() {
499 function test_clearSearchWithNavigationClosed() {
499 var dashContentList = findChild(dashContent, "dashContentList");
500 var dashContentList = findChild(dashContent, "dashContentList");
500− var searchButton = findChild(dashContentList.currentItem, "search_action_button");
501+ var searchButton = findChild(dashContentList.currentItem, "search_button");
501 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
502 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
502 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
503 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
503
504
@@ -513,32 +514,16 @@ Item {
513 tryCompare(peExtraPanel, "visible", true);
514 tryCompare(peExtraPanel, "visible", true);
514 }
515 }
515
516
516− function test_navigationShowFilterButton() {
517− goToSecondLevel();
518−
519− var dashContentList = findChild(dashContent, "dashContentList");
520− var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
521−
522− verify(!searchTextField.focus)
523− verify(searchTextField.clearIsSettings)
524−
525− mouseClick(searchTextField)
526−
527− verify(searchTextField.focus)
528− verify(!searchTextField.clearIsSettings)
529− }
530−
531 function test_navigationShowFilterPopup() {
517 function test_navigationShowFilterPopup() {
532 goToSecondLevel();
518 goToSecondLevel();
533
519
534 var dashContentList = findChild(dashContent, "dashContentList");
520 var dashContentList = findChild(dashContent, "dashContentList");
535− var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
521+ var settingsButton = findChild(dashContentList.currentItem, "settingsButton");
536− var clearIcon = findChild(searchTextField, "clearIcon");
537
522
538 var filtersPopover = findChild(shell, "filtersPopover")
523 var filtersPopover = findChild(shell, "filtersPopover")
539 verify(!filtersPopover);
524 verify(!filtersPopover);
540
525
541− mouseClick(clearIcon);
526+ mouseClick(settingsButton);
542
527
543 filtersPopover = findChild(shell, "filtersPopover")
528 filtersPopover = findChild(shell, "filtersPopover")
544
529
@@ -550,7 +535,7 @@ Item {
550 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
535 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
551 dashContentList.currentItem.item.scope.setHasNavigation(false);
536 dashContentList.currentItem.item.scope.setHasNavigation(false);
552 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
537 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
553− var searchButton = findChild(dashContentList.currentItem, "search_action_button");
538+ var searchButton = findChild(dashContentList.currentItem, "search_button");
554
539
555 compare(peExtraPanel.visible, false);
540 compare(peExtraPanel.visible, false);
556 mouseClick(searchButton);
541 mouseClick(searchButton);
tests/qmltests/Dash/tst_GenericScopeView.qml+2−2
@@ -428,8 +428,8 @@ Item {
428
428
429 function test_header_style_data() {
429 function test_header_style_data() {
430 return [
430 return [
431− { tag: "Default", index: 0, foreground: UbuntuColors.darkGrey, background: "color:///#f5f5f5", logo: "" },
431+ { tag: "Default", index: 0, foreground: UbuntuColors.darkGrey, background: "color:///#ffffff", logo: "" },
432− { tag: "Foreground", index: 1, foreground: "yellow", background: "color:///#f5f5f5", logo: "" },
432+ { tag: "Foreground", index: 1, foreground: "yellow", background: "color:///#ffffff", logo: "" },
433 { tag: "Logo+Background", index: 2, foreground: UbuntuColors.darkGrey, background: "gradient:///lightgrey/grey",
433 { tag: "Logo+Background", index: 2, foreground: UbuntuColors.darkGrey, background: "gradient:///lightgrey/grey",
434 logo: Qt.resolvedUrl("../Dash/tst_PageHeader/logo-ubuntu-orange.svg") },
434 logo: Qt.resolvedUrl("../Dash/tst_PageHeader/logo-ubuntu-orange.svg") },
435 ];
435 ];
tests/qmltests/Dash/tst_PreviewView.qml+1−1
@@ -98,7 +98,7 @@ Rectangle {
98 var header = findChild(view, "innerPageHeader");
98 var header = findChild(view, "innerPageHeader");
99 verify(header, "Could not find the preview header");
99 verify(header, "Could not find the preview header");
100
100
101− compare(header.config.contents.text, "Mock Scope");
101+ compare(header.config.title, "Mock Scope");
102 }
102 }
103
103
104 function test_header_style() {
104 function test_header_style() {