Module 2. Advanced testing · Lesson 19 of 41 · 11 min

Accessibility testing (a11y): WCAG without the pain

Contrast, keyboard, screen readers, forms and images — what to check and with which tools.

Accessibility is quality for everyone

Around 1.3 billion people worldwide live with some form of disability. Add a broken arm, bright sun on the screen, an old phone or a slow connection. An accessible interface is easier for everyone — and in the US, inaccessible websites draw thousands of ADA lawsuits a year, while the European Accessibility Act applies in the EU from June 2025.

WCAG in four principles (POUR)

  • Perceivable — text can be read, images have alternatives.
  • Operable — everything works from the keyboard.
  • Understandable — errors are explained, behavior is predictable.
  • Robust — works with assistive technologies.

Contrast

Text contrast under WCAG 2.xAa#00000021:1AAAAa#5959597.0:1AAAAa#7676764.54:1AAAa#9494943.03:1large onlyAa#b3b3b32.1:1failsWCAG thresholds: AA — 4.5:1 (normal text), 3:1 (large), AAA — 7:1
Text contrast under WCAG 2.x. The ratio of gray text on a white background, calculated with the WCAG formula. Normal text needs at least 4.5:1 (AA), large text 3:1, and AAA requires 7:1.

Light gray text on white is the most common accessibility defect. You can check it in seconds in DevTools or with any contrast checker.

Keyboard: a 5-minute test

  1. Put the mouse away.
  2. Walk through the key scenario using only Tab, Shift+Tab, Enter, Space, the arrow keys and Esc.
  3. Focus is always visible, the order is logical, there are no traps (a modal you can't get out of).
  4. Menus, dropdowns and dialogs open and close from the keyboard.

Forms

  • Every field has a visible label, not just a placeholder.
  • An error explains what's wrong and how to fix it, and is linked to the field.
  • Color is never the only carrier of information: a red border plus an error message.

Images and media

  • Meaningful images have alt text; decorative ones have an empty alt="".
  • Video needs captions; audio needs a transcript.
  • Charts are duplicated by a table or text (as in this course).

Tools

Lighthouse and axe DevTools find roughly a third of the problems automatically. The rest are manual checks: the keyboard, a screen reader (NVDA or JAWS on Windows, VoiceOver on macOS/iOS, TalkBack on Android) and 200% zoom.

Add 3–5 accessibility checks to your checklist — it's the cheapest way not to forget them.

Key takeaways

  • Normal text needs a contrast ratio of at least 4.5:1 under WCAG AA.
  • The key scenario must be doable with the keyboard alone, with visible focus.
  • Automated tools find only part of the problems — manual checks are required.

Check yourself

  1. 1. What's the minimum contrast for normal text under WCAG AA?

  2. 2. A field is labeled only with a placeholder. What's wrong?

  3. 3. Which of these is a manual accessibility check?