testaro 71.0.2 → 71.1.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.
@@ -0,0 +1,10 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(git branch *)",
5
+ "Bash(git add *)",
6
+ "Bash(git commit -m ' *)",
7
+ "Bash(git push *)"
8
+ ]
9
+ }
10
+ }
package/CLAUDE.md ADDED
@@ -0,0 +1,112 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Commands
6
+
7
+ ```bash
8
+ # Install / update all dependencies and Playwright browsers
9
+ npm run deps
10
+
11
+ # Build the bundled accessible-name computation script
12
+ npm run build
13
+
14
+ # Lint (ESLint)
15
+ npx eslint .
16
+
17
+ # Validate a single Testaro rule (replace <ruleID> with the rule name, e.g. allSlanted)
18
+ npm test <ruleID>
19
+
20
+ # Validate all Testaro rules
21
+ npm run tests
22
+
23
+ # Run a job from JOBDIR/todo (optionally prefix-match by timestamp)
24
+ node call run [jobIDStart]
25
+
26
+ # Watch a directory for jobs
27
+ node call dirWatch <true|false> <intervalSeconds>
28
+
29
+ # Poll a network server for jobs
30
+ node call netWatch <true|false> <intervalSeconds> [<true|false>]
31
+ ```
32
+
33
+ ## Architecture
34
+
35
+ Testaro is an ensemble accessibility test runner. It integrates 10 external tools plus ~50 of its own rules (the "testaro" tool) and produces standardized reports from a job document.
36
+
37
+ ### Job → Report lifecycle
38
+
39
+ 1. A caller provides a **job** — a plain JS/JSON object with a `target` URL, `browserID`, optional `device`, and an `acts` array.
40
+ 2. `run.js` exports `doJob(job)`, which validates the job (`procs/job.js`), builds a DOM **catalog** (`procs/catalog.js`), then delegates to `procs/doActs.js`.
41
+ 3. `doActs.js` iterates the acts array. For `test` acts it forks a child process running `procs/doTestAct.js` (one per tool invocation) and enforces per-tool time limits. Non-test acts (browser interactions) execute in the parent.
42
+ 4. Each tool's test module lives in `tests/<toolID>.js`. It calls the tool's library and converts the native result to the **standard result** shape (`prevented`, `totals[4]`, `instances[]`).
43
+ 5. `doJob` returns the job object with `jobData` and `catalog` added at the top level and `result` added inside each `test` act. The job's `standard` property controls what `result` contains: `'no'` → `nativeResult` only; `'only'` → `standardResult` only; `'also'` → both.
44
+
45
+ The 18 act types are defined and documented in `actSpecs.js` (`etc` property). The main interactive types are `button`, `checkbox`, `focus`, `link`, `press`, `presses`, `radio`, `reveal`, `search`, `select`, `text`, `url`, `wait`. The `test` type runs a tool. `launch`, `next`, `page`, `state` control flow.
46
+
47
+ ### Testaro rules (`testaro/` directory)
48
+
49
+ Each file exports a `reporter(page, catalog, withItems)` async function. Rules are registered in `tests/testaro.js` in the `allRules` array, which controls default execution order, contamination flags, time limits, and `defaultOn`.
50
+
51
+ The default order in `allRules` reflects a two-phase execution strategy: non-contaminating rules (`contaminates: false`) come first and all share a single page load; contaminating rules (`contaminates: true`) follow, each tested on a freshly loaded copy of the page.
52
+
53
+ Two rules, `shoot0` and `shoot1`, are atypical: they report no violations. Instead they take screenshots at different points during a job so that the `motion` rule can compare them to detect and measure visible page change, avoiding the latency that would be required if `motion` took its own screenshots and waited between them.
54
+
55
+ Two implementation patterns exist:
56
+
57
+ - **`doTest`** (`procs/testaro.js`): for rules whose verdict on each element can be computed in-browser via `page.evaluate`. The caller passes a CSS selector and a serialized `getBadWhat(element)` function string. This is the preferred pattern (~48 of ~50 rules).
58
+ - **`getBasicResult`** (`procs/testaro.js`): for rules that need Playwright APIs or cross-element state (currently only `hover` and `role`).
59
+
60
+ ### Validation
61
+
62
+ Validation tests live in `validation/tests/jobs/` (jobs with `expect` arrays) and `validation/tests/targets/` (static HTML pages served locally as test targets). Running `npm test <ruleID>` executes `validation/executors/test.js` → `validation/validateTest.js`, which runs the job and compares `result` fields against `expect` clauses.
63
+
64
+ ### Tool XPath strategy
65
+
66
+ The catalog maps XPaths to element metadata. Each tool uses a different approach to report the elements it flags:
67
+
68
+ - `alfa`, `aslint`: report their own XPaths; Testaro normalizes them.
69
+ - `ed11y`, `wave`: Testaro injects `window.getXPath` and calls it per element.
70
+ - `axe`, `htmlcs`, `ibm`, `nuVal`, `nuVnu`, `qualWeb`: Testaro stamps `data-xpath` attributes on all elements before the tool runs.
71
+ - `testaro`: each rule reports XPaths directly.
72
+
73
+ ### Environment (`.env`)
74
+
75
+ Key variables:
76
+
77
+ - `HEADED_BROWSER` — show browser windows during tests
78
+ - `DEBUG` — mirror browser console to terminal
79
+ - `WAITS` — ms delay inserted between Playwright operations (useful for debugging)
80
+ - `WAVE_KEY` — API key for the WAVE subscription API
81
+ - `JOBDIR` / `REPORTDIR` — root directories for job files and report output
82
+ - `AGENT` — instance name used in network-watch mode
83
+ - `NETWATCH_URL_<N>_JOB/OBSERVE/REPORT/AUTH`, `NETWATCH_URLS` — server polling configuration
84
+ - `TIMEOUT_MULTIPLIER` — scales all per-tool time limits (default 1)
85
+
86
+ ## Code style
87
+
88
+ ESLint (`eslintrc.json`): 2-space indent, single quotes, semicolons, Stroustrup brace style (`else`/`catch` on a new line after `}`), `no-use-before-define`. The `htmlcs/HTMLCS.js` file uses a separate, looser ESLint config and must not be reformatted.
89
+
90
+ ## Adding a new Testaro rule
91
+
92
+ 1. Add an entry to `allRules` in `tests/testaro.js`.
93
+ 2. Create `testaro/<ruleID>.js` exporting a `reporter` function using `doTest` (preferred) or `getBasicResult`.
94
+ 3. Write a validation job in `validation/tests/jobs/<ruleID>.json` with an `expect` array and corresponding HTML target(s) in `validation/tests/targets/<ruleID>/`.
95
+ 4. Run `npm test <ruleID>` until validation passes.
96
+
97
+ ## Key files
98
+
99
+ | File | Purpose |
100
+ |------|---------|
101
+ | `run.js` | `doJob()` — the main entry point |
102
+ | `call.js` | CLI wrapper for `run`, `dirWatch`, `netWatch` |
103
+ | `procs/doActs.js` | Iterates acts; forks child for each tool |
104
+ | `procs/doTestAct.js` | Child-process entry point for tool invocations |
105
+ | `procs/testaro.js` | `doTest` / `getBasicResult` helpers for Testaro rules |
106
+ | `procs/launch.js` | Browser lifecycle (launch, goTo, nonce, wait) |
107
+ | `procs/catalog.js` | Builds the element catalog from the DOM |
108
+ | `procs/job.js` | Job validation; `tools` constant |
109
+ | `actSpecs.js` | Canonical specs for all 18 act types |
110
+ | `tests/testaro.js` | `allRules` registry for the testaro tool |
111
+ | `testaro/<ruleID>.js` | One file per Testaro rule |
112
+ | `validation/validateTest.js` | Core validation harness |
package/netWatch.js CHANGED
@@ -185,8 +185,6 @@ exports.netWatch = async (isForever, intervalInSeconds, isCertTolerant = true) =
185
185
  console.log(
186
186
  `${reportLogStart}response message: ${JSON.stringify(ackObj, null, 2)}\n`
187
187
  );
