Accessibility Steps

Accessibility checks the team can drop into any scenario. POUR smoke probes (landmarks, alt, labels, focus, lang) plus full axe-core audits. QA and DevOps gain compliance signal without bolting on a separate a11y tool.

Step phrasings in this group

The book sidebar lists each individual step page under this group.

Then every image should have an alt attribute

Assert every <img> on the page has an alt attribute.

Then every form field should have an accessible label

Assert every form input/select/textarea has an accessible name.

Then the page should have a main landmark

Assert the page has a primary <main> (or [role="main"]) landmark.

Then the page should have a navigation landmark

Assert the page has at least one navigation landmark.

Then the page should have exactly one h1

Assert the page has exactly one <h1>.

Then the focused element should match "#email"

Assert the currently focused element matches a CSS selector.

Then the focused element should be labeled "Email"

Assert the currently focused element's accessible name contains text.

Then the page should declare a language

Assert the document has a lang attribute on <html>.

Then the page language should be "en"

Assert the document lang equals an expected value.

Then the heading hierarchy should be valid

Assert headings appear in non-skipping order (h1 → h2 → h3 never

Then the page should have a skip link

Assert the page exposes a skip-link as the first focusable element. WCAG

Then every button should have an accessible name

Assert every <button> / role="button" has an accessible name (visible

Then every link should have an accessible name

Assert every <a> has an accessible name.

Then no element should have a positive tabindex

Assert NO interactive element uses a positive tabindex. Positive values

Then every ARIA reference should resolve

Assert every aria-labelledby / aria-describedby / aria-controls

Then every ARIA role should be valid

Assert no element uses an invalid ARIA role. Reference: WAI-ARIA 1.2.

Then required fields should be consistently marked

Assert every form field exposing aria-required="true" is also marked

Then the page should have a title

Assert the document has a non-empty <title>. WCAG 2.4.2.

Then user zoom should be allowed

Assert the viewport meta tag does not disable user-scaling

Then the page should pass an accessibility audit

Run an axe-core audit and assert ZERO violations across the supplied WCAG

Then the page should have no critical accessibility violations

Assert NO axe violations of the given impact severity.

Then the element "main" should pass an accessibility audit

Audit ONLY the subtree under a CSS selector. Use when third-party widgets

Then the page should pass an accessibility audit excluding "iframe.payment"

Audit the page but EXCLUDE the subtree under a CSS selector. Skip

Then the page should not violate the accessibility rule "color-contrast"

Assert a specific axe rule does not fire. Use for fine-grained gates

Then I print accessibility violations

Print every axe violation to stdout (debug aid). Strip from CI runs.

Then the page should pass the accessibility rules "image-alt, label"

Assert axe finds zero violations of an exact list of rules. Use for

Back to all step groups