Skip to content

Commit

Permalink
skipping an inconsistent test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mukhamediyar Kudaikulov committed Jul 19, 2024
1 parent b7214c8 commit a3e9e77
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 36 deletions.
4 changes: 3 additions & 1 deletion src/e2e/pages/dashBoardPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ export class DashboardPage {
this.faqsPageLink = page.getByTitle("Frequently asked questions").first();

//upsell button
this.upsellScreenButton = page.getByText(/Let’s (keep going|fix it)/);
this.upsellScreenButton = page
.locator("a")
.getByText(/Let’s (keep going|fix it)/);
this.overviewCard = page.locator("[class*='DashboardTopBanner_container']");
this.overviewCardSummary = page.locator(
"[aria-label='Dashboard summary'] > div > p",
Expand Down
79 changes: 44 additions & 35 deletions src/e2e/specs/dashboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,40 +720,49 @@ test.describe(`${process.env.E2E_TEST_ENV} - Breaches Dashboard - Navigation`, (
});
});

test.describe(`${process.env.E2E_TEST_ENV} - Breaches Dashboard - Data Breaches`, () => {
test.beforeEach(async ({ landingPage, page, authPage }) => {
const emailToUse = process.env
.E2E_TEST_ACCOUNT_EMAIL_EXPOSURES_STARTED as string;
const pwdToUse = process.env.E2E_TEST_ACCOUNT_PASSWORD as string;
expect(emailToUse).not.toBeUndefined();
expect(pwdToUse).not.toBeUndefined();
await forceLoginAs(emailToUse, pwdToUse, page, landingPage, authPage);
});

test("Verify that the High risk data breaches step is displayed correctly", async ({
dashboardPage,
dataBrokersPage,
page,
}) => {
test.info().annotations.push({
type: "testrail",
description:
"https://testrail.stage.mozaws.net/index.php?/cases/view/2463592",
// This test has inconsistent results - may need to rely on mocks.
test.describe.skip(
`${process.env.E2E_TEST_ENV} - Breaches Dashboard - Data Breaches`,
() => {
test.beforeEach(async ({ landingPage, page, authPage }) => {
const emailToUse = process.env
.E2E_TEST_ACCOUNT_EMAIL_EXPOSURES_STARTED as string;
const pwdToUse = process.env.E2E_TEST_ACCOUNT_PASSWORD as string;
expect(emailToUse).not.toBeUndefined();
expect(pwdToUse).not.toBeUndefined();
await forceLoginAs(emailToUse, pwdToUse, page, landingPage, authPage);
});

await expect(dashboardPage.upsellScreenButton).toBeVisible();
await dashboardPage.upsellScreenButton.click();
await page.waitForURL(/.*\/data-broker-profiles\/view-data-brokers\/?/);
await expect(dataBrokersPage.forwardArrowButton).toBeVisible();
await dataBrokersPage.forwardArrowButton.click();
await page.waitForURL(/.*\/high-risk-data-breaches.*/);
const highRiskDataBreachLi = page.locator(
'li:has(div:has-text("High risk data breaches"))',
);
await expect(highRiskDataBreachLi).toBeVisible();
await expect(highRiskDataBreachLi).toHaveAttribute("aria-current", "step");
await expect(
highRiskDataBreachLi.locator("div").getByText("High risk data breaches"),
).toBeVisible();
});
});
test("Verify that the High risk data breaches step is displayed correctly", async ({
dashboardPage,
dataBrokersPage,
page,
}) => {
test.info().annotations.push({
type: "testrail",
description:
"https://testrail.stage.mozaws.net/index.php?/cases/view/2463592",
});

await expect(dashboardPage.upsellScreenButton).toBeVisible();
await dashboardPage.upsellScreenButton.click();
await page.waitForURL(/.*\/data-broker-profiles\/view-data-brokers\/?/);
await expect(dataBrokersPage.forwardArrowButton).toBeVisible();
await dataBrokersPage.forwardArrowButton.click();
await page.waitForURL(/.*\/high-risk-data-breaches.*/);
const highRiskDataBreachLi = page.locator(
'li:has(div:has-text("High risk data breaches"))',
);
await expect(highRiskDataBreachLi).toBeVisible();
await expect(highRiskDataBreachLi).toHaveAttribute(
"aria-current",
"step",
);
await expect(
highRiskDataBreachLi
.locator("div")
.getByText("High risk data breaches"),
).toBeVisible();
});
},
);

0 comments on commit a3e9e77

Please sign in to comment.