188
- // Wait for the specified interval.
189
- await wait(1000 * intervalInSeconds);
190
188
  }
191
189
  // If it is not JSON:
192
190
  catch(error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "71.0.2",
3
+ "version": "71.1.0",
4
4
  "description": "Run 1000 web accessibility tests from 11 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/procs/launch.js CHANGED
@@ -82,10 +82,10 @@ const browserClose = exports.browserClose = async page => {
82
82
  };
83
83
  // Visits a URL and returns the response of the server.
84
84
  const goTo = exports.goTo = async (report, page, url, timeout, waitUntil) => {
85
- // If the URL is a file path:
85
+ // If the URL is a file path relative to the project root:
86
86
  if (url.startsWith('file://')) {
87
- // Make it absolute.
88
- url = url.replace('file://', `file://${__dirname}/`);
87
+ // Make it the absolute path to the specified file.
88
+ url = url.replace('file://', `file://${__dirname}/../`);
89
89
  }
90
90
  // Visit the URL.
91
91
  const startTime = Date.now();
package/procs/testaro.js CHANGED
@@ -39,7 +39,7 @@ exports.doTest = async (
39
39
  getBadWhatString
40
40
  ] = args;
41
41
  // Get all violator candidates.
42
- const candidates = document.body.querySelectorAll(candidateSelector);
42
+ const candidates = document.querySelectorAll(candidateSelector);
43
43
  let violationCount = 0;
44
44
  // Initialize proto-instances.
45
45
  const protoInstances = [];
package/testaro/adbID.js CHANGED
@@ -57,6 +57,6 @@ exports.reporter = async (page, catalog, withItems) => {
57
57
  };
58
58
  const whats = 'Elements have aria-describedby attributes with missing or invalid id values';
59
59
  return await doTest(
60
- page, catalog, withItems, 'adbID', '[aria-describedby]', whats, 3, getBadWhat.toString()
60
+ page, catalog, withItems, 'adbID', 'body [aria-describedby]', whats, 3, getBadWhat.toString()
61
61
  );
62
62
  };
@@ -0,0 +1,51 @@
1
+ /*
2
+ © 2023 CVS Health and/or one of its affiliates. All rights reserved.
3
+ © 2025–2026 Jonathan Robert Pool.
4
+
5
+ Licensed under the MIT License. See LICENSE file at the project root or https://opensource.org/license/mit/ for details.
6
+
7
+ SPDX-License-Identifier: MIT
8
+ */
9
+
10
+ /*
11
+ allCapStyle
12
+ Related to Tenon rule 153.
13
+ This test reports elements with transformed upper-case text. Blocks of upper-case text are difficult to read.
14
+ */
15
+
16
+ // IMPORTS
17
+
18
+ const {doTest} = require('../procs/testaro');
19
+
20
+ // FUNCTIONS
21
+
22
+ // Runs the test and returns the result.
23
+ exports.reporter = async (page, catalog, withItems) => {
24
+ const getBadWhat = element => {
25
+ // Get the style declaration of the element.
26
+ const styleDec = window.getComputedStyle(element);
27
+ const {textTransform} = styleDec;
28
+ // If the style declaration transforms the element text to upper case:
29
+ if (textTransform === 'uppercase') {
30
+ const parent = element.parentElement;
31
+ // If the element has a parent:
32
+ if (parent) {
33
+ // Get the style declaration of the parent.
34
+ const parentStyleDec = window.getComputedStyle(parent);
35
+ const {textTransform: parentTextTransform} = parentStyleDec;
36
+ // If the style declaration transforms the parent text to upper case:
37
+ if (parentTextTransform === 'uppercase') {
38
+ // Do not report a violation, because the transformation may be inherited.
39
+ return null;
40
+ }
41
+ }
42
+ // If it has no parent or its transformation is autonomous, return a violation description.
43
+ return 'Element text is transformed into all-capitals';
44
+ }
45
+ };
46
+ const selector = 'body, body *:not(style, script, svg)';
47
+ const whats = 'Elements have an all-capital text transformation style';
48
+ return await doTest(
49
+ page, catalog, withItems, 'allCapStyle', selector, whats, 0, getBadWhat.toString()
50
+ );
51
+ };
@@ -10,7 +10,7 @@
10
10
  /*
11
11
  allCaps
12
12
  Related to Tenon rule 153.
13
- This test reports elements with native or transformed upper-case text at least 8 characters long. Blocks of upper-case text are difficult to read.
13
+ This test reports elements with native upper-case text at least 8 characters long. Blocks of upper-case text are difficult to read.
14
14
  */
15
15
 
16
16
  // IMPORTS
@@ -26,29 +26,13 @@ exports.reporter = async (page, catalog, withItems) => {
26
26
  const childTextNodes = Array.from(element.childNodes).filter(
27
27
  node => node.nodeType === Node.TEXT_NODE
28
28
  );
29
- // Get the concatenation of their texts that contain 8 or more consecutive letters.
30
- let longText = childTextNodes
31
- .map(node => node.nodeValue.trim())
32
- .filter(text => /[A-Z]{8,}/i.test(text))
33
- .join(' ');
34
- // If there is any:
35
- if (longText) {
36
- // Get the style declaration of the element.
37
- const styleDec = window.getComputedStyle(element);
38
- const {textTransform} = styleDec;
39
- // If the style declaration transforms the text to upper case:
40
- if (textTransform === 'uppercase') {
41
- // Return a violation description.
42
- return 'Element text is rendered as all-capital';
43
- }
44
- // Otherwise, if the text contains 8 or more consecutive upper-case letters:
45
- if (/[A-Z]{8,}/.test(longText)) {
46
- // Return a violation description.
47
- return 'Element contains all-capital text';
48
- }
29
+ // If any of them contains 8 or more consecutive capital letters:
30
+ if (childTextNodes.some(node => /[A-Z]{8,}/.test(node.nodeValue))) {
31
+ // Return a violation description.
32
+ return 'Element contains all-capital text';
49
33
  }
50
34
  };
51
- const selector = 'body *:not(style, script, svg)';
35
+ const selector = 'body, body *:not(style, script, svg)';
52
36
  const whats = 'Elements have all-capital text';
53
37
  return await doTest(
54
38
  page, catalog, withItems, 'allCaps', selector, whats, 0, getBadWhat.toString()
@@ -26,11 +26,23 @@ exports.reporter = async (page, catalog, withItems) => {
26
26
  const {textContent} = element;
27
27
  // If the element contains 40 or more characters of slanted text:
28
28
  if (['italic', 'oblique'].includes(styleDec.fontStyle) && textContent.length > 39) {
29
- // Return a violation description.
29
+ const parent = element.parentElement;
30
+ // If the element has a parent:
31
+ if (parent) {
32
+ // Get the style declaration of the parent.
33
+ const parentStyleDec = window.getComputedStyle(parent);
34
+ const {fontStyle: parentFontStyle} = parentStyleDec;
35
+ // If the parent also has slanted text:
36
+ if (['italic', 'oblique'].includes(parentFontStyle)) {
37
+ // Do not report a violation, because the slant may be inherited.
38
+ return null;
39
+ }
40
+ }
41
+ // If it has no parent or its slant is autonomous, return a violation description.
30
42
  return 'Element contains all-slanted text';
31
43
  }
32
44
  };
33
- const selector = 'body *:not(style, script, svg)';
45
+ const selector = 'body, body *:not(style, script, svg)';
34
46
  const whats = 'Elements contain all-slanted text';
35
47
  return await doTest(
36
48
  page, catalog, withItems, 'allSlanted', selector, whats, 0, getBadWhat.toString()
@@ -41,6 +41,6 @@ exports.reporter = async (page, catalog, withItems) => {
41
41
  };
42
42
  const whats = 'img elements have alt attributes with URL or filename values';
43
43
  return await doTest(
44
- page, catalog, withItems, 'altScheme', 'img[alt]', whats, 1, getBadWhat.toString()
44
+ page, catalog, withItems, 'altScheme', 'body img[alt]', whats, 1, getBadWhat.toString()
45
45
  );
46
46
  };
package/testaro/attVal.js CHANGED
@@ -31,6 +31,6 @@ exports.reporter = async (page, catalog, withItems, attributeName, areLicit, val
31
31
  };
32
32
  const whats = `Elements have attribute ${attributeName} with illicit values`;
33
33
  return await doTest(
34
- page, catalog, withItems, 'attVal', `[${attributeName}]`, whats, 2, getBadWhat.toString()
34
+ page, catalog, withItems, 'attVal', `body [${attributeName}]`, whats, 2, getBadWhat.toString()
35
35
  );
36
36
  };
@@ -76,7 +76,7 @@ exports.reporter = async (
76
76
  return `input has no autocomplete="${requiredAuto}" attribute`;
77
77
  }
78
78
  };
79
- const selector = 'input[type=text], input[type=email], input:not([type])';
79
+ const selector = 'body input[type=text], body input[type=email], body input:not([type])';
80
80
  const whats = 'Inputs are missing required autocomplete attributes';
81
81
  const placeHolders = Object.keys(labels).map(key => `__${key}Labels__`);
82
82
  const replacers = Object.values(labels).map(value => JSON.stringify(value));
@@ -31,6 +31,6 @@ exports.reporter = async (page, catalog, withItems) => {
31
31
  };
32
32
  const whats = 'caption elements are not the first children of table elements';
33
33
  return await doTest(
34
- page, catalog, withItems, 'captionLoc', 'caption', whats, 3, getBadWhat.toString()
34
+ page, catalog, withItems, 'captionLoc', 'body caption', whats, 3, getBadWhat.toString()
35
35
  );
36
36
  };
@@ -46,6 +46,6 @@ exports.reporter = async (page, catalog, withItems) => {
46
46
  };
47
47
  const whats = 'list attributes of input elements are empty or IDs of no or non-datalist elements';
48
48
  return await doTest(
49
- page, catalog, withItems, 'datalistRef', 'input[list]', whats, 3, getBadWhat.toString()
49
+ page, catalog, withItems, 'datalistRef', 'body input[list]', whats, 3, getBadWhat.toString()
50
50
  );
51
51
  };
@@ -38,6 +38,6 @@ exports.reporter = async (page, catalog, withItems) => {
38
38
  };
39
39
  const whats = 'Elements distort their texts';
40
40
  return await doTest(
41
- page, catalog, withItems, 'distortion', 'body *', whats, 0, getBadWhat.toString()
41
+ page, catalog, withItems, 'distortion', 'body, body *', whats, 0, getBadWhat.toString()
42
42
  );
43
43
  };
@@ -116,6 +116,6 @@ exports.reporter = async (page, catalog, withItems) => {
116
116
  };
117
117
  const whats = 'Elements are Tab-focusable but not operable or vice versa';
118
118
  return await doTest(
119
- page, catalog, withItems, 'focAndOp', 'body *', whats, 2, getBadWhat.toString()
119
+ page, catalog, withItems, 'focAndOp', 'body, body *', whats, 2, getBadWhat.toString()
120
120
  );
