Skip to content

Second browser window #221

@danrealednb

Description

@danrealednb

When I run this script, a 2nd window opens up and lands on my login page. Is that supposed to happen? I can't tell if axe is checking against my login page or the page I want it to in the test.

import { test, expect, type Page } from "@playwright/test";
import { LoginPage } from "@pom/login";
import { ROLE_TYPE } from "user";
import { checkA11y, injectAxe } from "axe-playwright";

test.describe("Uploads Accessibility", () => {
  let page: Page;
  let loginPage: LoginPage;

  test.beforeAll(async ({ browser }) => {
    page = await browser.newPage();
    loginPage = new LoginPage(page);
    await loginPage.goto();
    await loginPage.login(ROLE_TYPE.STANDARD);
  });
  test.afterAll(async () => {
    await page.close();
  });
  test("Check Segments Page For Accessibility Issues", async ({ page }) => {
    await page.goto("/urltotest");
    await injectAxe(page);
// here is where 2nd page opens up
    await checkA11y(page, null, {
      detailedReport: true,
      detailedReportOptions: { html: true },
    });
  });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions