Skip to content

Automated checks for accessibility rules and standards #12018

Open
@saw-jan

Description

@saw-jan

Automated Checks for Accessibility Rules

Accessibility issues like these (but not all) could have an automated checks:

Why automate?

  • Checking a11y rules is easy and quicker than manual
  • Checks can be brought to the CI pipeline
  • Early accessibility assessment

Why not depend on automated tests ONLY?

  • Automated tests can only check if certain rules have been applied to certain elements or not
  • Cannot guarantee the accessibility of a complete feature

Available Tools

Manual

Automation

POC

Reports

Lighthouse Accessibility Insights
Screenshot from 2024-12-06 10-50-33 Screenshot from 2024-12-06 10-50-55

Automated (axe-core):

{
  "description": "Ensure buttons have discernible text",
  "help": "Buttons must have discernible text",
  "helpUrl": "https://dequeuniversity.com/rules/axe/4.10/button-name?application=playwright",
  "id": "button-name",
  "impact": "critical",
  "failureSummary": "Fix any of the following:
    Element does not have inner text that is visible to screen readers
    aria-label attribute does not exist or is empty
    aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
    Element has no title attribute
    Element does not have an implicit (wrapped) <label>
    Element does not have an explicit <label>
    Element's default semantics were not overridden with role=\"none\" or role=\"presentation\"",
  "html": "<button data-v-babade49=\"\" type=\"button\" class=\"oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-ml-xs\" id=\"users-filter-confirm\">",
  "none": [],
  "target": ["#users-filter-confirm"],
  "tags": [
    "cat.name-role-value",
    "wcag2a",
    "wcag412",
    "section508",
    "section508.22.a",
    "TTv5",
    "TT6.a",
    "EN-301-549",
    "EN-9.4.1.2",
    "ACT"
  ]
}

Proposal

Add automated accessibility checks:

  • Rules checks - in ONE of the following forms
    • Component level
    • Separate e2e (Playwright)
    • Integrate with existing e2e (Playwright - Cucumber)
  • Keyboard only navigation - e2e (?)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions