import { defineConfig } from '@playwright/test'; // Playwright runs the SvelteKit dev server on a dedicated port so it // doesn't reuse whatever the dev workflow has on the vite default // (`5173`). `--strictPort` makes vite fail fast on collision instead of // silently bumping to a free port, which would leave Playwright pointed // at the wrong host. Set `E2E_BASE_URL` to skip the embedded server and // point at an already-running deployment. const E2E_PORT = 5174; export default defineConfig({ testDir: 'e2e', timeout: 30_000, use: { baseURL: process.env.E2E_BASE_URL ?? `http://localhost:${E2E_PORT}`, trace: 'retain-on-failure' }, webServer: process.env.E2E_BASE_URL ? undefined : { command: `npm run dev -- --port ${E2E_PORT} --strictPort`, port: E2E_PORT, reuseExistingServer: !process.env.CI, timeout: 120_000 } });