From b7214c8d958d14dfc568b54496287107a3ca3e93 Mon Sep 17 00:00:00 2001 From: Mukhamediyar Kudaikulov Date: Fri, 19 Jul 2024 03:41:21 -0700 Subject: [PATCH] slightly modified the locators for a failing test --- src/e2e/specs/dashboard.spec.ts | 1 + src/e2e/utils/helpers.ts | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/e2e/specs/dashboard.spec.ts b/src/e2e/specs/dashboard.spec.ts index a72dba31d56..92b77d78f44 100644 --- a/src/e2e/specs/dashboard.spec.ts +++ b/src/e2e/specs/dashboard.spec.ts @@ -515,6 +515,7 @@ test.describe(`${process.env.E2E_TEST_ENV} - Breaches Dashboard - Overview Card` }); await dashboardPage.open(); + await page.waitForURL("**/dashboard/**"); //get the number of exposures count const overviewCardSummary = diff --git a/src/e2e/utils/helpers.ts b/src/e2e/utils/helpers.ts index ddb6da2800f..406bec589c4 100644 --- a/src/e2e/utils/helpers.ts +++ b/src/e2e/utils/helpers.ts @@ -208,12 +208,10 @@ export const forceLoginAs = async ( await page.context().clearCookies(); await landingPage.open(); await landingPage.goToSignIn(); - let visible = true; - try { - await expect(authPage.useDifferentEmailButton).toBeVisible(); - } catch { - visible = false; - } + await page + .locator("//input[@type='password'] | //div/input[@type='email']") + .waitFor({ state: "visible" }); + const visible = await authPage.useDifferentEmailButton.isVisible(); if (visible) { await authPage.useDifferentEmailButton.click(); await page.waitForURL(/^(?!.*signin).*/);