feat(studio): add @axe-core/playwright accessibility harness#465
Conversation
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>
📝 WalkthroughWalkthroughAdds a Playwright axe helper for Studio e2e, installs the axe dependency, and adds an accessibility test for ChangesStudio accessibility e2e
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/packages/studio/e2e-tests/a11y/a11y.test.ts (1)
47-48: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winReplace the
networkidlewait 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
⛔ Files ignored due to path filters (1)
web/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
web/packages/studio/e2e-tests/a11y/a11y.test.tsweb/packages/studio/e2e-tests/a11y/axe.tsweb/packages/studio/package.json
|
|
This needs to be closed before we can merge: https://nvbugspro.nvidia.com/bug/6377614 |
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
Bug Fixes
Chores