import { defineConfig } from "@playwright/test"; // The suite starts its own server from this checkout. Reusing whatever already holds // the port tests that server's checkout instead, silently, so it is opt-in: // `PW_REUSE_SERVER=1` with `npm run serve` running here. Another worktree picks a free // port with `PORT=`. const port = Number(process.env.PORT ?? 8931); export default defineConfig({ testDir: "tests", timeout: 30_000, webServer: { command: "node scripts/serve.mjs", port, reuseExistingServer: process.env.PW_REUSE_SERVER === "1", }, use: { baseURL: `http://localhost:${port}`, }, });