121
121
  };
package/testaro/focInd.js CHANGED
@@ -86,6 +86,6 @@ exports.reporter = async (page, catalog, withItems) => {
86
86
  };
87
87
  const whats = 'Elements fail to have standard focus indicators';
88
88
  return await doTest(
89
- page, catalog, withItems, 'focInd', 'body *', whats, 1, getBadWhat.toString()
89
+ page, catalog, withItems, 'focInd', 'body, body *', whats, 1, getBadWhat.toString()
90
90
  );
91
91
  };
package/testaro/focVis.js CHANGED
@@ -42,6 +42,6 @@ exports.reporter = async (page, catalog, withItems) => {
42
42
  };
43
43
  const whats = 'Visible links are above or to the left of the display';
44
44
  return await doTest(
45
- page, catalog, withItems, 'focVis', 'a', whats, 2, getBadWhat.toString()
45
+ page, catalog, withItems, 'focVis', 'body a', whats, 2, getBadWhat.toString()
46
46
  );
47
47
  };
package/testaro/hovInd.js CHANGED
@@ -138,7 +138,7 @@ exports.reporter = async (page, catalog, withItems) => {
138
138
  }
139
139
  }
140
140
  };
141
- const selector = 'a, button, input, [onmouseenter], [onmouseover]';
141
+ const selector = 'body a, body button, body input, body [onmouseenter], body [onmouseover]';
142
142
  const whats = 'elements have confusing hover indicators';
143
143
  return await doTest(page, catalog, withItems, 'hovInd', selector, whats, 1, getBadWhat.toString());
144
144
  };
package/testaro/hr.js CHANGED
@@ -27,6 +27,6 @@ exports.reporter = async (page, catalog, withItems) => {
27
27
  }
28
28
  const whats = 'HR elements are used for vertical segmentation';
29
29
  return await doTest(
30
- page, catalog, withItems, 'hr', 'hr', whats, 0, getBadWhat.toString()
30
+ page, catalog, withItems, 'hr', 'body hr', whats, 0, getBadWhat.toString()
31
31
  );
32
32
  };
@@ -33,6 +33,6 @@ exports.reporter = async (page, catalog, withItems) => {
33
33
  };
34
34
  const whats = 'Links have image files as their destinations';
35
35
  return await doTest(
36
- page, catalog, withItems, 'imageLink', 'a[href]', whats, 0, getBadWhat.toString()
36
+ page, catalog, withItems, 'imageLink', 'body a[href]', whats, 0, getBadWhat.toString()
37
37
  );
38
38
  };
@@ -41,7 +41,7 @@ exports.reporter = async (page, catalog, withItems) => {
41
41
  return `Element has inconsistent label types (${labelTypes.join(', ')})`;
42
42
  }
