Files
fete/frontend/playwright.config.ts
nitrix 9cf199dd9f Add Playwright E2E tests with MSW API mocking
- Playwright + @msw/playwright + @msw/source for OpenAPI-driven mocks
- Chromium-only configuration with Vite dev server integration
- Smoke tests: home page, CTA, navigation
- US-1 tests: validation, event creation flow, localStorage, error handling
- Suppress Node 25 --localstorage-file warning from MSW cookieStore
2026-03-06 18:16:07 +01:00

42 lines
1.1 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test'
// Suppress Node 25 warning from MSW's cookieStore accessing native localStorage
// without --localstorage-file being set. Harmless — MSW doesn't need file-backed storage.
const originalEmit = process.emit.bind(process)
process.emit = function (event: string, ...args: unknown[]) {
if (event === 'warning' && args[0] instanceof Error && args[0].message.includes('--localstorage-file')) {
return false
}
return originalEmit(event, ...args)
} as typeof process.emit
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI ? 'github' : 'html',
use: {
baseURL: 'http://localhost:5173',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: 'npm run dev',
url: 'http://localhost:5173',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
stdout: 'pipe',
},
})