Skip to the page

Keeping tests useful · mid

Automated accessibility testing (axe) and its limits

Automated tools like axe-core find many common accessibility problems (missing labels, bad ARIA, low contrast) in unit, component and E2E tests, but they cannot judge things like focus order, meaningful alt text or screen-reader flow, so you add keyboard and screen-reader checks by hand.

The notes

What you must know

  • Layers: eslint-plugin-jsx-a11y (static), jest-axe / vitest-axe on rendered components, @axe-core/playwright AxeBuilder on real pages (withTags(['wcag2a','wcag2aa','wcag21aa','wcag22aa'])), Storybook a11y addon, Lighthouse accessibility audit.
  • RTL's getByRole queries are an accessibility check too: if you can't find the button by role and name, neither can a screen reader.
  • How much automation finds: Deque (axe's maker) reported about 57% of issues by volume in its 2021 audit data; measured by WCAG criteria the share is lower. It is a vendor study, so both numbers matter.
  • Manual checks: keyboard-only pass (Tab order, visible focus, no traps, Escape), screen reader pass (VoiceOver, NVDA, TalkBack), zoom to 200/400%, reduced motion.
  • Run axe on key pages and states (open modal, error state), fail CI on new violations, and keep a baseline for old ones instead of disabling rules.

The red pen

Common traps: mistake → fix

  • Mistake: "Lighthouse accessibility score 100 means accessible"

    Fix: automated checks miss focus order, keyboard traps, meaningful names and reading order.

  • Mistake: "axe only on page load is enough"

    Fix: many bugs appear in states: menus open, dialogs, errors, loading.

Easy to hard

Questions interviewers ask, easy to hard

  1. How do you test accessibility in CI?
  2. What can automated tools not catch?
  3. How would you add accessibility testing to a design system?

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview