-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
46 lines (44 loc) · 1.19 KB
/
Copy pathplaywright.config.ts
File metadata and controls
46 lines (44 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { defineConfig, devices } from "@playwright/test";
const port = Number.parseInt(process.env.PORT ?? "3000", 10);
const baseURL = process.env.APP_URL ?? `http://localhost:${port}`;
const isCI = process.env.CI === "true" || process.env.CI === "1";
export default defineConfig({
testDir: "./tests/e2e/specs",
fullyParallel: true,
forbidOnly: isCI,
retries: 0,
// Semantic CSS acceptance includes deterministic PDF preflight and 15 visual renders. Keep it serial so
// independent browser workers do not contend for the fixed production preflight deadline.
workers: 1,
timeout: 30_000,
expect: {
timeout: 10_000,
},
reporter: isCI
? [["list"], ["github"], ["junit", { outputFile: "test-results/e2e-junit.xml" }]]
: [["list"], ["html", { open: "never" }]],
use: {
baseURL,
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: {
command: "pnpm start",
url: `${baseURL}/api/health`,
reuseExistingServer: !isCI,
timeout: 120_000,
env: {
...process.env,
APP_URL: baseURL,
NODE_ENV: "production",
PORT: String(port),
},
},
});