Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #33826 from albertopq/1232836-intermittent-pinning
Browse files Browse the repository at this point in the history
Bug 1232836 - Intermittent pinning_the_web_test.js r=mhenretty
  • Loading branch information
albertopq committed Jan 14, 2016
2 parents 2d6c11a + 21ee5ee commit 626d0bc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
15 changes: 10 additions & 5 deletions apps/homescreen/test/marionette/lib/homescreen.js
Expand Up @@ -55,11 +55,16 @@ Homescreen.prototype = {
},

get visibleCards() {
return this.cards.filter(function(el) {
return el.scriptWith(function(el) {
return el.parentNode.style.display !== 'none';
});
});
return this.client.executeScript(function(selector) {
var cards = document.body.querySelectorAll(selector);
var visibles = [];
for (var i = cards.length - 1; i >= 0; i--) {
if (cards[i].parentNode.style.display !== 'none') {
visibles.push(cards[i]);
}
}
return visibles;
}, [Homescreen.Selectors.card]);
},

get removeButton() {
Expand Down
20 changes: 12 additions & 8 deletions apps/system/test/marionette/pinning_the_web_test.js
Expand Up @@ -57,7 +57,9 @@ marionette('Pinning the Web', function() {
var url = server.url('sample.html');
pinTheWeb.openAndPinSiteFromBrowser(url);

assert(pinTheWeb.chromeIsPinned());
client.waitFor(function() {
return pinTheWeb.chromeIsPinned();
});

// Check that browser chrome expands when tapped
actions.wait(1).tap(system.appUrlbar).perform();
Expand Down Expand Up @@ -113,6 +115,7 @@ marionette('Pinning the Web', function() {
client.switchToFrame();
url = server.url('sample.html');
pinTheWeb.openAndPinSiteFromBrowser(url);
system.closeBrowserByUrl(url);
lastIconMatches(url);

pinTheWeb.openAndPinSiteFromBrowser(url);
Expand Down Expand Up @@ -199,7 +202,6 @@ marionette('Pinning the Web', function() {
var url, lastIconId;

function lastIconMatches(id) {
system.goHome();
client.switchToFrame(system.getHomescreenIframe());
client.waitFor(function() {
var ids = home.getIconIdentifiers();
Expand Down Expand Up @@ -251,16 +253,16 @@ marionette('Pinning the Web', function() {
pinTheWeb.openAndPinSiteFromBrowser(url);
client.switchToFrame();

var classes = system.currentWindow.getAttribute('class');
assert(classes.indexOf('collapsible') < 0);
client.waitFor(function() {
return pinTheWeb.chromeIsPinned();
});

system.gotoBrowser(url);
var link = client.helper.waitForElement('#remote-link');
link.click();
client.switchToFrame();
client.waitFor(function() {
classes = system.currentWindow.getAttribute('class');
return classes.indexOf('collapsible') > 0;
return !pinTheWeb.chromeIsPinned();
});
});

Expand Down Expand Up @@ -291,9 +293,11 @@ marionette('Pinning the Web', function() {

client.switchToFrame();
pinTheWeb.openAndPinPage(url);
system.tapHome();
system.goHome();
client.switchToFrame(system.getHomescreenIframe());
assert(home.visibleCards.length === 0, 'There is no pinned pages');
client.waitFor(function() {
return home.visibleCards.length === 0;
});
});

test('Opening quick settings should close pin dialog', function() {
Expand Down
1 change: 0 additions & 1 deletion shared/test/integration/tbpl-manifest.json
Expand Up @@ -70,7 +70,6 @@
"apps/system/test/marionette/notification_behavior_test.js": "Bug 1148336",
"apps/system/test/marionette/notification_events_test.js": "Bug 1235884 - Intermittent TEST-UNEXPECTED-FAIL | apps/system/test/marionette/notification_events_test.js",
"apps/system/test/marionette/notification_test.js": "Bug 1191036 - Intermittent apps/system/test/marionette/notification_test.js",
"apps/system/test/marionette/pinning_the_web_test.js": "Bug 1232836 - Intermittent pinning_the_web_test.js",
"apps/system/test/marionette/software_home_file_open_error_test.js": "Bug 1119079 - Intermittent software_home_file_open_error_test.js | Software Home Button - File Open Error Proper layout for file error dialog",
"apps/system/test/marionette/software_home_fullscreen_test.js": "Bug 1233573 - Intermittent TEST-UNEXPECTED-FAIL | apps/system/test/marionette/software_home_fullscreen_layout_test.js",
"apps/system/test/marionette/statusbar_home_button_test.js": "Bug 1154405 - TEST-UNEXPECTED-FAIL | Closing statusbar via home button > Home screen keeps scroll position AssertionError: false == true",
Expand Down

0 comments on commit 626d0bc

Please sign in to comment.