feat(a11y): add axe-core Playwright scorecard for 10 key routes

- Installs @axe-core/playwright at workspace root
- Creates e2e/a11y/scorecard.spec.ts scanning /, /search, /listings/[id],
  /listings/create, /login, /register, /dashboard, /agent/[id],
  /inquiries, /admin/moderation
- API mock layer lets pages render with stubbed JSON so axe sees real DOM
- Critical/serious violations fail the build; moderate/minor are recorded only
- Writes per-route JSON reports to e2e/a11y/reports/ (committed for before/after diffing in PRs)
- Adds dedicated "a11y" Playwright project in playwright.config.ts
- Pre-existing API unit test failures are unrelated to this change

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-24 10:41:42 +07:00
parent ec066dfa28
commit 8a15df0bdb
5 changed files with 216 additions and 9 deletions

View File

@@ -76,6 +76,15 @@ export default defineConfig({
baseURL: process.env.WEB_BASE_URL ?? `http://localhost:${WEB_PORT}`,
},
},
// Accessibility scorecard — axe-core audit of 10 key routes
{
name: 'a11y',
testDir: './e2e/a11y',
use: {
...devices['Desktop Chrome'],
baseURL: process.env.WEB_BASE_URL ?? `http://localhost:${WEB_PORT}`,
},
},
],
webServer: [