This PR implements a comprehensive automated accessibility scanner using Playwright and @axe-core/playwright to prevent accessibility regressions in the frontend application.
- ✅ Created
scripts/accessibility-scan.js- Automated scanner that checks all major pages for WCAG Level AA violations - ✅ Installed
@axe-core/playwrightdependency for accessibility testing - ✅ Added
test:a11y:scannpm script to frontend package.json - ✅ Installed
wait-ondependency for CI server startup coordination
The scanner automatically checks these routes:
- Landing Page (
/) - Dashboard (
/dashboard) - Explorer (
/explorer) - Create Escrow (
/escrow/create) - Profile (
/profile)
- ✅ Enhanced
.github/workflows/ci.ymlaccessibility job - ✅ Automated scanner runs on every PR and push to develop
- ✅ Builds frontend, starts server, and runs comprehensive scans
- ✅ Uploads detailed HTML reports as artifacts
- ✅ Blocks PRs that exceed violation thresholds
Custom thresholds configured to fail CI on critical violations:
| Impact Level | Local | CI Mode |
|---|---|---|
| Critical | 0 | 0 |
| Serious | 5 | 0 |
| Moderate | 10 | 5 |
| Minor | 20 | 10 |
CI mode is stricter to prevent regressions from being merged.
- ✅ Created
scripts/README-ACCESSIBILITY.mdwith comprehensive guide - ✅ Local testing instructions
- ✅ Common issues and fixes
- ✅ Best practices and resources
- ✅ Troubleshooting guide
- ✅ Added
frontend/accessibility-reports/to .gitignore - ✅ Configured Axe to check WCAG 2.0 Level A, AA and WCAG 2.1 Level A, AA
- ✅ HTML reports generated with detailed violation information
cd frontend
npm run build
npm run start:test
# In another terminal
npm run test:a11y:scanThe scanner runs automatically in the CI pipeline when frontend files change.
The scanner generates detailed HTML reports including:
- Summary of violations by severity
- Detailed information for each violation
- Affected HTML elements with code snippets
- Links to WCAG guidelines and remediation guidance
- WCAG criteria references
- Automated Detection - Catches accessibility issues before they reach production
- WCAG Compliance - Ensures Level AA compliance across all major pages
- Developer Feedback - Clear, actionable reports with fix guidance
- CI Integration - Blocks PRs with critical violations
- Local Development - Run scans during development to catch issues early
Run locally:
npm run test:a11y:scanView reports in frontend/accessibility-reports/
See scripts/README-ACCESSIBILITY.md for:
- Complete setup instructions
- Understanding violation severity
- Common issues and fixes
- Best practices
- Troubleshooting guide
Closes #912