Lighthouse: execution de pa11y pour compléter l'audit d'accessibilité
This commit is contained in:
@ -35,6 +35,7 @@ RUN apk add --no-cache \
|
||||
chromium
|
||||
|
||||
RUN npm install -g lighthouse
|
||||
RUN PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm install -g pa11y pa11y-reporter-html
|
||||
|
||||
RUN adduser -D lighthouse
|
||||
|
||||
@ -42,6 +43,7 @@ COPY run-audit.sh /usr/local/bin/run-audit
|
||||
RUN chmod +x /usr/local/bin/run-audit
|
||||
|
||||
COPY config.js.tmpl /home/lighthouse/config.js.tmpl
|
||||
COPY patty.json.tmpl /home/lighthouse/patty.json.tmpl
|
||||
|
||||
WORKDIR /home/lighthouse
|
||||
|
||||
|
6
resources/com/cadoles/lighthouse/patty.json.tmpl
Normal file
6
resources/com/cadoles/lighthouse/patty.json.tmpl
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"chromeLaunchConfig": {
|
||||
"args": ["--disable-dev-shm-usage", "--no-sandbox", "--disable-gpu"],
|
||||
"ignoreHTTPSErrors": true
|
||||
}
|
||||
}
|
@ -1,6 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -x
|
||||
|
||||
envtpl -o config.js /home/lighthouse/config.js.tmpl
|
||||
envtpl -o patty.json /home/lighthouse/patty.json.tmpl
|
||||
|
||||
mkdir -p reports
|
||||
rm -f reports/*
|
||||
@ -14,4 +17,12 @@ lighthouse \
|
||||
--output json --output html \
|
||||
--output-path=lighthouse \
|
||||
-- \
|
||||
"$LIGHTHOUSE_URL"
|
||||
"$LIGHTHOUSE_URL"
|
||||
|
||||
export PUPPETEER_EXECUTABLE_PATH=$(which chromium-browser)
|
||||
|
||||
pa11y --reporter html \
|
||||
--config ../patty.json \
|
||||
--include-warnings \
|
||||
--include-notices \
|
||||
"$LIGHTHOUSE_URL" > pa11y.report.html || exit 0
|
||||
|
Reference in New Issue
Block a user