mercury-web/playwright.config.ts

29 lines
994 B
TypeScript

import { defineConfig, devices } from "@playwright/test";
/**
* The one smoke path (e2e/smoke.spec.ts) drives the real Next dev server —
* no live Go backend in CI, so the spec intercepts `/api/auth/login` and
* `/api/v1/*` at the browser network layer (page.route) and fulfills them
* with fixtures, rather than pointing FMS_API_URL at a stub server. This
* keeps auth (httpOnly Set-Cookie) and the app's real client-side code
* exactly as shipped; only the network boundary is faked.
*/
export default defineConfig({
testDir: "./e2e",
timeout: 30_000,
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
reporter: "list",
use: {
baseURL: "http://localhost:3100",
trace: "on-first-retry",
},
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
webServer: {
command: "bun run dev -- -p 3100",
url: "http://localhost:3100",
reuseExistingServer: !process.env.CI,
timeout: 60_000,
},
});