43
43
  };
44
- const selector = 'button, input:not([type=hidden]), select, textarea';
44
+ const selector = 'body button, body input:not([type=hidden]), body select, body textarea';
45
45
  const whats = 'Elements have inconsistent label types';
46
46
  return await doTest(
47
47
  page, catalog, withItems, 'labClash', selector, whats, 2, getBadWhat.toString()
@@ -33,6 +33,6 @@ exports.reporter = async (page, catalog, withItems) => {
33
33
  };
34
34
  const whats = 'Legend elements are not the first children of fieldset elements';
35
35
  return await doTest(
36
- page, catalog, withItems, 'legendLoc', 'legend', whats, 3, getBadWhat.toString()
36
+ page, catalog, withItems, 'legendLoc', 'body legend', whats, 3, getBadWhat.toString()
37
37
  );
38
38
  };
@@ -47,6 +47,6 @@ exports.reporter = async (page, catalog, withItems) => {
47
47
  };
48
48
  const whats = 'Element line heights are less than 1.5 times their font sizes';
49
49
  return await doTest(
50
- page, catalog, withItems, 'lineHeight', '*', whats, 1, getBadWhat.toString()
50
+ page, catalog, withItems, 'lineHeight', 'body, body *', whats, 1, getBadWhat.toString()
51
51
  );
52
52
  };
@@ -26,6 +26,6 @@ exports.reporter = async (page, catalog, withItems) => {
26
26
  };
27
27
  const whats = 'Links have target=_blank attributes';
28
28
  return await doTest(
29
- page, catalog, withItems, 'linkExt', 'a[target=_blank]', whats, 0, getBadWhat.toString()
29
+ page, catalog, withItems, 'linkExt', 'body a[target=_blank]', whats, 0, getBadWhat.toString()
30
30
  );
31
31
  };
@@ -36,7 +36,7 @@ exports.reporter = async (page, catalog, withItems) => {
36
36
  return `Element has deprecated attributes: ${elementBadAttNames.join(', ')}`;
37
37
  }
38
38
  };
39
- const selector = 'a[charset], a[coords], a[name], a[rev], a[shape]';
39
+ const selector = 'body a[charset], body a[coords], body a[name], body a[rev], body a[shape]';
40
40
  const whats = 'Links have deprecated attributes';
41
41
  return await doTest(
42
42
  page, catalog, withItems, 'linkOldAtt', selector, whats, 1, getBadWhat.toString()
package/testaro/linkTo.js CHANGED
@@ -33,6 +33,6 @@ exports.reporter = async (page, catalog, withItems) => {
33
33
  };
34
34
  const whats = 'Links are missing href attributes';
35
35
  return await doTest(
36
- page, catalog, withItems, 'linkTo', 'a:not([href]', whats, 2, getBadWhat.toString()
36
+ page, catalog, withItems, 'linkTo', 'body a:not([href]', whats, 2, getBadWhat.toString()
37
37
  );
38
38
  };
package/testaro/linkUl.js CHANGED
@@ -40,6 +40,6 @@ exports.reporter = async (page, catalog, withItems) => {
40
40
  };
41
41
  const whats = 'Links that are not list items are not underlined';
42
42
  return await doTest(
43
- page, catalog, withItems, 'linkUl', 'a', whats, 1, getBadWhat.toString()
43
+ page, catalog, withItems, 'linkUl', 'body a', whats, 1, getBadWhat.toString()
44
44
  );
45
45
  };
@@ -48,6 +48,6 @@ exports.reporter = async (page, catalog, withItems) => {
48
48
  };
49
49
  const whats = 'Visible elements have font sizes smaller than 11 pixels';
50
50
  return await doTest(
51
- page, catalog, withItems, 'miniText', 'body *:not(script, style)', whats, 2, getBadWhat.toString()
51
+ page, catalog, withItems, 'miniText', 'body, body *:not(script, style)', whats, 2, getBadWhat.toString()
52
52
  );
53
53
  };
@@ -56,6 +56,6 @@ exports.reporter = async (page, catalog, withItems) => {
56
56
  };
57
57
  const whats = 'table elements are misused for non-table content';
