The person using your software might navigate with a keyboard, listen through a screen reader, zoom the page to 300%, use Safari on an old iPhone, or run your desktop app on Linux. If you only test with a mouse, in Chrome, on your own laptop, you're testing for one kind of user. This lesson covers accessibility testing against WCAG, combining automated checks (with real axe-core results) and the manual testing automation can't replace, and then cross-browser and cross-platform testing, including desktop apps built on system web views such as Tauri.
Before you start
You should have written Playwright tests in End-to-End Testing with Playwright: Automating Real User Workflows, and know performance budgets from lesson 11. Basic HTML knowledge helps.
Why accessibility testing matters
Accessibility means people with disabilities can perceive, understand, navigate, and use your software. That includes people who are blind or have low vision, are deaf or hard of hearing, have motor impairments that prevent mouse use, or have cognitive disabilities, as well as anyone temporarily affected by an injury, bright sunlight, or a noisy room.
It's also often a legal requirement. Many jurisdictions require accessible digital services, especially from public bodies and, increasingly, from businesses; for example, the European Accessibility Act has applied to many products and services in the EU since June 2025. The obligations differ by place and sector, so check the ones that apply to you. The technical standard most laws point to is the same: WCAG.
WCAG in brief
The Web Content Accessibility Guidelines (WCAG), published by the W3C, are organized around four principles: content must be perceivable, operable, understandable, and robust. Each guideline has testable success criteria at three levels: A, AA, and AAA. Most policies and laws target level AA. WCAG 2.2, the current version, added criteria such as a minimum target size for controls and making sure focused elements aren't hidden behind sticky headers.
Examples of AA requirements you can test:
- text has a contrast ratio of at least 4.5:1 with its background (3:1 for large text);
- every function works with a keyboard alone, with a visible focus indicator;
- form fields have labels, and errors are described in text;
- content reflows without horizontal scrolling at 320 CSS pixels wide (roughly 400% zoom);
- status messages are announced to assistive technology without moving focus.
Automated accessibility checks
Tools such as axe-core analyze a rendered page against rules derived from WCAG. With Playwright, @axe-core/playwright runs axe inside your E2E tests:
import AxeBuilder from "@axe-core/playwright";
import { expect, test } from "@playwright/test";
test("the sign-up page has no detectable WCAG A or AA violations", async ({ page }) => {
await page.goto("/");
const results = await new AxeBuilder({ page })
.withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"])
.analyze();
expect(results.violations.map((v) => `${v.id}: ${v.help} (${v.nodes.length})`)).toEqual([]);
});To see it catch problems, the sign-up page from lesson 8 was broken in two common ways: the <label> was replaced with a plain styled <span>, and the button was given white text on a light yellow background. The result:
✘ e2e/a11y.spec.ts › the sign-up page has no detectable WCAG A or AA violations
- Expected - 1
+ Received + 4
- Array []
+ Array [
+ "color-contrast: Elements must meet minimum color contrast ratio thresholds (2)",
+ "label: Form elements must have labels (1)",
+ ]Notice something else in that run: the user-flow tests from lesson 8 also failed, because page.getByLabel("Email") could no longer find the field. A form field without a label is invisible to screen readers and to tests written the way users perceive the page. With the label and colors restored, all three tests pass.
Lighthouse, built into Chrome DevTools and available as a command-line tool and CI action, also runs accessibility audits (using axe rules) alongside performance checks, which makes it handy for budgets in CI.
What automation can't check
Automated tools are fast and catch real problems, but they only find a portion of accessibility issues. They can tell that an image has alt text, not whether the text describes the image. They can find a missing label, not a confusing one. They can't judge whether the keyboard order makes sense, whether a custom widget is actually usable with a screen reader, or whether instructions are understandable. A page with zero axe violations isn't necessarily accessible.
Manual accessibility testing
A practical manual routine, which you can run in fifteen minutes per page:
- Keyboard only. Unplug the mouse. Tab through everything: is every control reachable, in a sensible order, with a visible focus indicator? Can you open and close menus and dialogs with Enter, Space, and Escape? Is there any keyboard trap you can't Tab out of?
- Screen reader. Use NVDA on Windows, VoiceOver on macOS and iOS, TalkBack on Android, or Orca on Linux. Navigate by headings and landmarks. Are buttons and links announced with meaningful names? Are errors and status messages announced?
- Zoom and reflow. Zoom to 200% and to 400% (or narrow the window to 320 pixels). Does content reflow without horizontal scrolling or overlapping?
- Contrast and color. Is information conveyed by color alone (a red border as the only error sign)? Check contrast in both light and dark themes.
- Motion and timing. With "reduce motion" enabled in the operating system, do animations calm down? Are there time limits users can't extend?
- Forms and errors. Submit a form with mistakes. Is each error described in text, next to its field, and announced? Is focus moved somewhere sensible?
Testing with disabled users, when you can, reveals problems no checklist will.
Cross-browser testing
Browsers share standards but differ in engines (Chromium's Blink, Firefox's Gecko, Safari's WebKit), in the features they support, and in their bugs. Playwright can run the same tests in all three engines:
projects: [
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
{ name: "firefox", use: { ...devices["Desktop Firefox"] } },
{ name: "webkit", use: { ...devices["Desktop Safari"] } },
{ name: "mobile-safari", use: { ...devices["iPhone 15"] } },
],Playwright's WebKit build is close to Safari but not identical, and device profiles emulate screen size and touch, not real hardware. For confidence on the platforms that matter most to your users, also test on real devices: an actual iPhone and Android phone, or a cloud device service.
Choose browsers from your analytics, not habit. Before using a newer web feature, check its support across browsers; the Baseline labels on MDN and web.dev show which features work across all major browsers.
Cross-platform testing
Software that runs on users' machines meets more variety than a web page: different operating systems, file systems, permissions, and hardware.
Desktop apps on system web views
Frameworks such as Tauri build desktop apps with a web front end and a Rust back end, rendered by the operating system's own web view: WebView2 (Chromium-based) on Windows, WKWebView (WebKit) on macOS, and WebKitGTK on Linux. That keeps apps small, but it means your interface runs on three different engines, with different versions on different machines. A CSS feature or JavaScript API that works on Windows may not exist in an older WebKitGTK on Linux.
Testing strategy for such apps:
- Unit tests in both halves:
cargo testfor the Rust back end, Vitest for the front end. - Front-end tests in all three engines, using Playwright's Chromium and WebKit to approximate the web views.
- Real end-to-end tests of the app window through WebDriver. Tauri provides
tauri-driverfor this on Windows and Linux; check its documentation for current platform support. - A CI matrix that builds and tests on Windows, macOS, and Linux runners.
- Manual smoke tests on each OS before release, especially installation, updates, and file access.
# GitHub Actions or Forgejo Actions: run the same jobs on three operating systems
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}Common cross-platform defects
- Paths:
\versus/, drive letters, spaces and non-ASCII characters in user folder names. Use your language's path utilities, never string concatenation. - Case sensitivity:
Logo.pngandlogo.pngare the same file on default Windows and macOS file systems, but different on Linux. - Line endings: CRLF versus LF in files your app reads or writes.
- Permissions and locations: where apps may write data, configuration, and caches differs per OS.
- Locale and time zones: number and date formats, right-to-left languages, daylight saving.
- Fonts and scaling: different default fonts and high-DPI scaling change layouts.
Common mistakes and troubleshooting
- Treating zero axe violations as "accessible". Add keyboard, screen reader, and zoom checks.
- Fixing accessibility at the end. Use semantic HTML from the start; native elements (
<button>,<label>) are accessible by default. - ARIA as a patch. Wrong ARIA is worse than none. Prefer native elements, and add ARIA only where needed.
- Testing only Chromium. Run Firefox and WebKit too; Safari users are often a large share on mobile.
- Assuming the desktop web view matches your browser. Test on each OS's real web view.
- Hard-coded paths and line endings. Use platform-aware APIs.
- axe reports a violation in a third-party widget. Report it to the vendor, consider an alternative, and track it; don't exclude it silently.
Practical exercise: test beyond your setup
- Add the axe test to a Playwright suite, then break a label and a color on purpose to see it fail.
- Do the five-step manual routine on one page, and file bug reports (lesson 5) for what you find.
- Run your E2E suite in Chromium, Firefox, and WebKit, plus one mobile profile.
- Check two CSS or JavaScript features you use against MDN's browser compatibility data.
- If you build a desktop or command-line app, add a CI matrix for Windows, macOS, and Linux, and write one test that uses a path with spaces and non-ASCII characters.
Key takeaways
- Accessibility testing targets WCAG, usually level AA; WCAG 2.2 is current.
- Automated tools like axe-core and Lighthouse catch a portion of issues quickly; they can't judge meaning or usability.
- Manual checks with a keyboard, screen readers, zoom, contrast, and reduced motion are essential.
- Test in Chromium, Firefox, and WebKit, and on real devices for key platforms.
- Desktop apps on system web views run on different engines per OS; test each platform, and watch paths, case, line endings, and locales.
References
- W3C: Web Content Accessibility Guidelines (WCAG) 2.2 (opens in a new tab)
- W3C WAI: Easy Checks, a first review of web accessibility (opens in a new tab)
- axe-core (opens in a new tab)
- Playwright: Accessibility testing (opens in a new tab)
- Chrome for Developers: Lighthouse (opens in a new tab)
- MDN: Baseline compatibility (opens in a new tab)
- Tauri: Testing with WebDriver (opens in a new tab)
- European Commission: European Accessibility Act (opens in a new tab)
What's next
Hand-picked examples only find the bugs you imagine. Advanced Testing Techniques: Property-Based Testing, Fuzzing, and Mutation Testing lets the computer find the rest.

