run pa11y on the homepage and kitchen sink

main
Brian Hicks 2020-11-28 14:06:48 -06:00
parent bacb5b10df
commit 8e0463387b
1 changed files with 23 additions and 0 deletions

23
script/run-pa11y.sh Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail
zola serve &
ZOLA="$!"
trap 'kill $ZOLA' EXIT
while true; do
if lsof -i :1111 | grep -q zola; then
break
fi
sleep 1
done
EXIT=0
for url in localhost:1111 localhost:1111/kitchen-sink; do
if ! pa11y -E pre --runner axe "$url"; then
EXIT=1
fi
done
exit "$EXIT"