{"id":45167829,"url":"https://github.com/accesslint/playwright","last_synced_at":"2026-02-23T10:00:44.581Z","repository":{"id":338922082,"uuid":"1159711897","full_name":"AccessLint/playwright","owner":"AccessLint","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-20T00:44:27.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-20T09:33:38.300Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AccessLint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-17T04:12:53.000Z","updated_at":"2026-02-20T00:44:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AccessLint/playwright","commit_stats":null,"previous_names":["accesslint/playwright"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/AccessLint/playwright","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fplaywright","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fplaywright/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fplaywright/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fplaywright/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AccessLint","download_url":"https://codeload.github.com/AccessLint/playwright/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AccessLint%2Fplaywright/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29676972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-20T07:30:35.417Z","updated_at":"2026-02-21T08:00:55.097Z","avatar_url":"https://github.com/AccessLint.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @accesslint/playwright\n\nAccessibility assertions for Playwright. Adds a `toBeAccessible()` matcher powered by [AccessLint](https://www.accesslint.com?ref=readme_playwright) that checks for WCAG 2.1 Level A and AA violations.\n\n## Installation\n\n```sh\nnpm install --save-dev @accesslint/playwright\n```\n\n`@playwright/test` \u003e= 1.40 is required as a peer dependency.\n\n## Setup\n\nImport `@accesslint/playwright` in your test file to auto-register the `toBeAccessible()` matcher:\n\n```ts\nimport \"@accesslint/playwright\";\n```\n\n### Manual registration\n\nIf you prefer to register the matcher yourself:\n\n```ts\nimport { accesslintMatchers } from \"@accesslint/playwright/matchers\";\nimport { expect } from \"@playwright/test\";\n\nexpect.extend(accesslintMatchers);\n```\n\n## Usage\n\n### Page-level assertions\n\n```ts\nimport { test, expect } from \"@playwright/test\";\nimport \"@accesslint/playwright\";\n\ntest(\"homepage is accessible\", async ({ page }) =\u003e {\n  await page.goto(\"https://example.com\");\n  await expect(page).toBeAccessible();\n});\n```\n\n### Scoping to a locator\n\nThe matcher accepts a `Locator` to scope violations to a specific region of the page:\n\n```ts\ntest(\"navigation is accessible\", async ({ page }) =\u003e {\n  await page.goto(\"https://example.com\");\n  await expect(page.locator(\"nav\")).toBeAccessible();\n});\n```\n\n### Disabling rules\n\nTo ignore specific rules, pass `disabledRules`:\n\n```ts\nawait expect(page).toBeAccessible({\n  disabledRules: [\"accesslint-092\"],\n});\n```\n\n### Snapshot baselines\n\nWhen you have existing violations that can't be fixed immediately, snapshot baselines let you track them without blocking your test suite. The first run captures a baseline; subsequent runs only fail if **new** violations appear:\n\n```ts\nawait expect(page).toBeAccessible({ snapshot: \"dashboard\" });\n```\n\nSnapshots are stored in `accessibility-snapshots/` and should be committed to version control. Violations are identified by stable Playwright selectors (like `getByRole('img')`) so snapshots survive class-name and ID churn.\n\nWhen violations are fixed, the baseline ratchets down automatically. To force-update all snapshots to the current state:\n\n```sh\nnpx playwright test -u\n# or\nACCESSLINT_UPDATE=1 npx playwright test\n```\n\n### Standalone function\n\nFor more control, use `accesslintAudit` directly to get the full audit result:\n\n```ts\nimport { accesslintAudit } from \"@accesslint/playwright\";\n\ntest(\"check specific violations\", async ({ page }) =\u003e {\n  await page.goto(\"https://example.com\");\n  const result = await accesslintAudit(page);\n  console.log(result.violations);\n});\n```\n\n### Failure messages\n\nWhen violations are found, the matcher reports each one with its rule ID, WCAG level, success criterion, description, and the selector of the offending element:\n\n```\nExpected no accessibility violations, but found 2:\n\n  accesslint-011 [A] (1.1.1): Image element missing alt attribute.\n    body \u003e img\n\n  accesslint-092 [AA] (1.4.3): Text must have sufficient color contrast.\n    p.subtitle\n```\n\n## What it checks\n\nThe matcher runs 93 WCAG 2.1 Level A and AA rules via `@accesslint/core`, covering images, forms, ARIA attributes, color contrast, landmarks, links, tables, document language, and more.\n\n## TypeScript\n\nTypes are included. Importing the package augments Playwright's `expect` with `toBeAccessible()` automatically.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccesslint%2Fplaywright","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faccesslint%2Fplaywright","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faccesslint%2Fplaywright/lists"}