@surea11y/playwright 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -7
- package/package.json +19 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @surea11y/playwright
|
|
2
2
|
|
|
3
|
-
A Playwright binding for [`@surea11y/core`](https://github.com/
|
|
3
|
+
A Playwright binding for [`@surea11y/core`](https://github.com/SureA11y/core) — scans a real, already-rendered page for accessibility issues using surea11y's DOM-rules engine.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -33,7 +33,7 @@ console.log(results.checksResults.filter(r => r.outcome === 'fail'));
|
|
|
33
33
|
await browser.close();
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
`results` is `@surea11y/core`'s own native result shape — see its [`OUTPUT_SCHEMA.md`](https://github.com/
|
|
36
|
+
`results` is `@surea11y/core`'s own native result shape — see its [`OUTPUT_SCHEMA.md`](https://github.com/SureA11y/core/blob/main/docs/OUTPUT_SCHEMA.md) — not the `violations`/`passes`/`incomplete`/`inapplicable` shape used by other popular accessibility testing tools. The builder's *method names* are modeled on common conventions in this space for migration familiarity; the richer result schema is kept as-is.
|
|
37
37
|
|
|
38
38
|
Also see `examples/basic-scan.js` for a runnable script (`npm run example -- <url>`).
|
|
39
39
|
|
|
@@ -141,7 +141,7 @@ const results = await new A11yCoreBuilder({ page })
|
|
|
141
141
|
.analyze();
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
-
A custom rule descriptor is the same shape as one of `@surea11y/core`'s own internal rule modules (`{ id, meta, runInPage, applicability?, data? }`) — see its [`ENGINE_OPTIONS.md`](https://github.com/
|
|
144
|
+
A custom rule descriptor is the same shape as one of `@surea11y/core`'s own internal rule modules (`{ id, meta, runInPage, applicability?, data? }`) — see its [`ENGINE_OPTIONS.md`](https://github.com/SureA11y/core/blob/main/docs/ENGINE_OPTIONS.md) for the full contract. Results appear in `checksResults` exactly like a built-in rule's, including automatic `selector`/`html`/`structuralPath` fill-in. Registered per-scan only (nothing persists between calls or shows up in any catalog listing), and a custom rule whose `id` collides with a built-in one overrides it for that scan.
|
|
145
145
|
|
|
146
146
|
Pass an array to register several at once, or call `.withCustomRules()` again to add more — like `.withRules()`/`.withTags()`, it accumulates rather than replacing what was already registered:
|
|
147
147
|
|
|
@@ -158,7 +158,7 @@ Invalid input (a missing/empty `id`, or a `runInPage`/`applicability` that's nei
|
|
|
158
158
|
|
|
159
159
|
### Element addressing beyond a CSS selector
|
|
160
160
|
|
|
161
|
-
Every occurrence already carries `selector` and (with `.elementRef(true)`, above) a live `ElementHandle`. It also carries `structuralPath` — a sibling-index path from the document root down to the flagged element (e.g. `[1, 0, 2]`) — a more robust identity than a selector string alone, since it survives some DOM changes a selector wouldn't (an id/class rename, for instance). No opt-in needed; it's already on every `fail`/`cantTell` occurrence today. See [`OUTPUT_SCHEMA.md`](https://github.com/
|
|
161
|
+
Every occurrence already carries `selector` and (with `.elementRef(true)`, above) a live `ElementHandle`. It also carries `structuralPath` — a sibling-index path from the document root down to the flagged element (e.g. `[1, 0, 2]`) — a more robust identity than a selector string alone, since it survives some DOM changes a selector wouldn't (an id/class rename, for instance). No opt-in needed; it's already on every `fail`/`cantTell` occurrence today. See [`OUTPUT_SCHEMA.md`](https://github.com/SureA11y/core/blob/main/docs/OUTPUT_SCHEMA.md) for the full field description.
|
|
162
162
|
|
|
163
163
|
## TypeScript
|
|
164
164
|
|
|
@@ -166,12 +166,16 @@ Every occurrence already carries `selector` and (with `.elementRef(true)`, above
|
|
|
166
166
|
|
|
167
167
|
## Building another framework binding?
|
|
168
168
|
|
|
169
|
-
See `@surea11y/core`'s [`BINDING_AUTHORS_GUIDE.md`](https://github.com/
|
|
169
|
+
See `@surea11y/core`'s [`BINDING_AUTHORS_GUIDE.md`](https://github.com/SureA11y/core/blob/main/docs/BINDING_AUTHORS_GUIDE.md) — a reference for building a new binding, covering which parity features are engine-level (work through a generic `.options()`/`runOnly` passthrough with zero binding code, including WCAG-version tag filtering) vs. binding-layer (element refs, `reportOnly`-style verbosity filtering, the `page.evaluate()` serialization-boundary caveat that `.withCustomRules()` exists to paper over).
|
|
170
170
|
|
|
171
|
-
`A11yCoreBuilder` here extends `A11yCoreBuilderBase` from [`@surea11y/binding-base`](https://github.com/
|
|
171
|
+
`A11yCoreBuilder` here extends `A11yCoreBuilderBase` from [`@surea11y/binding-base`](https://github.com/SureA11y/binding-base), a small shared package holding the scaffolding common to every framework binding. A new binding should depend on that package from the start.
|
|
172
|
+
|
|
173
|
+
## Maintainer
|
|
174
|
+
|
|
175
|
+
Maintained by [Jorge Rumoroso](https://github.com/rumoroso).
|
|
172
176
|
|
|
173
177
|
## License
|
|
174
178
|
|
|
175
179
|
MIT — see [`LICENSE`](./LICENSE).
|
|
176
180
|
|
|
177
|
-
This package depends on [`@surea11y/core`](https://github.com/
|
|
181
|
+
This package depends on [`@surea11y/core`](https://github.com/SureA11y/core), which is MPL-2.0. MPL-2.0's copyleft is file-level and applies only to `@surea11y/core`'s own source files; consuming it as a normal package dependency doesn't affect this package's license.
|
package/package.json
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surea11y/playwright",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Playwright binding for surea11y -- scan real, live-rendered pages for accessibility issues.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"accessibility",
|
|
7
|
+
"a11y",
|
|
8
|
+
"wcag",
|
|
9
|
+
"wcag22",
|
|
10
|
+
"accessibility-testing",
|
|
11
|
+
"playwright",
|
|
12
|
+
"e2e",
|
|
13
|
+
"e2e-testing",
|
|
14
|
+
"audit",
|
|
15
|
+
"aria",
|
|
16
|
+
"surea11y"
|
|
17
|
+
],
|
|
5
18
|
"main": "src/index.js",
|
|
6
19
|
"types": "src/index.d.ts",
|
|
7
20
|
"author": "Jorge Rumoroso",
|
|
8
21
|
"license": "MIT",
|
|
9
22
|
"repository": {
|
|
10
23
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
24
|
+
"url": "git+https://github.com/SureA11y/playwright.git"
|
|
12
25
|
},
|
|
13
|
-
"homepage": "https://github.com/
|
|
26
|
+
"homepage": "https://github.com/SureA11y/playwright#readme",
|
|
14
27
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/
|
|
28
|
+
"url": "https://github.com/SureA11y/playwright/issues"
|
|
16
29
|
},
|
|
17
30
|
"engines": {
|
|
18
|
-
"node": "
|
|
31
|
+
"node": "^20.19.0 || ^22.13.0 || >=24.0.0"
|
|
19
32
|
},
|
|
20
33
|
"publishConfig": {
|
|
21
34
|
"access": "public"
|
|
@@ -36,7 +49,7 @@
|
|
|
36
49
|
"playwright": "^1.61.1"
|
|
37
50
|
},
|
|
38
51
|
"scripts": {
|
|
39
|
-
"test": "node --test
|
|
52
|
+
"test": "node --test tests/*.test.js",
|
|
40
53
|
"example": "node examples/basic-scan.js",
|
|
41
54
|
"example:e2e": "playwright test examples/playwright-test-example.spec.js"
|
|
42
55
|
}
|