buckets/e2e/playwright.config.ts

32 lines
1 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test'
/**
* Playwright config for the host-run e2e smoke suite.
*
* These tests drive a real browser against the LIVE dev stack (the `frontend`,
* `php`, and `database` compose services must be up — `dev-up`). The frontend
* proxies /api to the backend, so the e2e exercises the real cookie-session
* flow end to end.
*
* Runs in the `playwright` compose service (browsers preinstalled in the image)
* via `--profile e2e`, NOT on the host — the NixOS host can't launch Chromium.
* baseURL defaults to the compose service name (http://frontend:5173) via
* E2E_BASE_URL; the localhost fallback is only for an ad-hoc host run.
*/
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: 'list',
use: {
baseURL: process.env.E2E_BASE_URL ?? 'http://localhost:5173',
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
})