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
This commit is contained in:
Erica Wright 2019-09-02 07:45:43 +00:00
Родитель 4130823e2d
Коммит 32eee71195
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -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(
@ -134,10 +134,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(
@ -199,7 +199,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(