Master

Auditing a whole site, not one page

A site audit is a crawl with a verdict per page and a rule that says the verdict must be reproducible. If the check cannot be run twice with the same result, it is a human opinion and it will drift between reviewers.

What you will see

A table one row per page. The next release diffs against this file.

About 1 min of reading

Try It

Run a mechanical audit across the site

1

Collect the pages

node tmp/crawl_all.js 2>/dev/null | head -40

Before you run it, say out loud what it will print. Then open the answer.

What it prints
A list of routes. If the script is missing, list routes from the routes directory instead.
2

Check alt coverage

for p in $(node tmp/crawl_all.js | head -20); do c=$(curl -s "http://localhost:3000$p"); printf '%s img=%s alt=%s\n' "$p" "$(echo "$c" | grep -oE '

Before you run it, say out loud what it will print. Then open the answer.

What it prints
No output means no skips. Any output names the page and the level that jumped.
4

Write the verdict table

printf '| page | verdict | cause |\n|---|---|---|\n| /tutorials | fail | 3 images missing alt |\n' | tee docs/a11y-audit.md

Before you run it, say out loud what it will print. Then open the answer.

What it prints
A table one row per page. The next release diffs against this file.
Do not mark a page pass because a linter was clean. Mark it pass only after the tab walk and the screen reader pass on it.

Data Flow

Crawl to a ranked cause list
1 Crawl every route
↓
2 Run the mechanical checks per page
↓
3 Record a verdict and a cause per page
↓
4 Group by cause and rank by page count
↓
5 Fix the top cause, re-run
Why this works
The audit's real output

The output is a list of causes ranked by how many pages they affect. Fix the top cause and the count drops by more than one page at a time.

What an audit cannot cover

Pages behind a login, states that need a sequence of actions, and anything that depends on time. Those need scripted sessions, and the audit should say so rather than call them untested.

Examples

Crawl, then group

Collect every page, run the checks, and group failures by cause rather than by page. Ten pages failing for one cause is one fix, not ten.

Automate the mechanical part

Missing alt, missing labels, heading skips, duplicate ids, positive tabindex: all are greppable. Automate those so the manual time goes to names and order.

Keep a per-page verdict

One line per page: pass or fail plus the cause. That table is what a next release diffs against, and it is what proves the fix worked.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Refactoring an inaccessible component
Previous Lesson
Refactoring an inaccessible component
Next Lesson
A policy that survives the next release
A policy that survives the next release →