Add accessibility testing with @axe-core/playwright#141
Draft
rameziophobia wants to merge 10 commits into
Draft
Conversation
Depends on shaka-accessibility and wires createAxeCommand() alongside compare and twins-* commands. Drops --controlURL from the axe command since axe only scans the experiment server.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Collaborator
Author
|
@claude review this PR |
…ct shape Updates combineStatus precedence to error > regression > visual_change > a11y_violation > improvement > no_difference per AXE_A11Y_REQUIREMENTS.md §3.2.
Adds: - compare/engine-bridge/axe.ts thin wrapper around shaka-accessibility runAxe - compare/harvest/axe.ts projects AxeRunArtifact into CategoryResult, truncates html to 500 chars and failureSummary to 2000 chars per AXE_A11Y_REQUIREMENTS.md §4.2 (on-disk artifact keeps originals) - 'axe' in DEFAULT_CATEGORIES and VALID_CATEGORIES - summarizeFailures() includes a11y violation counter - axe in abtests.config.ts schema (re-exports AxeGlobalConfigSchema) - --skip-engines already re-harvests axe-report.json (no new code path)
- AxeSlot.tsx renders one card per viewport with clean/violation pills, collapsible rule rows sorted by impact, per-node target breadcrumbs (including iframe/shadow descents), and a link to axe's helpUrl. - CategorySlot hides the a11y slot entirely when options.axe.skip is true (requirement 3.10). - App.tsx + StatusFilter + labels.ts pick up the new a11y_violation status so the filter bar, section headers, and grouping all flow through without further wiring. - TestCard emits an A11Y pill with top rule IDs (noisiest first, +N more fallback) mirroring perf's REGRESSED pattern. - styles.css adds a distinct magenta --a11y_violation token so the pill and card border-left read separately from the indigo --error purple.
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.
Summary
This PR introduces a complete accessibility testing framework to shaka-perf using @axe-core/playwright. It adds a new
shaka-accessibilitypackage with CLI integration, configuration management, and artifact generation for accessibility scanning.Key Changes
New
shaka-accessibilitypackage with:runner.ts: Core axe scanning engine that runs accessibility tests against experiment server, manages browser lifecycle, handles concurrent viewport scanning with configurable limits, and writes JSON artifactsconfig.ts: Zod-based configuration schemas for global and per-test axe settings with merge logic (tags replace, disableRules union, includeRules replace, viewports replace)types.ts: TypeScript types for violations, scans, and artifacts with stable on-disk formatcli/program.ts: Commander-based CLI command for standalone axe runscli/run.ts: Command handler that loads tests via shaka-shared, resolves config, and orchestrates the runConfiguration features:
includeRules(requirement 3.6)failOnViolationflag to control CI gatingRunner implementation:
<resultsRoot>/<slug>/axe-report.jsonmatching compare layout (requirement 3.7)Integration with shaka-perf:
TestType.Accessibilityenum valueAbTestAxeConfiginterface to test optionscreateAxeCommandinto main CLIshaka-perfto depend onshaka-accessibilityPackage metadata: Updated descriptions, added exports for CLI subpath, configured public npm publishing
Notable Implementation Details
https://claude.ai/code/session_019pEe9aVhJNZEhoqtAq9DFi