Visual & accessibility testing

Screenshot diffing (Playwright snapshots/Percy-style), axe-core automated a11y scans and their limits (~30-40% of WCAG issues are machine-detectable).

About 22 min read3-question knowledge check

The mental model

Functional tests answer "does it work?"; visual and accessibility tests answer two questions functional tests are blind to: "does it look right?" and "can everyone use it?" A checkout button can be perfectly clickable by Playwright — correct role, correct handler, test passes green — while being rendered as white-on-white, overlapping the price, and completely invisible to a screen reader. Every functional assertion passes; the page is broken for humans. This is the gap these two disciplines fill.

The analogy that sticks: functional testing checks that the wiring works; visual testing checks that the room looks the way the architect drew it; accessibility testing checks that someone in a wheelchair, someone who's blind, and someone who can't use a mouse can all use the room. The wiring can be flawless while the room is unusable. And crucially, the third check has legal weight — accessibility isn't a nicety, it's a compliance requirement (WCAG, and in many jurisdictions law), so an escaped a11y defect can be a lawsuit, not just a bad experience.

The one number every SDET must internalize about accessibility: automated scanners catch only ~30-40% of WCAG issues. Tools like axe-core are excellent at the machine-detectable subset — missing alt text, insufficient colour contrast, missing form labels, invalid ARIA — but they *cannot* judge whether alt text is *meaningful*, whether focus order makes *sense*, whether a custom widget is *operable* by keyboard, or whether an error message is *understandable*. The professional stance is therefore: automate the 30-40% as a cheap CI gate to catch regressions, and know that the other 60-70% requires manual testing with real assistive technology. An engineer who claims "we run axe, so we're accessible" is advertising that they don't understand the tool's limits — a red flag interviewers listen for.

The full lesson continues with 15 more sections
  • Deep dive
  • Internal architecture
  • Real-world use cases
  • Best practices
  • Common mistakes
  • Performance
  • Security
  • Production troubleshooting
  • Advantages & disadvantages
  • Alternatives
  • Interview expectations
  • Interview questions
  • Facts to remember
  • Cheat sheet
  • Quick revision