-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
52 lines (42 loc) · 1.51 KB
/
playwright.config.ts
File metadata and controls
52 lines (42 loc) · 1.51 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
47
48
49
50
51
52
/**
* Playwright configuration — responsive tests only.
*
* Run: bun run docs:test:responsive
*
* Tests live in scripts/responsive.pw.ts.
* They require a running VitePress preview server (bun run docs:preview).
* In CI the server is started by the responsive.yml workflow.
*/
import { defineConfig, devices } from "@playwright/test";
const BASE_URL = process.env.PLAYWRIGHT_BASE_URL ?? "http://localhost:4173";
export default defineConfig({
testDir: "./scripts",
testMatch: ["responsive.pw.ts"],
/* Run all (viewport × page) pairs concurrently — they are fully independent */
fullyParallel: true,
/* Maximum time for each test */
timeout: 15_000,
/* Retry once on CI to tolerate transient timing issues */
retries: process.env.CI ? 1 : 0,
/* Fail fast in CI rather than running all permutations */
maxFailures: process.env.CI ? 5 : 0,
use: {
baseURL: BASE_URL,
/* Disable JS animations — they don't affect layout but speed up page load */
reducedMotion: "reduce",
},
/* Up to 4 workers locally; CI defaults to 2 (GitHub-hosted runners are 2-core) */
workers: process.env.CI ? 2 : 4,
projects: [
{
/* Chromium covers the widest range of rendering behaviours */
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
/*
* webServer is not configured here — docs must be built and the preview
* server started separately before running these tests.
* See the docs:test:responsive script and .github/workflows/responsive.yml.
*/
});