29 lines
923 B
JavaScript
29 lines
923 B
JavaScript
import { defineConfig } from '@playwright/test';
|
|
|
|
// Screenshot testing against the existing Vite dev harness (localhost:5199).
|
|
// Each `data-shot` section of /screenshots.html becomes one reference image
|
|
// under tests/screenshots/reference/. Refs are generated on first run; on
|
|
// changes regenerate them with `npm run test:screenshots:update`.
|
|
export default defineConfig({
|
|
testDir: './tests',
|
|
fullyParallel: false,
|
|
snapshotPathTemplate: '{testDir}/screenshots/reference/{arg}{ext}',
|
|
expect: {
|
|
toHaveScreenshot: {
|
|
// Freeze spinners / transitions so animated states render deterministically.
|
|
animations: 'disabled',
|
|
},
|
|
},
|
|
use: {
|
|
baseURL: 'http://localhost:5199',
|
|
viewport: { width: 1200, height: 800 },
|
|
screenshot: 'off',
|
|
},
|
|
webServer: {
|
|
command: 'npm run dev',
|
|
url: 'http://localhost:5199',
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 60_000,
|
|
},
|
|
});
|