Skip to content

Commit

Permalink
Merge pull request #43 from dsm23/chore/add-axe-playwright-tests
Browse files Browse the repository at this point in the history
test(playwright): add axe playwright tests in bruno room
  • Loading branch information
mergify[bot] authored Nov 12, 2024
2 parents 77848ce + 1f8cc43 commit 6dfddab
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions react-apps/bruno-room/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"three-stdlib": "^2.34.0"
},
"devDependencies": {
"@axe-core/playwright": "^4.10.0",
"@playwright/test": "^1.48.2",
"@repo/eslint-config": "workspace:*",
"@repo/playwright-config": "workspace:*",
Expand Down
33 changes: 33 additions & 0 deletions react-apps/bruno-room/playwright-tests/home.spec.ts
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([]);
});

0 comments on commit 6dfddab

Please sign in to comment.