@surea11y/webdriverio 0.1.2 → 1.0.0

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 CHANGED
@@ -62,6 +62,8 @@ WebdriverIO v9 defaults to the WebDriver **BiDi** protocol. A long-lived session
62
62
 
63
63
  `withTags()`/`disableRules()` above have counterparts: `.withRules([...])` (only run these specific rule IDs) and `.disableTags([...])` (never run rules carrying any of these tags). All four compose the same way similar allow/deny-list options do in other accessibility testing tools, with one non-obvious rule worth knowing: a "disable" always wins over a "with" on the same ID/tag (e.g. `.withRules(['a']).disableRules(['a'])` drops `'a'` entirely), and combining `.withRules()` **and** `.withTags()` together requires a rule to satisfy *both* (surea11y's default `includeMode: 'and'` — see `../surea11y/docs/ENGINE_OPTIONS.md`), not either one.
64
64
 
65
+ `.exclude(selector)` above excludes globally. Pass a second argument to scope it to specific rule IDs instead: `.exclude('.mat-select', { rules: ['aria-required-children'] })` skips `.mat-select` for that rule only — every other rule still sees it. Global and rule-scoped `.exclude()` calls compose freely.
66
+
65
67
  **Create one builder per scan.** `A11yCoreBuilder` is a mutable object with no reset between `.analyze()` calls — `include()`/`exclude()`/`withRules()`/`disableRules()`/`withTags()`/`disableTags()`/`options()`/`withCustomRules()` all push onto or merge into internal state that persists for the instance's lifetime. Calling one of them again before a second `.analyze()` call *accumulates* on top of the first scan's scope rather than replacing it (this is exactly what makes "call `.include()` several times for one scan," above, work — the same accumulation just also applies across separate scans if you reuse an instance). `.reportOnly()`/`.frames()`/`.elementRef()` are the exception: each call replaces the previous value instead of merging with it.
66
68
 
67
69
  This binding works against any browser WebdriverIO can drive; the tests and examples use headless Chrome via `chromedriver`, which WebdriverIO manages automatically.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surea11y/webdriverio",
3
- "version": "0.1.2",
3
+ "version": "1.0.0",
4
4
  "description": "WebdriverIO binding for surea11y -- scan real, live-rendered pages for accessibility issues.",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -26,8 +26,8 @@
26
26
  "LICENSE"
27
27
  ],
28
28
  "dependencies": {
29
- "@surea11y/binding-base": "^1.0.0",
30
- "@surea11y/core": "^1.0.0"
29
+ "@surea11y/binding-base": "^1.1.0",
30
+ "@surea11y/core": "^1.1.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "webdriverio": ">=8.0.0"
@@ -178,8 +178,13 @@ export class A11yCoreBuilder {
178
178
 
179
179
  /** Scope the scan to one region. Call multiple times for a multi-region union. */
180
180
  include(selector: string): this;
181
- /** Skip elements matching this selector anywhere in the scanned scope. */
182
- exclude(selector: string): this;
181
+ /**
182
+ * Skip elements matching this selector anywhere in the scanned scope.
183
+ * With `opts.rules`, scopes the exclusion to just the named rule ID(s)
184
+ * instead of globally -- on top of, not instead of, any global exclusions
185
+ * from other `.exclude(selector)` calls.
186
+ */
187
+ exclude(selector: string, opts?: { rules?: string | string[] }): this;
183
188
  /** Only run rules carrying at least one of these tags. */
184
189
  withTags(tags: string | string[]): this;
185
190
  /** Never run rules carrying any of these tags (applied after withTags). */