Skip to content

feat(studio): add @axe-core/playwright accessibility harness#465

Open
aray12 wants to merge 1 commit into
mainfrom
astd-204-a11y-rebased
Open

feat(studio): add @axe-core/playwright accessibility harness#465
aray12 wants to merge 1 commit into
mainfrom
astd-204-a11y-rebased

Conversation

@aray12

@aray12 aray12 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Install @axe-core/playwright and expose a runAxeScan() helper that runs AxeBuilder with wcag2a/2aa/21a/21aa/22a/22aa tags. Add an a11y.test.ts that intercepts all NMP API calls with page.route() mocks (no live backend required) and runs axe against the workspace dashboard.

Summary by CodeRabbit

  • New Features

    • Added automated accessibility coverage for Studio routes using Playwright.
    • Introduced a reusable accessibility scan helper for WCAG A/AA checks.
  • Bug Fixes

    • Added a test for the default dashboard route to verify it has no accessibility violations.
    • Mocked API responses and disabled authentication in the test run to make checks reliable and repeatable.
  • Chores

    • Added accessibility testing support as a development dependency.

Install @axe-core/playwright and expose a runAxeScan() helper that runs
AxeBuilder with wcag2a/2aa/21a/21aa/22a/22aa tags. Add an a11y.test.ts
that intercepts all NMP API calls with page.route() mocks (no live backend
required) and runs axe against the workspace dashboard.

Signed-off-by: Alex Ray <alray@nvidia.com>
@aray12 aray12 requested review from a team as code owners June 25, 2026 18:04
@github-actions github-actions Bot added the feat label Jun 25, 2026
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Playwright axe helper for Studio e2e, installs the axe dependency, and adds an accessibility test for /workspaces/default/dashboard that mocks API calls, disables auth, runs the scan, and reports formatted violations.

Changes

Studio accessibility e2e

Layer / File(s) Summary
Axe scan helper
web/packages/studio/e2e-tests/a11y/axe.ts, web/packages/studio/package.json
Adds the Playwright axe helper, exported scan result type, and the @axe-core/playwright dev dependency.
Dashboard axe test
web/packages/studio/e2e-tests/a11y/a11y.test.ts
Adds mocked API responses, auth setup, the dashboard accessibility scan, and violation formatting for the assertion message.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding an Axe accessibility testing harness to Studio.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch astd-204-a11y-rebased

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
web/packages/studio/e2e-tests/a11y/a11y.test.ts (1)

47-48: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Replace the networkidle wait with a page assertion.

Playwright marks waitForLoadState('networkidle') as discouraged for tests and recommends relying on assertions instead. This can make the axe test flaky if the dashboard keeps background requests open. (playwright.dev)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/packages/studio/e2e-tests/a11y/a11y.test.ts` around lines 47 - 48, The
a11y test is using a discouraged network idle wait after navigating to the
dashboard, which can make the test flaky when background requests stay open. In
the page flow inside the test that calls page.goto on the dashboard, replace
page.waitForLoadState('networkidle') with a stable assertion against a
dashboard-specific element or state using Playwright assertions so the test
waits on visible page readiness instead of network quiescence.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@web/packages/studio/e2e-tests/a11y/a11y.test.ts`:
- Around line 47-48: The a11y test is using a discouraged network idle wait
after navigating to the dashboard, which can make the test flaky when background
requests stay open. In the page flow inside the test that calls page.goto on the
dashboard, replace page.waitForLoadState('networkidle') with a stable assertion
against a dashboard-specific element or state using Playwright assertions so the
test waits on visible page readiness instead of network quiescence.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4c6118ee-78fd-4a97-bb48-f85d8e3819b4

📥 Commits

Reviewing files that changed from the base of the PR and between f542481 and 5ba591b.

⛔ Files ignored due to path filters (1)
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • web/packages/studio/e2e-tests/a11y/a11y.test.ts
  • web/packages/studio/e2e-tests/a11y/axe.ts
  • web/packages/studio/package.json

@github-actions

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 20910/27478 76.1% 61.2%
Integration Tests 12108/26247 46.1% 19.5%

@aray12

aray12 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

This needs to be closed before we can merge: https://nvbugspro.nvidia.com/bug/6377614

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants