mirror of
https://github.com/magnus919/agent-skills.git
synced 2026-09-18 23:16:38 +03:00
ac1beb117d
Add ONE tool skill for Playwright: SKILL.md covering E2E test authoring, selector robustness, network interception/mocking, parallel workers, CI integration, scraping/headless patterns, accessibility snapshot checks, and headed debugging; scripts/pwrun (agent-first smoke harness with --json, fixture-tested); templates/ test-suite scaffold; eight dated references; a schema-valid evals/evals.json (6 cases); a human-facing README; reverse routing from qa-methodology and frontend-engineering; top-level README index entry; and regenerated catalogs (llms.txt, marketplace, codex). Closes #244. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import AxeBuilder from '@axe-core/playwright';
|
|
|
|
/**
|
|
* Accessibility smoke scaffold.
|
|
*
|
|
* Requires: npm i -D @axe-core/playwright
|
|
*
|
|
* - The axe scan catches WCAG violations (contrast, landmarks, ARIA misuse).
|
|
* - The aria snapshot is a stable, accessibility-aware assertion: it compares
|
|
* the accessibility tree, so it catches structure and label regressions.
|
|
*
|
|
* When the aria snapshot legitimately changes, run
|
|
* `npx playwright test --update-snapshots` ONLY after reviewing the diff.
|
|
*/
|
|
test.describe('accessibility', () => {
|
|
test('home page has no critical or serious axe violations', async ({ page }) => {
|
|
await page.goto('/'); // [fill: route]
|
|
const results = await new AxeBuilder({ page }).analyze();
|
|
const blocking = results.violations.filter(
|
|
(violation) => violation.impact === 'critical' || violation.impact === 'serious',
|
|
);
|
|
expect(blocking).toEqual([]);
|
|
});
|
|
|
|
test('home page matches the aria snapshot', async ({ page }) => {
|
|
await page.goto('/');
|
|
await expect(page).toMatchAriaSnapshot(`
|
|
- heading "[fill: page heading]" [level=1]
|
|
- button "[fill: primary action]"
|
|
`);
|
|
});
|
|
});
|