on xenial help sign in
Fix various tests

test_navigationShowFilterButton is gone since it was testing a feature that no longer exists Approved by: Michael Zanetti

commit5cc4f024aa0861462319ecdf9bda5723248f820a authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 23 Mar 2016, 09:52 (11 years ago) parent5bc85fa1976e43
7 files changed+16−28
qml/Dash/DashPageHeader.qml+1 qml/Dash/Filters/FilterWidgetFactory.qml+1 tests/plugins/Dash/tst_ScopeStyle.qml+1−1 tests/qmltests/Dash/Filters/tst_FilterWidgetFactory.qml+2−1 tests/qmltests/Dash/tst_DashContent.qml+8−23 tests/qmltests/Dash/tst_GenericScopeView.qml+2−2 tests/qmltests/Dash/tst_PreviewView.qml+1−1
qml/Dash/DashPageHeader.qml+1
@@ -258,6 +258,7 @@ Item {
258258
259259 AbstractButton {
260260 id: settingsButton
261+ objectName: "settingsButton"
261262
262263 width: root.scopeHasFilters ? height : 0
263264 visible: width > 0
qml/Dash/Filters/FilterWidgetFactory.qml+1
@@ -53,6 +53,7 @@ Item {
5353
5454 Loader {
5555 id: loader
56+ objectName: "loader"
5657
5758 anchors {
5859 top: title.bottom
tests/plugins/Dash/tst_ScopeStyle.qml+1−1
@@ -137,7 +137,7 @@ Rectangle {
137137
138138 function test_headerBackground_data() {
139139 return [
140− { tag: "default", index: 0, headerBackground: "color:///#f5f5f5" },
140+ { tag: "default", index: 0, headerBackground: "color:///#ffffff" },
141141 { tag: "black", index: 3, headerBackground: "gradient:///white/blue" },
142142 ];
143143 }
tests/qmltests/Dash/Filters/tst_FilterWidgetFactory.qml+2−1
@@ -51,7 +51,8 @@ Rectangle {
5151 factory.widgetData = {};
5252 factory.widgetType = data.type;
5353
54− verify((String(factory.source)).indexOf(data.source) != -1);
54+ var loader = findChild(factory, "loader");
55+ verify((String(loader.source)).indexOf(data.source) != -1);
5556 }
5657 }
5758}
tests/qmltests/Dash/tst_DashContent.qml+8−23
@@ -215,7 +215,7 @@ Item {
215215 verify(pageHeader, "Could not find the scope page header.");
216216 var innerHeader = findChild(pageHeader, "innerPageHeader");
217217 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);
219219 }
220220
221221 function test_is_active_data() {
@@ -285,11 +285,12 @@ Item {
285285 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
286286 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
287287 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
288− var searchButton = findChild(dashContentList.currentItem, "search_action_button");
288+ var searchButton = findChild(dashContentList.currentItem, "search_button");
289289 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
290290 compare(peExtraPanel.visible, false);
291291 mouseClick(searchButton);
292292 tryCompare(peExtraPanel, "visible", true);
293+ peExtraPanel.searchHistory.clear();
293294
294295 var navigationListView = findChild(dashNavigation, "navigationListView");
295296 tryCompareFunction(function() {
@@ -405,7 +406,7 @@ Item {
405406 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
406407 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
407408 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
408− var searchButton = findChild(dashContentList.currentItem, "search_action_button");
409+ var searchButton = findChild(dashContentList.currentItem, "search_button");
409410 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
410411 compare(peExtraPanel.visible, false);
411412 mouseClick(searchButton);
@@ -497,7 +498,7 @@ Item {
497498
498499 function test_clearSearchWithNavigationClosed() {
499500 var dashContentList = findChild(dashContent, "dashContentList");
500− var searchButton = findChild(dashContentList.currentItem, "search_action_button");
501+ var searchButton = findChild(dashContentList.currentItem, "search_button");
501502 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
502503 var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
503504
@@ -513,32 +514,16 @@ Item {
513514 tryCompare(peExtraPanel, "visible", true);
514515 }
515516
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−
531517 function test_navigationShowFilterPopup() {
532518 goToSecondLevel();
533519
534520 var dashContentList = findChild(dashContent, "dashContentList");
535− var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
536− var clearIcon = findChild(searchTextField, "clearIcon");
521+ var settingsButton = findChild(dashContentList.currentItem, "settingsButton");
537522
538523 var filtersPopover = findChild(shell, "filtersPopover")
539524 verify(!filtersPopover);
540525
541− mouseClick(clearIcon);
526+ mouseClick(settingsButton);
542527
543528 filtersPopover = findChild(shell, "filtersPopover")
544529
@@ -550,7 +535,7 @@ Item {
550535 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
551536 dashContentList.currentItem.item.scope.setHasNavigation(false);
552537 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
553− var searchButton = findChild(dashContentList.currentItem, "search_action_button");
538+ var searchButton = findChild(dashContentList.currentItem, "search_button");
554539
555540 compare(peExtraPanel.visible, false);
556541 mouseClick(searchButton);
tests/qmltests/Dash/tst_GenericScopeView.qml+2−2
@@ -428,8 +428,8 @@ Item {
428428
429429 function test_header_style_data() {
430430 return [
431− { tag: "Default", index: 0, foreground: UbuntuColors.darkGrey, background: "color:///#f5f5f5", logo: "" },
432− { tag: "Foreground", index: 1, foreground: "yellow", 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:///#ffffff", logo: "" },
433433 { tag: "Logo+Background", index: 2, foreground: UbuntuColors.darkGrey, background: "gradient:///lightgrey/grey",
434434 logo: Qt.resolvedUrl("../Dash/tst_PageHeader/logo-ubuntu-orange.svg") },
435435 ];
tests/qmltests/Dash/tst_PreviewView.qml+1−1
@@ -98,7 +98,7 @@ Rectangle {
9898 var header = findChild(view, "innerPageHeader");
9999 verify(header, "Could not find the preview header");
100100
101− compare(header.config.contents.text, "Mock Scope");
101+ compare(header.config.title, "Mock Scope");
102102 }
103103
104104 function test_header_style() {