diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index dea5da5..f5934dc 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -131,4 +131,4 @@ at [https://www.contributor-covenant.org/translations][translations]. [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html [Mozilla CoC]: https://github.com/mozilla/diversity [FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations \ No newline at end of file +[translations]: https://www.contributor-covenant.org/translations diff --git a/CODE_OF_CONDUCT_DE.md b/CODE_OF_CONDUCT_DE.md index 71f4249..9d42306 100644 --- a/CODE_OF_CONDUCT_DE.md +++ b/CODE_OF_CONDUCT_DE.md @@ -132,4 +132,4 @@ Dieser Verhaltenskodex basiert auf dem [Contributor Covenant][homepage], Version 2.0, verfügbar unter -[homepage]: https://www.contributor-covenant.org \ No newline at end of file +[homepage]: https://www.contributor-covenant.org diff --git a/test/a11y/example.spec.ts b/test/a11y/example.spec.ts index 92f61c2..379873d 100644 --- a/test/a11y/example.spec.ts +++ b/test/a11y/example.spec.ts @@ -1,10 +1,36 @@ import { test } from "@playwright/test" +import { chromium, Browser, Page } from "playwright" import { injectAxe, checkA11y } from "axe-playwright" +let browser: Browser +let page: Page + test.describe("basic example a11y test", () => { - test("test start page", async ({ page }) => { + test.beforeAll(async () => { + browser = await chromium.launch() + page = await browser.newPage() await page.goto("/") await injectAxe(page) + }) + + // eslint-disable-next-line playwright/expect-expect + test("simple accessibility run", async () => { await checkA11y(page) }) + + // eslint-disable-next-line playwright/expect-expect + test("check a11y for the whole page and axe run options", async () => { + await checkA11y(page, undefined, { + axeOptions: { + runOnly: { + type: "tag", + values: ["wcag2a"], + }, + }, + }) + }) + + test.afterAll(async () => { + await browser.close() + }) })