1import { defineConfig } from "@playwright/test";
2
3export default defineConfig({
4 tsconfig: "../tsconfig.playwright.json",
5 testDir: "./test",
6 // Windows CI runs every fixture e2e concurrently; absorb runner flakiness.
7 retries: process.env.CI ? 2 : 0,
8 // Retries x timeout inflation makes a truly-broken suite take ~25 minutes
9 // to fail on CI; bail after a handful of failures instead.
10 maxFailures: process.env.CI ? 5 : 0,
11 // The dev worker fixture runs a full OpenNext build on start (preview
12 // parity — no build.json reuse), so keep generous timeouts.
13 timeout: 120_000,
14 // Serialize workers: the dev fixture's OpenNext build rewrites
15 // `.open-next/assets` on disk, which a concurrently-running live
16 // (miniflare) worker serves from — parallel workers race on it.
17 workers: 1,
18 expect: {
19 timeout: 10_000,
20 },
21 build: {
22 // The hmr spec runs `next dev` inside the playwright worker process;
23 // keep playwright's babel require-hook away from Turbopack's dev chunks
24 // (their sectioned source maps break it with BABEL_GENERATE_ERROR).
25 external: ["**/.next/**"],
26 },
27 projects: [
28 {
29 name: "chromium",
30 use: {
31 browserName: "chromium",
32 colorScheme: "light",
33 deviceScaleFactor: 1,
34 viewport: { width: 1280, height: 720 },
35 },
36 },
37 ],
38});