docs: add accessibility testing guide for plugin-e2e - #2835
Open
fastfrwrd wants to merge 2 commits into
Open
Conversation
Document the scanForA11yViolations fixture and the toHaveNoA11yViolations matcher: installing the optional axe peer dependency, scanning full pages and subtrees, the default WCAG rule set, custom rules, and the two ways to exclude a rule. Closes #2484
fastfrwrd
requested review from
eledobleefe and
joshhunt
and removed request for
a team
August 19, 2026 20:05
fastfrwrd
commented
Aug 19, 2026
sunker
self-requested a review
August 21, 2026 07:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Adds a dedicated "Accessibility testing" guide to the E2E testing docs, covering the
scanForA11yViolationsfixture and thetoHaveNoA11yViolationsmatcher. Until now these APIs were only mentioned as a bullet in the@grafana/plugin-e2eREADME, so there was nowhere to point plugin authors.The guide covers everything listed in the issue:
@axe-core/playwrightpeer dependency.include/exclude, plus a note that they take CSS selectors rather than Playwright locators or Grafana end-to-end selectors, and a helper for converting the latter.DEFAULT_A11Y_TAGS).options, with a warning thatoptionsreplaces the default WCAG tags, sinceAxeBuilder.options()overwrites whatwithTags()set.options.rules) and at assertion time (ignoredRules), and why you'd pick one over the other.thresholdto hold the line on a plugin with existing violations.Which issue(s) this PR fixes:
Fixes #2484
Special notes for your reviewer:
plugin-e2etypes, and the Docusaurus production build passes with no broken links.toCssSelectorhelper in the "Scan part of a page" section exists becauseresolveGrafanaSelectorisn't part of the public API. If we'd rather export it, I'm happy to do that in a follow-up and simplify this section.