mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-04 17:41:23 +01:00
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.
This commit is contained in:
parent
a89694d5c4
commit
93e7b9d3dd
38 changed files with 400 additions and 2 deletions
28
playwright.config.ts
Normal file
28
playwright.config.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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,
|
||||
},
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue