Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second browser window #221

Open
danrealednb opened this issue Aug 25, 2023 · 0 comments
Open

Second browser window #221

danrealednb opened this issue Aug 25, 2023 · 0 comments

Comments

@danrealednb
Copy link

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 },
    });
  });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant