Files
grafana/scripts/generate-a11y-report.sh
Maria Alexandra 1edd415ddf Accessibility checks: Phase 2 - Adding Pa11y CI PR stage (#38556)
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-14 13:23:17 +02:00

28 lines
478 B
Bash
Executable File

#!/usr/bin/env bash
set -x
# Clean up old report
jsonReport="pa11y-ci-results.json"
if [ -f "$jsonReport" ] ; then
rm "$jsonReport"
fi
# Clean up old folder
report="pa11y-ci-report/"
if [ -d "$report" ] ; then
rm -R "$report"
fi
# Run accessibility command
yarn wait-on http://localhost:3000
yarn run -s test:accessibility --json > pa11y-ci-results.json
# Generate HTML report
pa11y-ci-reporter-html
# Start local server
yarn http-server pa11y-ci-report -p 1234