ploughshares/check_lighthouse.sh

35 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Check if Lighthouse is installed
if ! command -v lighthouse &> /dev/null; then
echo "Lighthouse CLI is not installed. Installing now..."
npm install -g lighthouse
fi
# URL to test
URL="http://localhost:5005"
# Run Lighthouse with focus on accessibility
echo "Running Lighthouse accessibility test on $URL"
lighthouse $URL --only-categories=accessibility --output=html --output-path=./lighthouse-report.html --chrome-flags="--headless --disable-gpu --no-sandbox"
# Open the report
echo "Test completed. Opening report..."
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
open ./lighthouse-report.html
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
xdg-open ./lighthouse-report.html
elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
# Windows
start ./lighthouse-report.html
else
echo "Report saved to ./lighthouse-report.html"
fi
echo "Manual testing recommendations:"
echo "1. Check contrast ratio using WebAIM Contrast Checker: https://webaim.org/resources/contrastchecker/"
echo "2. Test keyboard navigation through the site"
echo "3. Verify screen reader compatibility"
echo "4. Check form field labels and ARIA attributes"