2026-03-16 16:43:46 +01:00
|
|
|
|
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
|
testDir: "./tests/e2e",
|
2026-08-07 21:20:48 +02:00
|
|
|
|
testIgnore: ["**/native/**", "**/admin/**"],
|
2026-03-16 16:43:46 +01:00
|
|
|
|
timeout: 30_000,
|
|
|
|
|
|
expect: {
|
|
|
|
|
|
timeout: 5_000,
|
|
|
|
|
|
},
|
|
|
|
|
|
fullyParallel: true,
|
|
|
|
|
|
forbidOnly: !!process.env.CI,
|
2026-03-18 05:38:53 +01:00
|
|
|
|
retries: process.env.CI ? 2 : 1,
|
2026-03-16 16:43:46 +01:00
|
|
|
|
workers: process.env.CI ? 1 : undefined,
|
2026-07-31 15:41:57 +02:00
|
|
|
|
// CI fail-fast: a systemic breakage (e.g. the shared login helper) makes
|
|
|
|
|
|
// most of the 255 tests burn their full timeout × retries — hours of runner
|
|
|
|
|
|
// time at 1 worker. Abort after 20 failures instead so the job reports a
|
|
|
|
|
|
// usable red quickly. 0 = unlimited (local runs see every failure).
|
|
|
|
|
|
maxFailures: process.env.CI ? 20 : 0,
|
|
|
|
|
|
// Self-terminate before the workflow's timeout-minutes (25) SIGKILLs the
|
|
|
|
|
|
// runner, so the HTML/JUnit report still gets written and uploaded.
|
|
|
|
|
|
globalTimeout: process.env.CI ? 20 * 60 * 1000 : 0,
|
2026-03-18 05:38:53 +01:00
|
|
|
|
reporter: process.env.CI
|
2026-07-31 15:41:57 +02:00
|
|
|
|
? [
|
|
|
|
|
|
["html", { open: "never" }],
|
|
|
|
|
|
["junit", { outputFile: "test-results/junit.xml" }],
|
|
|
|
|
|
]
|
2026-03-18 05:38:53 +01:00
|
|
|
|
: "html",
|
2026-03-16 16:43:46 +01:00
|
|
|
|
|
|
|
|
|
|
use: {
|
|
|
|
|
|
baseURL: "http://localhost:1420",
|
2026-03-18 05:38:53 +01:00
|
|
|
|
actionTimeout: 10_000,
|
|
|
|
|
|
navigationTimeout: 15_000,
|
2026-03-16 16:43:46 +01:00
|
|
|
|
screenshot: "only-on-failure",
|
|
|
|
|
|
trace: "on-first-retry",
|
2026-03-18 05:38:53 +01:00
|
|
|
|
video: "on-first-retry",
|
|
|
|
|
|
contextOptions: { reducedMotion: "reduce" },
|
2026-03-16 16:43:46 +01:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
projects: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: "chromium",
|
|
|
|
|
|
use: { ...devices["Desktop Chrome"] },
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
|
2026-08-28 06:54:32 +02:00
|
|
|
|
// Kills the dev server the runner cannot kill itself; without it the suite
|
|
|
|
|
|
// passes and then hangs forever. See tests/e2e/global-teardown.ts.
|
|
|
|
|
|
globalTeardown: "./tests/e2e/global-teardown.ts",
|
|
|
|
|
|
|
2026-03-16 16:43:46 +01:00
|
|
|
|
webServer: {
|
2026-08-28 06:54:32 +02:00
|
|
|
|
// Run Vite's entry point directly so the listening process IS Playwright's
|
|
|
|
|
|
// child — globalTeardown kills the listener, which only releases the
|
|
|
|
|
|
// runner's ChildProcess handle if that listener is the child itself. Going
|
|
|
|
|
|
// through `npm run dev` would leave the npm process holding it open.
|
|
|
|
|
|
command: "node node_modules/vite/bin/vite.js",
|
2026-03-16 16:43:46 +01:00
|
|
|
|
url: "http://localhost:1420",
|
|
|
|
|
|
reuseExistingServer: !process.env.CI,
|
2026-03-18 05:38:53 +01:00
|
|
|
|
timeout: 60_000,
|
2026-03-16 16:43:46 +01:00
|
|
|
|
},
|
|
|
|
|
|
});
|