-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
323 additions
and
2 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -22,3 +22,8 @@ logs | |
.env | ||
.env.* | ||
!.env.example | ||
|
||
# Playwright | ||
test-results/ | ||
playwright-report | ||
playwright/.cache/ |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import AxeBuilder from "@axe-core/playwright"; | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test.describe("index", () => { | ||
test("should not have any automatically detectable accessibility issues", async ({ | ||
page, | ||
}) => { | ||
await page.goto("/"); | ||
await expect( | ||
page.locator("h1:has-text('Wie viele Menschen?')"), | ||
).toBeVisible(); | ||
|
||
const accessibilityScanResults = await new AxeBuilder({ page }).analyze(); | ||
|
||
expect(accessibilityScanResults.violations).toEqual([]); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { devices } from "@playwright/test"; | ||
import type { PlaywrightTestConfig } from "@playwright/test"; | ||
|
||
const port = parseInt(process.env.VITE_PORT ?? "3001"); // not 3000 to not interfere with local deployment | ||
const timeout = parseInt(process.env.WAIT_ON_TIMEOUT ?? `${20 * 1000}`); | ||
|
||
const config: PlaywrightTestConfig = { | ||
testDir: ".", | ||
timeout: 10000, | ||
retries: process.env.CI === "true" ? 1 : 0, | ||
use: { | ||
viewport: { width: 1280, height: 720 }, | ||
acceptDownloads: true, | ||
baseURL: `http://localhost:${port}`, | ||
screenshot: "only-on-failure", | ||
}, | ||
reporter: [ | ||
[process.env.CI ? "github" : "list"], | ||
["html", { outputFolder: "./playwright-report" }], | ||
], | ||
projects: [ | ||
{ | ||
name: "chromium", | ||
use: { ...devices["Desktop Chrome"], channel: "chrome" }, | ||
}, | ||
], | ||
webServer: { | ||
command: `DEV_TOOLS=false npm run dev -- --port ${port}`, | ||
port, | ||
timeout, | ||
}, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.