Fantasy-Map-Generator/playwright.config.ts
Marc Emmanuel 93e7b9d3dd feat: add Playwright for end-to-end testing and update snapshots
- Introduced Playwright for E2E testing with a new configuration file.
- Added test scripts to package.json for running E2E tests.
- Updated package-lock.json and package.json with new dependencies for Playwright and types.
- Created new SVG snapshot files for various layers (ruler, scaleBar, temperature, terrain, vignette, zones) to support visual testing.
- Excluded e2e directory from TypeScript compilation.
2026-01-23 11:22:27 +01:00

28 lines
737 B
TypeScript

import { defineConfig, devices } from '@playwright/test'
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [['html', { open: 'always' }]],
use: {
baseURL: 'http://localhost:4173',
trace: 'on-first-retry',
// Fixed viewport to ensure consistent map rendering
viewport: { width: 1280, height: 720 },
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: 'npm run build && npm run preview',
url: 'http://localhost:4173',
reuseExistingServer: !process.env.CI,
timeout: 120000,
},
})