From cfa31aaecc45f7f01336968f9e72f76234304ad1 Mon Sep 17 00:00:00 2001 From: Erica Wright Date: Mon, 9 Sep 2019 17:10:44 +0000 Subject: [PATCH] Bug 1567373 - Fix intermittent, check for element before visibility r=johannh Differential Revision: https://phabricator.services.mozilla.com/D44247 --HG-- extra : moz-landing-system : lando --- .../test/browser/browser_protections_monitor.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/browser/components/protections/test/browser/browser_protections_monitor.js b/browser/components/protections/test/browser/browser_protections_monitor.js index 6be8bdb63374..9a4fdd29ca00 100644 --- a/browser/components/protections/test/browser/browser_protections_monitor.js +++ b/browser/components/protections/test/browser/browser_protections_monitor.js @@ -76,10 +76,10 @@ add_task(async function() { await ContentTask.spawn(tab.linkedBrowser, {}, async function() { await ContentTaskUtils.waitForCondition(() => { - const noLogins = content.document.querySelector( + const hasLogins = content.document.querySelector( ".monitor-card.has-logins" ); - return ContentTaskUtils.is_visible(noLogins); + return hasLogins && ContentTaskUtils.is_visible(hasLogins); }, "Monitor card for user with stored logins is shown."); const hasLoginsHeaderContent = content.document.querySelector( @@ -135,10 +135,10 @@ add_task(async function() { await ContentTask.spawn(tab.linkedBrowser, {}, async function() { await ContentTaskUtils.waitForCondition(() => { - const noLogins = content.document.querySelector( + const hasLogins = content.document.querySelector( ".monitor-card.has-logins" ); - return ContentTaskUtils.is_visible(noLogins); + return hasLogins && ContentTaskUtils.is_visible(hasLogins); }, "Monitor card for user with stored logins is shown."); const lockwiseSection = content.document.querySelector( @@ -200,7 +200,7 @@ async function checkNoLoginsContentIsDisplayed(tab, expectedLinkContent) { const noLogins = content.document.querySelector( ".monitor-card.no-logins" ); - return ContentTaskUtils.is_visible(noLogins); + return noLogins && ContentTaskUtils.is_visible(noLogins); }, "Monitor card for user with no logins is shown."); const noLoginsHeaderContent = content.document.querySelector(