-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy patha11y-test.sh
More file actions
executable file
·45 lines (38 loc) · 1.15 KB
/
a11y-test.sh
File metadata and controls
executable file
·45 lines (38 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Run accessibility compliance tests (WCAG, keyboard nav, ARIA)
#
# Usage:
# ./scripts/a11y-test.sh # Full a11y audit (production build)
# ./scripts/a11y-test.sh --dev # Use Vite dev server
#
# Tests all dashboards for:
# - axe-core WCAG 2.1 AA violations
# - Keyboard navigation (Tab, Enter, Escape)
# - ARIA attributes and roles
# - Focus management
# - Color contrast
#
# Prerequisites:
# - npm install done in web/
#
# Output:
# web/e2e/test-results/a11y-compliance-report.json
# web/e2e/test-results/a11y-compliance-summary.md
set -euo pipefail
cd "$(dirname "$0")/../web"
EXTRA_ENV=()
for arg in "$@"; do
case "$arg" in
--dev) EXTRA_ENV+=(PERF_DEV=1); echo "Using Vite dev server..." ;;
esac
done
if [[ ${#EXTRA_ENV[@]} -eq 0 ]]; then
echo "Running accessibility compliance tests against production build..."
fi
env "${EXTRA_ENV[@]}" npx playwright test \
--config e2e/compliance/compliance.config.ts \
e2e/compliance/a11y-compliance.spec.ts
echo ""
echo "Reports:"
echo " JSON: web/e2e/test-results/a11y-compliance-report.json"
echo " Summary: web/e2e/test-results/a11y-compliance-summary.md"