pw-accessibility-auditor
Integrates automated accessibility checks into Playwright tests using axe-core. Use when an SDET says "add a11y checks", "run axe on this page", "audit accessibility", "check WCAG compliance", or "triage these accessibility violations". Produces @axe-core/playwright-based tests, severity triage, and WCAG mapping — a draft the engineer runs, knowing axe catches only ~30-40%.
- License 许可
- MIT
- 最近更新
- 2026-07-15
- Stars
- ★ 4
- Forks
- 8
01 前言 Front Matter
- name
- pw-accessibility-auditor
- license
- MIT
- metadata
- { "pack": "playwright", "author": "TheTestingAcademy", "version": "1.0.0" }
- description
- Integrates automated accessibility checks into Playwright tests using axe-core. Use when an SDET says "add a11y checks", "run axe on this page", "audit accessibility", "check WCAG compliance", or "triage these accessibility violations". Produces @axe-core/playwright-based tests, severity triage, and WCAG mapping — a draft the engineer runs, knowing axe catches only ~30-40%.
03 SKILL.md 正文
PW Accessibility Auditor
You wire in automated a11y checks the engineer must run and supplement with manual testing — axe catches only a fraction of issues, never all of them.
When to use
- A page/component needs automated accessibility coverage.
- Someone wants to triage or gate on axe violations.
- Someone says "add a11y checks", "map these to WCAG".
Workflow
- Integrate
@axe-core/playwright— runAxeBuilderafter the page reaches a stable state (web-first assertion first), scanning the real rendered DOM. - Scope the scan —
.include()/.exclude()to target the component under test and skip known third-party widgets; tag rules (wcag2a,wcag2aa) to the standard you're holding the product to. - Triage violations by impact —
critical/serious/moderate/minor. Gate the build on critical+serious; log the rest as debt, don't silently pass. - Map each violation to WCAG — axe returns
tagsandhelpUrl; surface the success criterion (e.g. 1.4.3 contrast, 4.1.2 name/role/value) so it's actionable. - Flag the coverage gap — remind that keyboard, focus order, screen-reader, and cognitive checks need a human; automation is the floor, not the ceiling.
Output shape
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';
test('checkout page has no critical a11y violations', async ({ page }) => {
await page.goto('/checkout');
await expect(page.getByRole('heading', { name: 'Checkout' })).toBeVisible();
const results = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa'])
.exclude('#third-party-widget')
.analyze();
const blocking = results.violations.filter(
(v) => v.impact === 'critical' || v.impact === 'serious');
expect(blocking, JSON.stringify(blocking, null, 2)).toEqual([]);
});
Guardrails
- Automated axe checks are the floor — this is a draft the engineer must run and back with manual keyboard/screen-reader testing; never claim "fully accessible".
- Never assume a selector/testid exists; scan the real rendered DOM after it settles.
- Don't fabricate WCAG criteria — use the
tags/helpUrlaxe actually returns. - Gate on critical/serious; record the rest as tracked debt, don't drop it.
04 同仓库更多 Skills
se-wait-fixer
Scans Selenium Java code for Thread.sleep and for implicit+explicit wait mixing, then replaces them with WebDriverWait/ExpectedConditions or FluentWait to fix synchronization. Use when an SDET says "remove Thread.sleep from my tests", "fix the flaky waits", "my implicit and explicit waits conflict", or pastes code full of hard sleeps. Produces refactors the engineer must run and confirm.
se-test-generator
Generates a runnable Selenium 4 + TestNG test in Java from a plain-language scenario, using explicit waits and stable locators. Use when an SDET says "write a Selenium test for login", "generate a TestNG test for the checkout flow", "automate this scenario in Selenium", or pastes Gherkin/steps and wants Java WebDriver code. Produces a draft test the engineer must review and run.
se-report-integrator
Integrates reporting (Allure or ExtentReports) into a Selenium + TestNG suite with listeners, screenshot-on-failure, and step logging. Use when an SDET says "add Allure to my tests", "set up ExtentReports", "capture a screenshot on failure", "add a TestNG listener for reporting", or wants readable run reports. Produces listener and config code the engineer must run to generate a report.
se-page-object-builder
Builds a Page Object Model class in Java (PageFactory @FindBy or explicit locators) with action methods and a WebDriverWait for a given page. Use when an SDET says "create a page object for the login page", "build a POM class", "refactor these locators into a page object", or pastes a page's fields and wants a reusable POM. Produces a draft class the engineer must review and run.
se-locator-strategist
Recommends and repairs Selenium locator strategy — replaces brittle absolute XPath with By.id, By.cssSelector, or Selenium 4 relative locators, and explains the trade-offs. Use when an SDET says "this XPath keeps breaking", "make this locator more stable", "why is my locator flaky", "convert this XPath to CSS", or pastes selectors to harden. Produces proposals the engineer must verify in the DOM.
se-grid-configurator
Configures Selenium Grid 4 (hub-and-node or standalone, including Docker) and wires RemoteWebDriver for parallel and distributed runs. Use when an SDET says "set up Selenium Grid", "run my tests on a remote grid", "dockerize Selenium Grid 4", "point my tests at RemoteWebDriver", or wants parallel execution across nodes. Produces config and code the engineer must run and validate in their environment.