Accessibility Testing

Accessibility Testing: What Automation Finds and What It Misses

0 Comments

Automated accessibility tools catch roughly a third of the problems. Knowing which third is the difference between a passing scan and an accessible product.

In this article

  • WCAG in the four words it is built on
  • What a scanner can and cannot tell you
  • Automating the part that can be automated
  • The manual checks that find the rest
  • Where it belongs in the pipeline

WCAG in the four words it is built on

  • Perceivable – can the content be presented in a way the person can sense? Alt text, captions, contrast.
  • Operable – can they drive it? Keyboard access, enough time, no seizure triggers.
  • Understandable – is it readable and predictable? Clear labels, consistent navigation, helpful errors.
  • Robust – will it work with assistive technology, now and later? Valid markup, correct roles and names.

Levels A, AA and AAA set how strictly each is met. Most legal requirements and most contracts ask for AA.

What a scanner can and cannot tell you

Automation finds Only a person finds
Missing alt attributes Whether the alt text describes the image
Contrast below the ratio Whether meaning is carried by colour alone
Inputs with no label Whether the label makes sense to a screen reader user
Missing page language Whether the reading order makes sense
Duplicate ids, invalid ARIA Whether a custom widget is actually operable
Headings out of order Whether the heading structure maps the page

Automating the part that can be automated

// Playwright + axe-core
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';

test('checkout has no WCAG A or AA violations', async ({ page }) => {
  await page.goto('/checkout');
  const results = await new AxeBuilder({ page })
    .withTags(['wcag2a', 'wcag2aa', 'wcag21aa'])
    .analyze();

  // print them so a failure is actionable, not just a count
  for (const v of results.violations) {
    console.log(`${v.id} (${v.impact}) - ${v.help}`);
    v.nodes.forEach(n => console.log('   ', n.target.join(' ')));
  }
  expect(results.violations).toEqual([]);
});

Run the scan after the page has settled and after any modal is open. A scan of a page the user never sees in that state proves nothing about the state they do.

The manual checks that find the rest

  • Unplug the mouse. Tab through the whole journey. Can you complete it? Is focus always visible? Does focus ever get trapped?
  • Zoom the browser to 200% and then to 400%. Does content reflow, or does it disappear?
  • Turn on a screen reader – NVDA on Windows, VoiceOver on a Mac – and listen to one form.
  • Check every error message: does it say what is wrong and how to fix it, in text?
  • Look for meaning carried by colour alone – a red field with no message, a green tick with no label.

Where it belongs in the pipeline

Put the automated scan in CI on the main journeys and fail the build on new violations. Keep a short manual pass in the definition of done for any new component. Together they cover far more than either does alone – and the manual pass takes minutes once the automated noise is gone.

Key points

  • A clean axe scan is not an accessible page – it is a page with no machine-detectable errors.
  • Keyboard-only, 200% zoom and one screen reader pass find most of what scanners miss.
  • Scan the state the user is in, including open modals.
  • AA is the level nearly every contract and regulation asks for.

Practise this on the free applications at jstestingacademy.co.in/qa-apps – no account needed.