.cursor/skills/qa-accessibility-test-writer/SKILL.md
Generate accessibility tests for WCAG 2.2 compliance using axe-core, Pa11y, and Lighthouse with automated checks for ARIA patterns, keyboard navigation, color contrast, and screen reader support.
npx skillsauth add AZANIR/qa-skills qa-accessibility-test-writerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write accessibility tests ensuring WCAG 2.2 compliance. Transform NFR accessibility criteria (from qa-nfr-analyst) and application context into executable accessibility test scripts using axe-core, Pa11y, and Lighthouse. Support automated checks for ARIA patterns, keyboard navigation, focus management, color contrast, text alternatives, semantic HTML, form labels, skip links, responsive text sizing, and screen reader compatibility.
| Level | Description | Typical Use | |-------|--------------|-------------| | A | Minimum; required for basic accessibility | Legal baseline | | AA | Standard target; addresses major barriers | Most projects | | AAA | Enhanced; highest conformance | Specialized contexts |
See references/wcag-tests.md for test scenarios per success criteria with code examples.
| Tool | Purpose | |------|---------| | axe-core | Programmatic WCAG checks; integrates with Playwright, Cypress, Jest | | Pa11y | CLI + Node API; batch page audits, CI integration | | Lighthouse | Chrome DevTools Protocol; full accessibility audit with scores |
| Category | Techniques | Tools | |----------|-------------|-------| | ARIA patterns | Roles, states, properties, live regions | axe-core | | Keyboard navigation | Tab order, focus traps, shortcuts | Playwright/Cypress | | Focus management | Visible focus, focus order, skip links | axe-core, custom | | Color contrast | 4.5:1 (normal), 3:1 (large) | axe-core, Lighthouse | | Text alternatives | Alt text, aria-label, captions | axe-core | | Semantic HTML | Headings, landmarks, lists | axe-core | | Form labels | Labels, error identification, autocomplete | axe-core, custom | | Skip links | Bypass blocks (2.4.1) | axe-core, custom | | Responsive text sizing | 200% resize, reflow | Lighthouse, custom | | Screen reader compatibility | Name, role, value (4.1.2) | axe-core, manual |
references/wcag-tests.md)| Framework | Package | Usage |
|-----------|---------|-------|
| Playwright | @axe-core/playwright | await expect(page).toPassAxe() or axe.run(page) |
| Cypress | cypress-axe | cy.injectAxe(); cy.checkA11y() |
| Jest | jest-axe | expect(container).toHaveNoViolations() (React Testing Library) |
See references/axe-core-patterns.md for integration patterns and examples.
tests/accessibility/ or e2e/a11y/ with TS/JS filesreferences/wcag-tests.md — WCAG 2.2 test scenarios per success criteria with code examplesreferences/axe-core-patterns.md — axe-core integration patterns for Playwright, Cypress, Jestreferences/best-practices.md — Automated vs manual, screen reader testing, keyboard testingCan do (autonomous):
Cannot do (requires confirmation):
Will not do (out of scope):
*.a11y.spec.ts or test_*_accessibility.ts| Symptom | Likely Cause | Fix |
|---------|--------------|-----|
| axe-core reports no violations but page is inaccessible | Dynamic content not loaded, shadow DOM | Wait for content; use include for shadow roots |
| False positives (decorative images) | axe flags alt="" on img | Use aria-hidden="true" or role="presentation" for decorative |
| Pa11y timeout | Slow page load, SPA | Increase timeout; wait for network idle |
| Lighthouse score inconsistent | Network variance, animations | Run multiple times; use median; disable animations |
| Keyboard test fails (focus not visible) | Custom focus styles missing | Add :focus-visible styles; verify in test |
| cypress-axe "injectAxe" fails | Page not ready | Call cy.injectAxe() after cy.visit and content load |
tools
Analyze OpenAPI/Swagger spec (JSON or YAML) against existing test files and generate an HTML coverage report with QA automation tasks. Use when user provides an OpenAPI spec file and wants to know test coverage status.
testing
Universal QA plan generator supporting 10 plan types including test plans, sprint plans, regression plans, release plans, UAT plans, performance plans, migration plans, onboarding plans, and custom plans.
development
Generate consumer-driven contract tests using Pact for JavaScript and Python to verify microservice API compatibility between consumer and provider.
development
Master skill coordinating all QA skills through pipeline modes (full-cycle, docs-only, testcases-only, write-tests, report), formalized handoff chains, scheduler rules, and framework/language selection based on project context.