accessibility.sh 603 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. rm -rf /screenshots/diff
  3. mv -fn /screenshots/new /screenshots/old
  4. mkdir -p /screenshots/diff
  5. mkdir -p /screenshots/new
  6. chmod 777 -R /screenshots
  7. /generate_pa11y-ci-config.php
  8. su puppet -c '/usr/local/bin/pa11y-ci -c /pa11y/config.json'
  9. cd /screenshots/new || exit 1
  10. for f in *; do
  11. XC=$(compare -metric NCC "/screenshots/old/${f}" "${f}" "/screenshots/diff/${f}" 2>&1)
  12. if [ 1 -eq "$(echo "${XC} < 0.999" | bc)" ]; then
  13. printf '\e[33mCheck file for differences: \e]8;;%s\e\\%s\e]8;;\e\\\e[0m\n' "file:tests/screenshots/diff/${f}" "tests/screenshots/diff/${f}"
  14. fi
  15. done