Files
Spoolman/client_v2/playwright.config.ts
Donkie 8a5cf7ec73 client_v2: add mobile accessibility audit (Playwright + axe-core)
Adds an npm run audit:a11y target that runs axe-core (WCAG 2.0/2.1 A+AA
plus the 2.2 target-size rule) and a custom tap-target measurement across
the main surfaces under Pixel 5 emulation, reusing the dev server on 5174.
Results are aggregated to a11y-report.md via globalTeardown so they survive
Playwright worker restarts.
2026-07-25 19:07:24 +02:00

36 lines
1.0 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
// Playwright config dedicated to the mobile-accessibility audit. It runs a
// single mobile-emulated project (Pixel 5: 393x851 CSS px, touch enabled) so
// tap-target geometry and mobile layout are measured under realistic phone
// conditions.
//
// The webServer block reuses an already-running `vite dev` on 5174 (the usual
// dev loop) and only spins one up if nothing is listening there.
export default defineConfig({
testDir: './e2e',
globalSetup: './e2e/global-setup.ts',
globalTeardown: './e2e/global-teardown.ts',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: 0,
workers: 1,
reporter: [['list'], ['html', { open: 'never', outputFolder: 'playwright-report' }]],
use: {
baseURL: process.env.AUDIT_BASE_URL ?? 'http://localhost:5174',
trace: 'retain-on-failure'
},
projects: [
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] }
}
],
webServer: {
command: 'npm run dev',
url: 'http://localhost:5174',
reuseExistingServer: true,
timeout: 120_000
}
});