Skip to content

docs(plugin-e2e): document accessibility testing with Axe#2600

Open
tolzhabayev wants to merge 2 commits intomainfrom
docs/plugin-e2e-a11y-testing
Open

docs(plugin-e2e): document accessibility testing with Axe#2600
tolzhabayev wants to merge 2 commits intomainfrom
docs/plugin-e2e-a11y-testing

Conversation

@tolzhabayev
Copy link
Copy Markdown
Collaborator

@tolzhabayev tolzhabayev commented Apr 29, 2026

Summary

The new section covers the basic scan + assert flow, scoping with include/exclude, passing through axe-core run options, and tuning the assertion with threshold and ignoredRules. It also notes that the API is @alpha.

Test plan

  • `npm run docs` and verify the new section renders correctly on `/e2e-test-a-plugin/test-a-panel-plugin`
  • Check that the e2e overview page (`/e2e-test-a-plugin`) lists the new "Accessibility testing" feature bullet
  • Verify all links resolve (Axe homepage, WCAG 2.1 spec, axe-core options docs, GitHub feedback link)

Adds a "Test for accessibility violations" section to the panel plugin
testing guide covering the new scanForA11yViolations fixture and
toHaveNoA11yViolations matcher introduced in #2462, and adds the
accessibility capability to the e2e overview feature list.
Copilot AI review requested due to automatic review settings April 29, 2026 10:25
@tolzhabayev tolzhabayev requested a review from a team as a code owner April 29, 2026 10:25
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged. It will not be considered when calculating future versions of the npm packages and will not appear in the changelogs.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation for running accessibility (a11y) scans in @grafana/plugin-e2e tests using Axe, and surfaces this capability on the e2e docs landing page.

Changes:

  • Adds a new “Test for accessibility violations” section to the panel plugin e2e testing guide, including examples for scanning, scoping, and assertion tuning.
  • Updates the e2e overview page to list accessibility testing as a supported capability.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
docusaurus/docs/e2e-test-a-plugin/test-a-panel-plugin.md Documents the scanForA11yViolations fixture and toHaveNoA11yViolations matcher, with examples and guidance.
docusaurus/docs/e2e-test-a-plugin/index.md Adds an “Accessibility testing” bullet to the overview capability list.

Comment thread docusaurus/docs/e2e-test-a-plugin/test-a-panel-plugin.md

```ts
const report = await scanForA11yViolations({
include: '[data-testid="data-testid panel content"]',
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The include example selector ([data-testid="data-testid panel content"]) looks incorrect/unlikely to match any element (it repeats data-testid and uses a space-containing value). Replace it with a realistic selector (or a placeholder like your panel root selector) so readers can copy/paste an example that works.

Suggested change
include: '[data-testid="data-testid panel content"]',
include: '[data-testid="panel-content"]',

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original [data-testid="data-testid panel content"] is actually the real Grafana selector (Grafana's e2e-selectors prefix data-testid values with the literal string data-testid — see selectors.components.Panels.Panel.content in @grafana/e2e-selectors), so the suggested [data-testid="panel-content"] would not match anything. That said, fair point that it looks confusing and doesn't tell plugin authors anything about scoping to their panel. Switched the example to a plugin-author-owned [data-testid="my-panel-root"] in 0ebf9a1, which is more useful for this guide anyway.

`@grafana/plugin-e2e` ships with an [Axe](https://www.deque.com/axe/)-powered `scanForA11yViolations` fixture and a `toHaveNoA11yViolations` matcher so you can catch accessibility regressions in your panel as part of your end-to-end suite. By default the scan runs the WCAG 2.0 and 2.1 A and AA rule sets, which match Grafana's [WCAG 2.1 AA](https://www.w3.org/TR/WCAG21/) target.

:::note
The accessibility scanning APIs are currently `@alpha` — the surface may change before becoming stable. Feedback is welcome on [GitHub](https://github.com/grafana/plugin-tools/issues).
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the note, "are currently" uses present continuous tense. Consider rewriting in present simple to match the docs style guide (for example, "The accessibility scanning APIs are @alpha. The surface may change before it becomes stable.").

Suggested change
The accessibility scanning APIs are currently `@alpha` — the surface may change before becoming stable. Feedback is welcome on [GitHub](https://github.com/grafana/plugin-tools/issues).
The accessibility scanning APIs are `@alpha`. The surface may change before it becomes stable. Feedback is welcome on [GitHub](https://github.com/grafana/plugin-tools/issues).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 0ebf9a1.

@tolzhabayev tolzhabayev added type/docs Changes only affect the documentation no-changelog Don't include in changelog and version calculations labels Apr 29, 2026
- Note that @axe-core/playwright is an optional peer dep that must be
  installed
- Switch the include example to a plugin-author-owned data-testid so
  the snippet is meaningful in a plugin dev guide and avoids exposing
  Grafana's internal selector convention
- Tighten the @Alpha note to present simple
@tolzhabayev tolzhabayev requested a review from Copilot April 29, 2026 10:35
@grafana-plugins-platform-bot grafana-plugins-platform-bot Bot moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@sunker
Copy link
Copy Markdown
Contributor

sunker commented Apr 29, 2026

Thanks for raising the PR @tolzhabayev

We intentionally held off on documenting or announcing this feature so we could refine the reporter first. After it's stable in grafana/grafana, we'll move it into plugin-e2e. For more context, see the discussion
and the related issue. @fastfrwrd, any findings after running the a11y tests in grafana over the past two months?

Copy link
Copy Markdown
Contributor

@fastfrwrd fastfrwrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice!

@fastfrwrd
Copy link
Copy Markdown
Contributor

@sunker nothing too interesting on the reporter side honestly, we actually opted to not invest further into the reporter because we stopped relying on a bespoke report format and just rely on the pass/fail of the e2es and the tags to tell what happened now. I can start to investigate moving that over soon.

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

Labels

no-changelog Don't include in changelog and version calculations type/docs Changes only affect the documentation

Projects

Status: 🔬 In review

Development

Successfully merging this pull request may close these issues.

4 participants