Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
57 lines (54 loc) · 1.95 KB
/
Copy pathplaywright.config.ts
File metadata and controls
57 lines (54 loc) · 1.95 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
53
54
55
56
57
/**
* Playwright configuration for browser tests: the fuzz smoke (tests/fuzz/, run by
* `npm run test:fuzz`) and any sim-specific specs (tests/browser/).
*
* Template-owned: keep identical across the fleet (Baton check-template-drift).
* FUZZ_DURATION (seconds) sizes the timeout; FUZZ_PORT (default 5173) lets
* several sims fuzz in parallel without fighting over the dev-server port.
*/
import { defineConfig } from "@playwright/test";
const port = Math.max(1, parseInt(process.env["FUZZ_PORT"] || "5173", 10) || 5173);
const fuzzSeconds = Math.max(1, parseInt(process.env["FUZZ_DURATION"] || "30", 10) || 30);
export default defineConfig({
testDir: "./tests",
testMatch: "**/*.spec.ts",
timeout: (fuzzSeconds + 120) * 1000,
expect: {
timeout: 10_000,
},
fullyParallel: false,
forbidOnly: !!process.env["CI"],
retries: 0,
workers: 1,
reporter: [["list"], ["html", { open: "never" }]],
use: {
baseURL: `http://localhost:${port}`,
trace: "retain-on-failure",
video: "retain-on-failure",
screenshot: "only-on-failure",
// A fixed location for sims that read geolocation, so fuzz runs are deterministic
// and never block on a permission prompt. Harmless for sims that don't use it.
geolocation: { latitude: 40.8, longitude: -74.0 },
permissions: ["geolocation"],
},
webServer: {
command: `npm run start -- --port ${port} --strictPort`,
url: `http://localhost:${port}`,
reuseExistingServer: !process.env["CI"],
timeout: 120_000,
},
projects: [
{
name: "chromium",
use: {
browserName: "chromium",
// Makes WebGPU available in headless Chromium on Linux, so sims with a WebGPU
// path exercise it; without a GPU, requestAdapter() still resolves to null and
// the sim's fallback runs. No effect on sims that don't touch WebGPU.
launchOptions: {
args: ["--enable-unsafe-webgpu", "--enable-features=Vulkan"],
},
},
},
],
});