@@ -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.title, scopesModel.getScope(data.index).name);
218+ compare(innerHeader.config.contents.text, scopesModel.getScope(data.index).name);
219219 }
220220
221221 function test_is_active_data() {
@@ -284,14 +284,14 @@ Item {
284284 var dashContentList = findChild(dashContent, "dashContentList");
285285 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
286286 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
287− tryCompare(dashNavigation, "visible", true);
288− var dashNavigationButton = findChild(dashContentList.currentItem, "navigationButton");
289− compare(dashNavigationButton.showList, false);
290− waitForRendering(dashNavigationButton);
291− mouseClick(dashNavigationButton);
292− compare(dashNavigationButton.showList, true);
293−
294− var navigationListView = findChild(dashNavigationButton, "navigationListView");
287+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
288+ var searchButton = findChild(dashContentList.currentItem, "search_action_button");
289+ var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
290+ compare(peExtraPanel.visible, false);
291+ mouseClick(searchButton);
292+ tryCompare(peExtraPanel, "visible", true);
293+
294+ var navigationListView = findChild(dashNavigation, "navigationListView");
295295 tryCompareFunction(function() {
296296 return navigationListView.currentItem &&
297297 navigationListView.currentItem.navigation &&
@@ -300,235 +300,263 @@ Item {
300300 waitForRendering(navigationListView);
301301 waitForRendering(navigationListView.currentItem);
302302
303− var allButton = findChild(dashNavigationButton, "allButton");
304− compare(allButton.visible, false);
305−
306− var navigation = findChild(dashNavigationButton, "navigation0child3");
303+ var navigation = findChild(dashNavigation, "navigation0child3");
307304 mouseClick(navigation);
308− compare(dashNavigationButton.showList, false);
309− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle3");
305+ compare(peExtraPanel.visible, false);
306+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle3");
310307 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
311308
312− mouseClick(dashNavigationButton);
313− compare(dashNavigationButton.showList, true);
309+ mouseClick(searchTextField);
310+ tryCompare(peExtraPanel, "visible", true);
314311 waitForRendering(navigationListView);
315312 waitForRendering(navigationListView.currentItem);
316− compare(allButton.visible, true);
317313
318− mouseClick(allButton);
319− compare(dashNavigationButton.showList, false);
320− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
314+ var header0 = findChild(dashNavigation, "dashNavigationHeader0");
315+ compare(header0.backVisible, false);
316+ mouseClick(header0);
317+ compare(peExtraPanel.visible, false);
318+ tryCompare(dashNavigation.currentNavigation, "navigationId", "root");
321319 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
322320
323− mouseClick(dashNavigationButton);
324− compare(dashNavigationButton.showList, true);
321+ var headerContainer = findChild(dashContentList.currentItem, "headerContainer");
322+ tryCompare(headerContainer, "contentY", headerContainer.height);
323+ mouseClick(searchButton);
324+ tryCompare(peExtraPanel, "visible", true);
325325 waitForRendering(navigationListView);
326326 waitForRendering(navigationListView.currentItem);
327− compare(allButton.visible, false);
328327
329− navigation = findChild(dashNavigationButton, "navigation0child2");
328+ navigation = findChild(dashNavigation, "navigation0child2");
330329 mouseClick(navigation);
331− compare(dashNavigationButton.showList, true);
332− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
330+ compare(peExtraPanel.visible, true);
331+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
333332 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
334333
335− var navigationList1 = findChild(dashNavigationButton, "navigation1");
336− allButton = findChild(navigationList1, "allButton");
337− var backButton = findChild(findChild(navigationList1, "navigation1"), "backButton");
338− compare(allButton.visible, true);
339− compare(backButton.visible, true);
334+ var navigationList1 = findChild(dashNavigation, "navigation1");
335+ var header1 = findChild(dashNavigation, "dashNavigationHeader1");
336+ compare(header0.height, 0);
337+ compare(header1.backVisible, true);
340338
341339 tryCompare(navigationListView, "contentX", navigationList1.x);
342340 waitForRendering(navigationListView);
343− mouseClick(allButton);
344− compare(dashNavigationButton.showList, false);
345− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
341+ mouseClick(header1);
342+ compare(peExtraPanel.visible, false);
343+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
346344 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
347345
348− mouseClick(dashNavigationButton);
349− compare(dashNavigationButton.showList, true);
346+ mouseClick(searchTextField);
347+ tryCompare(peExtraPanel, "visible", true);
350348 waitForRendering(navigationListView);
351349 waitForRendering(navigationListView.currentItem);
352− compare(allButton.visible, true);
353− compare(backButton.visible, true);
350+ compare(header0.height, 0);
351+ compare(header1.backVisible, true);
354352
355353 tryCompare(navigationList1.navigation, "loaded", true);
356− tryCompare(navigationList1, "implicitHeight", navigationList1.itemHeight * 10);
354+ tryCompare(navigationList1, "implicitHeight", navigationList1.itemHeight * 8);
357355 tryCompare(navigationList1, "height", navigationList1.implicitHeight);
358− navigation = findChild(dashNavigationButton, "navigation1child2");
356+ navigation = findChild(dashNavigation, "navigation1child2");
359357 mouseClick(navigation);
360− compare(dashNavigationButton.showList, false);
361− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle22");
358+ compare(peExtraPanel.visible, false);
359+ tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle22");
362360 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
363361
364− mouseClick(dashNavigationButton);
365− compare(dashNavigationButton.showList, true);
362+ mouseClick(searchTextField);
363+ tryCompare(peExtraPanel, "visible", true);
366364 waitForRendering(navigationListView);
367365 waitForRendering(navigationListView.currentItem);
368366
369367 tryCompare(navigationList1.navigation, "loaded", true);
370− navigation = findChild(dashNavigationButton, "navigation1child3");
368+ navigation = findChild(dashNavigation, "navigation1child3");
371369 mouseClick(navigation);
372− compare(dashNavigationButton.showList, false);
373− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "childmiddle23");
370+ compare(peExtraPanel.visible, false);
371+ tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle23");
374372 tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle2");
375373
376− mouseClick(dashNavigationButton);
377− compare(dashNavigationButton.showList, true);
374+ mouseClick(searchTextField);
375+ tryCompare(peExtraPanel, "visible", true);
378376 waitForRendering(navigationListView);
379377 waitForRendering(navigationListView.currentItem);
380− mouseClick(backButton);
378+ mouseClick(findChild(header1, "backButton"));
381379
382− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "root");
380+ tryCompare(dashNavigation.currentNavigation, "navigationId", "root");
383381 tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
384− compare(dashNavigationButton.showList, true);
385− mouseClick(dashNavigationButton);
386− compare(dashNavigationButton.showList, false);
382+ compare(peExtraPanel.visible, true);
383+ mouseClick(header0);
384+ compare(peExtraPanel.visible, false);
387385
388− mouseClick(dashNavigationButton);
389− compare(dashNavigationButton.showList, true);
386+ tryCompare(headerContainer, "contentY", headerContainer.height);
387+ mouseClick(searchButton);
388+ tryCompare(peExtraPanel, "visible", true);
390389 tryCompare(navigationListView.currentItem.navigation, "loaded", true);
391− var navigationList0 = findChild(dashNavigationButton, "navigation0");
390+ var navigationList0 = findChild(dashNavigation, "navigation0");
392391 tryCompare(navigationList0, "implicitHeight", navigationList0.itemHeight * 8);
393392 tryCompare(navigationList0, "height", navigationList0.implicitHeight);
394− navigation = findChild(dashNavigationButton, "navigation0child2");
393+ navigation = findChild(dashNavigation, "navigation0child2");
395394 mouseClick(navigation);
396− compare(dashNavigationButton.showList, true);
397− navigationList1 = findChild(dashNavigationButton, "navigation1");
395+ compare(peExtraPanel.visible, true);
396+ navigationList1 = findChild(dashNavigation, "navigation1");
398397 compare(navigationList1.navigation.loaded, false);
399− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
400− allButton = findChild(navigationList1, "allButton");
401− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
402− mouseClick(allButton);
403− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "middle2");
398+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
399+ mouseClick(header0);
400+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle2");
404401 }
405402
406− function test_altNavigation() {
403+ function goToSecondLevel() {
407404 var dashContentList = findChild(dashContent, "dashContentList");
408405 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
409406 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
410− tryCompare(dashNavigation, "visible", true);
411− var dashNavigationButton = findChild(dashContentList.currentItem, "altNavigationButton");
412− verify(dashNavigationButton, "Can't find navigation button");
413−
414− compare(dashNavigationButton.showList, false);
415− waitForRendering(dashNavigationButton);
416− mouseClick(dashNavigationButton);
417− compare(dashNavigationButton.showList, true);
418−
419− var navigationListView = findChild(dashNavigationButton, "navigationListView");
407+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
408+ var searchButton = findChild(dashContentList.currentItem, "search_action_button");
409+ var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
410+ compare(peExtraPanel.visible, false);
411+ mouseClick(searchButton);
412+ tryCompare(peExtraPanel, "visible", true);
413+
414+ var navigationListView = findChild(dashNavigation, "navigationListView");
420415 tryCompareFunction(function() {
421416 return navigationListView.currentItem &&
422417 navigationListView.currentItem.navigation &&
423418 navigationListView.currentItem.navigation.loaded; }, true);
424−
425419 waitForRendering(navigationListView);
426420 waitForRendering(navigationListView.currentItem);
427421
428− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild1");
429− tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
430−
431− var allButton = findChild(dashNavigationButton, "allButton");
432− compare(allButton.visible, false);
433− var backButton = findChild(navigationListView, "backButton");
434− compare(backButton.visible, false);
422+ var navigation4 = findChild(dashNavigation, "navigation0child4");
423+ mouseClick(navigation4);
424+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle4");
425+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle4");
426+ tryCompare(dashNavigation.currentNavigation, "loaded", true);
435427
436− var navigation = findChild(dashNavigationButton, "navigation0child3");
437− mouseClick(navigation);
438− compare(dashNavigationButton.showList, false);
439− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild3");
440− tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
441−
442− mouseClick(dashNavigationButton);
443− compare(dashNavigationButton.showList, true);
444428 waitForRendering(navigationListView);
445429 waitForRendering(navigationListView.currentItem);
446− compare(allButton.visible, false);
447430
448− navigation = findChild(dashNavigationButton, "navigation0child2");
449− mouseClick(navigation);
450− compare(dashNavigationButton.showList, false);
451− tryCompare(dashNavigationButton.currentNavigation, "navigationId", "altrootChild2");
452− tryCompare(navigationListView.currentItem.navigation, "navigationId", "altroot");
431+ var navigation44 = findChild(dashNavigation, "navigation1child4");
432+ mouseClick(navigation44);
433+ tryCompare(dashNavigation.currentNavigation, "navigationId", "childmiddle44");
434+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "childmiddle44");
435+ tryCompare(dashNavigation.currentNavigation, "loaded", true);
453436
454− mouseClick(dashNavigationButton);
455− compare(dashNavigationButton.showList, true);
456437 waitForRendering(navigationListView);
457438 waitForRendering(navigationListView.currentItem);
458− verify(!backButton.visible, "Back button should not be visible");
459439
460− compare(navigationListView.count, 1, "There should be no second-level navigation");
440+ // header 0 is hidden
441+ var header0 = findChild(dashNavigation, "dashNavigationHeader0");
442+ compare(header0.height, 0);
443+ }
444+
445+ function test_navigationSecondLevelToRoot() {
446+ goToSecondLevel();
447+
448+ var dashContentList = findChild(dashContent, "dashContentList");
449+ var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
450+ var navigationListView = findChild(dashNavigation, "navigationListView");
451+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
452+
453+ // Go directly to the root pressing the back button of header1
454+ var header1 = findChild(dashNavigation, "dashNavigationHeader1");
455+ compare(header1.backVisible, true);
456+ mouseClick(findChild(header1, "backButton"));
461457
462− mouseClick(dashNavigationButton);
463− compare(dashNavigationButton.showList, false);
458+ tryCompare(dashNavigation.currentNavigation, "navigationId", "root");
459+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "root");
460+ compare(peExtraPanel.visible, true);
464461 }
465462
466− function test_navigationsClosing() {
463+ function test_navigationSecondLevelToFirstName() {
464+ goToSecondLevel();
465+
467466 var dashContentList = findChild(dashContent, "dashContentList");
468− tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
469467 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
470− tryCompare(dashNavigation, "visible", true);
471− var dashNavigationButton = findChild(dashContentList.currentItem, "navigationButton");
472− verify(dashNavigationButton, "Can't find navigation button");
473− var dashAltNavigationButton = findChild(dashContentList.currentItem, "altNavigationButton");
474− verify(dashAltNavigationButton, "Can't find alternative navigation button");
468+ var navigationListView = findChild(dashNavigation, "navigationListView");
469+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
475470
476− waitForRendering(dashNavigationButton);
477− waitForRendering(dashAltNavigationButton);
471+ // Go directly to the first pressing the header1
472+ var header1 = findChild(dashNavigation, "dashNavigationHeader1");
473+ mouseClick(header1);
478474
479− compare(dashNavigationButton.showList, false);
480− compare(dashAltNavigationButton.showList, false);
475+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle4");
476+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle4");
477+ compare(peExtraPanel.visible, false);
478+ }
481479
482− mouseClick(dashAltNavigationButton);
483− compare(dashNavigationButton.showList, false);
484− compare(dashAltNavigationButton.showList, true);
480+ function test_navigationSecondLevelToFirstBack() {
481+ goToSecondLevel();
485482
486− var navigationListView = findChild(dashAltNavigationButton, "navigationListView");
487− tryCompareFunction(function() {
488− return navigationListView.currentItem &&
489− navigationListView.currentItem.navigation &&
490− navigationListView.currentItem.navigation.loaded; }, true);
483+ var dashContentList = findChild(dashContent, "dashContentList");
484+ var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
485+ var navigationListView = findChild(dashNavigation, "navigationListView");
486+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
491487
492− var blackRect = findChild(dashNavigation, "blackRect");
493− tryCompare(blackRect, "opacity", 0.5);
488+ // Go back to the first level pressing the back button of header2
489+ var header2 = findChild(dashNavigation, "dashNavigationHeader2");
490+ compare(header2.backVisible, true);
491+ mouseClick(findChild(header2, "backButton"));
494492
495− mouseClick(dashNavigationButton);
496− compare(dashNavigationButton.showList, false);
497− compare(dashAltNavigationButton.showList, false);
493+ tryCompare(dashNavigation.currentNavigation, "navigationId", "middle4");
494+ tryCompare(navigationListView.currentItem.navigation, "navigationId", "middle4");
495+ compare(peExtraPanel.visible, true);
496+ }
498497
499− tryCompare(navigationListView, "visible", false);
498+ function test_clearSearchWithNavigationClosed() {
499+ var dashContentList = findChild(dashContent, "dashContentList");
500+ var searchButton = findChild(dashContentList.currentItem, "search_action_button");
501+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
502+ var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
500503
501− mouseClick(dashNavigationButton);
502− compare(dashNavigationButton.showList, true);
503− compare(dashAltNavigationButton.showList, false);
504+ compare(peExtraPanel.visible, false);
505+ mouseClick(searchButton);
506+ tryCompare(peExtraPanel, "visible", true);
504507
505− navigationListView = findChild(dashNavigationButton, "navigationListView");
506− tryCompare(navigationListView.currentItem.navigation, "loaded", true);
508+ typeString("A");
509+ compare(peExtraPanel.visible, false);
507510
508− mouseClick(dashAltNavigationButton);
509− compare(dashNavigationButton.showList, false);
510− compare(dashAltNavigationButton.showList, false);
511+ var clearIcon = findChild(searchTextField, "clearIcon");
512+ mouseClick(clearIcon);
513+ tryCompare(peExtraPanel, "visible", true);
511514 }
512515
513− function test_navigationsSwipeToNextScope() {
516+ function test_navigationShowFilterButton() {
517+ goToSecondLevel();
518+
514519 var dashContentList = findChild(dashContent, "dashContentList");
515− tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
516− var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
517− tryCompare(dashNavigation, "visible", true);
518− var dashNavigationButton = findChild(dashContentList.currentItem, "altNavigationButton");
519− verify(dashNavigationButton, "Can't find navigation button");
520+ var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
521+
522+ verify(!searchTextField.focus)
523+ verify(searchTextField.clearIsSettings)
520524
521− compare(dashNavigationButton.showList, false);
522− waitForRendering(dashNavigationButton);
523− mouseClick(dashNavigationButton, 0, 0);
524− compare(dashNavigationButton.showList, true);
525+ mouseClick(searchTextField)
526+
527+ verify(searchTextField.focus)
528+ verify(!searchTextField.clearIsSettings)
529+ }
525530
526− mouseFlick(dashNavigationButton, dashNavigationButton.width - units.gu(1), units.gu(1), units.gu(1), units.gu(1));
527− compare(dashNavigationButton.showList, false);
531+ function test_navigationShowFilterPopup() {
532+ goToSecondLevel();
528533
529534 var dashContentList = findChild(dashContent, "dashContentList");
530− expectFail("", "should not change the parent list.");
531− tryCompare(dashContentList, "currentIndex", 1);
535+ var searchTextField = findChild(dashContentList.currentItem, "searchTextField");
536+ var clearIcon = findChild(searchTextField, "clearIcon");
537+
538+ var filtersPopover = findChild(shell, "filtersPopover")
539+ verify(!filtersPopover);
540+
541+ mouseClick(clearIcon);
542+
543+ filtersPopover = findChild(shell, "filtersPopover")
544+
545+ verify(filtersPopover);
546+ }
547+
548+ function test_primaryFilter() {
549+ var dashContentList = findChild(dashContent, "dashContentList");
550+ tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
551+ dashContentList.currentItem.item.scope.setHasNavigation(false);
552+ var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
553+ var searchButton = findChild(dashContentList.currentItem, "search_action_button");
554+
555+ compare(peExtraPanel.visible, false);
556+ mouseClick(searchButton);
557+ tryCompare(peExtraPanel, "visible", true);
558+
559+ tryCompareFunction(function() { return findChild(peExtraPanel, "OSF3") != null; }, true);
532560 }
533561
534562 function test_searchHint() {
@@ -540,7 +568,7 @@ Item {
540568 var categoryListView = findChild(scope, "categoryListView");
541569 waitForRendering(categoryListView);
542570
543− compare(categoryListView.pageHeader.item.searchHint, "Search People");
571+ compare(categoryListView.pageHeader.searchHint, "Search People");
544572 }
545573
546574 function compareArrays(a, b) {