58
58
  return await doTest(
59
- page, catalog, withItems, 'nonTable', 'table', whats, 2, getBadWhat.toString()
59
+ page, catalog, withItems, 'nonTable', 'body table', whats, 2, getBadWhat.toString()
60
60
  );
61
61
  };
@@ -32,6 +32,6 @@ exports.reporter = async (page, catalog, withItems) => {
32
32
  };
33
33
  const whats = 'Elements with role=option have no aria-selected attributes';
34
34
  return await doTest(
35
- page, catalog, withItems, 'optRoleSel', '[role="option"]', whats, 1, getBadWhat.toString()
35
+ page, catalog, withItems, 'optRoleSel', 'body [role="option"]', whats, 1, getBadWhat.toString()
36
36
  );
37
37
  };
package/testaro/phOnly.js CHANGED
@@ -34,6 +34,6 @@ exports.reporter = async (page, catalog, withItems) => {
34
34
  };
35
35
  const whats = 'input elements have placeholders but no accessible names';
36
36
  return await doTest(
37
- page, catalog, withItems, 'phOnly', 'input[placeholder]', whats, 2, getBadWhat.toString()
37
+ page, catalog, withItems, 'phOnly', 'body input[placeholder]', whats, 2, getBadWhat.toString()
38
38
  );
39
39
  };
@@ -69,6 +69,6 @@ exports.reporter = async (page, catalog, withItems) => {
69
69
  };
70
70
  const whats = 'Radio buttons are not validly grouped in fieldsets with legends';
71
71
  return await doTest(
72
- page, catalog, withItems, 'radioSet', 'input[type=radio]', whats, 2, getBadWhat.toString()
72
+ page, catalog, withItems, 'radioSet', 'body input[type=radio]', whats, 2, getBadWhat.toString()
73
73
  );
74
74
  };
@@ -41,7 +41,7 @@ exports.reporter = async (page, catalog, withItems) => {
41
41
  }
42
42
  }
43
43
  };
44
- const selector = 'section, article, nav, aside, main';
44
+ const selector = 'body section, body article, body nav, body aside, body main';
45
45
  const whats = 'First child headings of sectioning containers are deeper than others';
46
46
  return await doTest(
47
47
  page, catalog, withItems, 'secHeading', selector, whats, 0, getBadWhat.toString()
@@ -35,7 +35,7 @@ exports.reporter = async (page, catalog, withItems) => {
35
35
  }
36
36
  }
37
37
  };
38
- const selector = 'i, b, small';
38
+ const selector = 'body i, body b, body small';
39
39
  const whats = 'Semantically vague elements i, b, and/or small are used';
40
40
  return await doTest(
41
41
  page, catalog, withItems, 'textSem', selector, whats, 0, getBadWhat.toString()
@@ -26,7 +26,7 @@ exports.reporter = async (page, catalog, withItems) => {
26
26
  // Return a violation description.
27
27
  return `Likely ineffective title attribute is used on the ${elementType} element`;
28
28
  }
29
- const selector = '[title]:not(iframe, link, style)';
29
+ const selector = 'body [title]:not(iframe, link, style)';
30
30
  const whats = 'title attributes are used on elements they are likely ineffective on';
31
31
  return await doTest(
32
32
  page, catalog, withItems, 'titledEl', selector, whats, 0, getBadWhat.toString()
package/testaro/zIndex.js CHANGED
@@ -33,6 +33,6 @@ exports.reporter = async (page, catalog, withItems) => {
33
33
  };
34
34
  const whats = 'Elements have non-default Z indexes';
35
35
  return await doTest(
36
- page, catalog, withItems, 'zIndex', 'body *', whats, 0, getBadWhat.toString()
36
+ page, catalog, withItems, 'zIndex', 'body, body *', whats, 0, getBadWhat.toString()
37
37
  );
38
38
  };
@@ -30,7 +30,10 @@
30
30
  <p class="oblique">This text has been transformed by its style to oblique.</p>
31
31
  <p><em id="indirect">This text has no explicit style, but is in an em element, so is made italic by the user agent</em> except at the end</p>
32
32
  <p>This text is transformed to italic <span class="italic">only in small part</span>.</p>
33
- <p>Qualifying text nodes: 3</p>
33
+ <div id="slantedParent" class="oblique">
34
+ <p>This text is oblique by inheritance from its parent.</p>
35
+ </div>
36
+ <p>Qualifying text nodes: 4</p>
34
37
  </main>
35
38
  </body>
36
39
  </html>