@playwright/test 1.64.1 and @axe-core/playwright 4.14.0, dev only and pinned. pnpm e2e:ui runs a Vite server of its own on 127.0.0.1:5191 with no backend: the Dialog contract on a dev-only test page and the local tool's dialogs, desktop and 375 px, FR and EN, axe at zero serious violation outside one listed pre-existing finding. Requests outside the allowlist are aborted and fail the test.
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
/**
|
|
* `pnpm e2e:ui`: Chromium against a Vite dev server with no backend, on a
|
|
* loopback port of its own (never the owner's `pnpm dev` on 5173, never
|
|
* reused): the Dialog test page and the local tool. docs/development/BROWSER_TESTS.md.
|
|
*/
|
|
import { defineConfig } from '@playwright/test'
|
|
import type { GuardOptions } from './support/browser'
|
|
import { PROJECTS } from './support/browser'
|
|
|
|
const ORIGIN = 'http://127.0.0.1:5191'
|
|
|
|
export default defineConfig<GuardOptions>({
|
|
testDir: './ui',
|
|
// The local tool runs the core: a missing or stale module stops the run (pnpm wasm:build).
|
|
globalSetup: '../../../packages/core-wasm/tests/global-setup.ts',
|
|
outputDir: './test-results/ui',
|
|
fullyParallel: true,
|
|
forbidOnly: true,
|
|
retries: 0,
|
|
reporter: [
|
|
['list'],
|
|
['html', { outputFolder: './playwright-report/ui', open: 'never' }],
|
|
],
|
|
use: {
|
|
baseURL: ORIGIN,
|
|
allowedOrigins: [ORIGIN],
|
|
trace: 'retain-on-failure',
|
|
screenshot: 'only-on-failure',
|
|
},
|
|
projects: PROJECTS,
|
|
webServer: {
|
|
command: 'node_modules/.bin/vite --host 127.0.0.1 --port 5191 --strictPort',
|
|
cwd: '..',
|
|
url: `${ORIGIN}/`,
|
|
reuseExistingServer: false,
|
|
timeout: 120_000,
|
|
// No backend: an empty connection keeps any .env value out of this server.
|
|
env: { VITE_SUPABASE_URL: '', VITE_SUPABASE_ANON_KEY: '' },
|
|
},
|
|
})
|