-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(playwright): add axe playwright tests in bruno room
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,40 @@ | ||
import AxeBuilder from "@axe-core/playwright"; | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test("has title", async ({ page }) => { | ||
await page.goto("/"); | ||
|
||
await expect(page).toHaveTitle("React App - Bruno Room | Threejs Journey"); | ||
}); | ||
|
||
test("has heading", async ({ browserName, page }) => { | ||
// https://playwright.dev/docs/api/class-page#page-goto | ||
test.fixme( | ||
browserName === "firefox", | ||
"Errors are occurring in firefox in CI pipeline", | ||
); | ||
|
||
await page.goto("/"); | ||
|
||
await expect( | ||
page.getByRole("heading", { | ||
name: "Bruno room", | ||
}), | ||
).toBeVisible(); | ||
}); | ||
|
||
test("should not have any automatically detectable accessibility issues", async ({ | ||
browserName, | ||
page, | ||
}) => { | ||
// https://playwright.dev/docs/api/class-page#page-goto | ||
test.fixme( | ||
browserName === "firefox", | ||
"Errors are occurring in firefox in CI pipeline", | ||
); | ||
await page.goto("/"); | ||
|
||
const accessibilityScanResults = await new AxeBuilder({ page }).analyze(); | ||
|
||
expect(accessibilityScanResults.violations).toEqual([]); | ||
}); |