Skip to main content
Introducing packages.sweber.dev
All posts
Release1 min read

Surjection 0.3.0 released

A keyboard check for focus traps and missing focus indicators, checks behind a login, and status badges per client project in Surjection Pro.

By Seya Weber

Surjection 0.3.0 is out. axe-core looks at a page as it is, but two of the most common barriers only show up when someone actually uses the keyboard. This release presses Tab for you.

What is new in 0.3.0

  • Keyboard check. --keyboard presses Tab through every page and reports two things axe-core cannot test: focus traps, where focus cycles inside a dialog or widget and never reaches the rest of the page (WCAG 2.1.2), and elements that look the same with and without focus (WCAG 2.4.7). The findings work like all others: in every report, with --fail-on and in the baseline.
  • Pages behind a login. --storage-state auth.json checks customer accounts, checkouts and intranets with a saved Playwright session.
  • In Playwright tests the same check is expectAccessible(page, { keyboard: true }) or checkKeyboard(page) on its own.
npx playwright codegen --save-storage=auth.json https://preview.example.ch/login
npx surjection check --base-url https://preview.example.ch / /konto --keyboard --storage-state auth.json

The guide Keyboard and login explains both rules, how to fix them and where a manual check is still needed.

Surjection Pro: status badges

surjection-history 0.3.0 writes a status badge per client project: the open issues after the latest run, red for critical or serious, orange for moderate and green when nothing was found. The badge has a text alternative and enough contrast. Put it in a README, the client portal or a status page.

npx surjection-history badge --out-dir badges

You can see the badges for three example clients on the live demo.

Upgrade

pnpm add -D @sweberdev/surjection@^0.3.0

Nothing breaks: the keyboard check and the storage state are opt-in. Full reference at packages.sweber.dev/surjection/docs.

Automated tests, including the keyboard check, find only part of all barriers. A passing run is no proof of conformance.

Package in this post

Surjection

Accessibility checks for CI and tests, client-ready reports and accessibility statements in five languages. Built on axe-core, no overlay.

pnpm add -D @sweberdev/surjection
View package

Related posts

Release

Surjection 0.1.0 released

Accessibility checks for Playwright and Vitest, a baseline for existing sites, reports and accessibility statements in five languages. MIT licensed, with a Pro edition for agencies.

Surjection
Release

Surjection 0.2.0 released

JUnit reports for GitLab, Azure DevOps and Jenkins, a mobile viewport, surjection init for a ready CI setup, and a CSV fix list in Surjection Pro.

Surjection
Release

Gradient 0.3.0: check any two colors

gradient check measures any pair of colors against WCAG 2, shows the APCA value and suggests the closest color that passes. Plus Sass and TypeScript export.

Gradient