testaro 60.12.0 → 60.14.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/AGENTS.md +6 -2
- package/CONTRIBUTING.md +9 -24
- package/LICENSE +1 -1
- package/README.md +7 -24
- package/UPGRADES.md +15 -28
- package/VALIDATION_README.md +7 -24
- package/aceconfig.js +3 -18
- package/actSpecs.js +4 -19
- package/call.js +3 -18
- package/data/template.js +3 -18
- package/dirWatch.js +3 -18
- package/netWatch.js +4 -19
- package/package.json +1 -1
- package/procs/aslint.js +3 -18
- package/procs/dateOf.js +3 -18
- package/procs/doTestAct.js +5 -20
- package/procs/getLocatorData.js +3 -18
- package/procs/getSource.js +3 -18
- package/procs/identify.js +3 -18
- package/procs/isInlineLink.js +4 -19
- package/procs/job.js +3 -18
- package/procs/sample.js +3 -18
- package/procs/screenShot.js +1 -1
- package/procs/shoot.js +1 -1
- package/procs/standardize.js +4 -19
- package/procs/target.js +4 -19
- package/procs/tellServer.js +3 -18
- package/procs/testaro.js +111 -25
- package/procs/visChange.js +4 -19
- package/pw-aslint-claude.js +1 -1
- package/run.js +5 -20
- package/scripts/dumpAlts.js +4 -19
- package/testaro/adbID.js +5 -22
- package/testaro/allCaps.js +4 -19
- package/testaro/allHidden.js +4 -19
- package/testaro/allSlanted.js +4 -19
- package/testaro/altScheme.js +5 -22
- package/testaro/attVal.js +3 -18
- package/testaro/autocomplete.js +4 -19
- package/testaro/bulk.js +4 -19
- package/testaro/buttonMenu.js +4 -19
- package/testaro/captionLoc.js +5 -22
- package/testaro/datalistRef.js +5 -20
- package/testaro/distortion.js +4 -19
- package/testaro/docType.js +3 -18
- package/testaro/dupAtt.js +3 -18
- package/testaro/elements.js +3 -18
- package/testaro/embAc.js +4 -19
- package/testaro/focAll.js +4 -19
- package/testaro/focAndOp.js +5 -22
- package/testaro/focInd.js +5 -22
- package/testaro/focVis.js +27 -54
- package/testaro/headEl.js +4 -19
- package/testaro/headingAmb.js +3 -18
- package/testaro/hovInd.js +4 -19
- package/testaro/hover.js +70 -77
- package/testaro/imageLink.js +3 -18
- package/testaro/labClash.js +29 -48
- package/testaro/legendLoc.js +3 -18
- package/testaro/lineHeight.js +5 -22
- package/testaro/linkAmb.js +4 -19
- package/testaro/linkTitle.js +4 -19
- package/testaro/linkUl.js +4 -19
- package/testaro/miniText.js +5 -20
- package/testaro/motion.js +1 -1
- package/testaro/motionSolo.js +4 -19
- package/testaro/nonTable.js +4 -19
- package/testaro/optRoleSel.js +3 -18
- package/testaro/phOnly.js +3 -18
- package/testaro/pseudoP.js +3 -18
- package/testaro/radioSet.js +3 -18
- package/testaro/role.js +4 -19
- package/testaro/secHeading.js +3 -18
- package/testaro/shoot0.js +1 -1
- package/testaro/shoot1.js +1 -1
- package/testaro/styleDiff.js +3 -18
- package/testaro/tabNav.js +4 -19
- package/testaro/targetSmall.js +4 -19
- package/testaro/targetTiny.js +4 -19
- package/testaro/textNodes.js +3 -18
- package/testaro/textSem.js +3 -18
- package/testaro/title.js +3 -18
- package/testaro/zIndex.js +3 -18
- package/tests/alfa.js +4 -19
- package/tests/aslint.js +4 -19
- package/tests/axe.js +4 -19
- package/tests/ed11y.js +4 -19
- package/tests/htmlcs.js +3 -18
- package/tests/ibm.js +4 -19
- package/tests/nuVal.js +3 -18
- package/tests/qualWeb.js +3 -18
- package/tests/testaro.js +22 -30
- package/tests/wave.js +3 -18
- package/tests/wax.js +4 -19
- package/validation/done/README.md +8 -23
- package/validation/executors/dirWatch.js +4 -19
- package/validation/executors/netWatch.js +3 -18
- package/validation/executors/run.js +3 -18
- package/validation/executors/test.js +3 -18
- package/validation/executors/tests.js +3 -18
- package/validation/jobs/done/README.md +9 -0
- package/validation/jobs/todo/README.md +3 -16
- package/validation/tests/targets/adbID/index.html +3 -18
- package/validation/tests/targets/allCaps/index.html +3 -18
- package/validation/tests/targets/allHidden/ariaHiddenBody.html +3 -18
- package/validation/tests/targets/allHidden/good.html +3 -18
- package/validation/tests/targets/allHidden/hiddenMain.html +3 -18
- package/validation/tests/targets/allHidden/mixedHidden.html +3 -18
- package/validation/tests/targets/allHidden/noBody.html +4 -19
- package/validation/tests/targets/allHidden/noMain.html +4 -19
- package/validation/tests/targets/allHidden/noneDoc.html +3 -18
- package/validation/tests/targets/allHidden/visHiddenMain.html +3 -18
- package/validation/tests/targets/allSlanted/index.html +3 -18
- package/validation/tests/targets/altScheme/index.html +3 -18
- package/validation/tests/targets/attVal/bad.html +3 -18
- package/validation/tests/targets/attVal/good.html +3 -18
- package/validation/tests/targets/autocomplete/bad.html +3 -18
- package/validation/tests/targets/autocomplete/good.html +3 -18
- package/validation/tests/targets/bulk/bad.html +3 -18
- package/validation/tests/targets/bulk/good.html +3 -18
- package/validation/tests/targets/buttonMenu/bad.html +3 -18
- package/validation/tests/targets/buttonMenu/bad.js +3 -18
- package/validation/tests/targets/buttonMenu/good.html +3 -18
- package/validation/tests/targets/buttonMenu/good.js +3 -18
- package/validation/tests/targets/buttonMenu/style.css +3 -18
- package/validation/tests/targets/captionLoc/index.html +3 -18
- package/validation/tests/targets/datalistRef/index.html +3 -18
- package/validation/tests/targets/distortion/index.html +3 -18
- package/validation/tests/targets/docType/bad.html +3 -18
- package/validation/tests/targets/docType/good.html +3 -18
- package/validation/tests/targets/dupAtt/bad.html +3 -18
- package/validation/tests/targets/dupAtt/good.html +3 -18
- package/validation/tests/targets/elements/index.html +3 -18
- package/validation/tests/targets/embAc/bad.html +3 -18
- package/validation/tests/targets/embAc/good.html +3 -18
- package/validation/tests/targets/focAll/good.html +3 -18
- package/validation/tests/targets/focAll/less.html +3 -18
- package/validation/tests/targets/focAll/more.html +3 -18
- package/validation/tests/targets/focInd/bad.html +4 -19
- package/validation/tests/targets/focInd/good.html +3 -18
- package/validation/tests/targets/focOp/bad.html +3 -18
- package/validation/tests/targets/focOp/good.html +3 -18
- package/validation/tests/targets/focVis/index.html +3 -18
- package/validation/tests/targets/headEl/index.html +3 -18
- package/validation/tests/targets/headingAmb/index.html +3 -18
- package/validation/tests/targets/hovInd/index.html +4 -19
- package/validation/tests/targets/hover/bad.html +3 -18
- package/validation/tests/targets/hover/good.html +3 -18
- package/validation/tests/targets/hr/index.html +3 -18
- package/validation/tests/targets/imageLink/index.html +3 -18
- package/validation/tests/targets/labClash/bad.html +3 -18
- package/validation/tests/targets/labClash/good.html +3 -18
- package/validation/tests/targets/legendLoc/index.html +3 -18
- package/validation/tests/targets/lineHeight/index.html +3 -18
- package/validation/tests/targets/linkAmb/index.html +4 -19
- package/validation/tests/targets/linkExt/index.html +3 -18
- package/validation/tests/targets/linkOldAtt/index.html +3 -18
- package/validation/tests/targets/linkTitle/index.html +3 -18
- package/validation/tests/targets/linkTo/index.html +3 -18
- package/validation/tests/targets/linkUl/bad.html +4 -19
- package/validation/tests/targets/linkUl/good.html +4 -19
- package/validation/tests/targets/linkUl/na.html +4 -19
- package/validation/tests/targets/miniText/index.html +3 -18
- package/validation/tests/targets/motion/bad.css +3 -18
- package/validation/tests/targets/motion/bad.html +3 -18
- package/validation/tests/targets/motion/good.html +3 -18
- package/validation/tests/targets/nonTable/index.html +3 -18
- package/validation/tests/targets/opFoc/bad.html +3 -18
- package/validation/tests/targets/opFoc/good.html +3 -18
- package/validation/tests/targets/optRoleSel/index.html +3 -18
- package/validation/tests/targets/phOnly/index.html +3 -18
- package/validation/tests/targets/pseudoP/index.html +3 -18
- package/validation/tests/targets/radioSet/bad.html +3 -18
- package/validation/tests/targets/radioSet/good.html +3 -18
- package/validation/tests/targets/role/bad.html +4 -19
- package/validation/tests/targets/role/good.html +3 -18
- package/validation/tests/targets/secHeading/index.html +3 -18
- package/validation/tests/targets/styleDiff/bad.html +3 -18
- package/validation/tests/targets/styleDiff/good.html +3 -18
- package/validation/tests/targets/tabNav/bad.html +3 -18
- package/validation/tests/targets/tabNav/bad.js +3 -18
- package/validation/tests/targets/tabNav/good.html +3 -18
- package/validation/tests/targets/tabNav/good.js +3 -18
- package/validation/tests/targets/tabNav/style.css +3 -18
- package/validation/tests/targets/targetSize/index.html +4 -19
- package/validation/tests/targets/textNodes/index.html +3 -18
- package/validation/tests/targets/textSem/index.html +3 -18
- package/validation/tests/targets/title/bad.html +3 -18
- package/validation/tests/targets/title/good.html +3 -18
- package/validation/tests/targets/titledEl/index.html +3 -18
- package/validation/tests/targets/zIndex/bad.html +3 -18
- package/validation/tests/targets/zIndex/good.html +3 -18
- package/validation/validateTest.js +4 -19
- package/validation/watch/done/README.md +5 -20
- package/validation/watch/todo/README.md +5 -20
package/testaro/hovInd.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023–2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
package/testaro/hover.js
CHANGED
|
@@ -1,109 +1,102 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2021–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
|
27
12
|
hover
|
|
28
13
|
This test reports unexpected impacts of hovering. The elements that are subjected to hovering
|
|
29
|
-
(called “triggers”) include all the elements that have
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
an element results in an increase or decrease in the total count of visible elements in the body,
|
|
14
|
+
(called “triggers”) include all the elements that have attributes associated with control over
|
|
15
|
+
the visibility of other elements. If hovering over an element results in an increase or decrease
|
|
16
|
+
in the total count of visible elements in the tree rooted in the grandparent of the trigger,
|
|
33
17
|
the rule is considered violated.
|
|
34
18
|
*/
|
|
35
19
|
|
|
36
20
|
// ########## IMPORTS
|
|
37
21
|
|
|
38
22
|
// Module to perform common operations.
|
|
39
|
-
const {
|
|
23
|
+
const {getBasicResult, getVisibleCountChange} = require('../procs/testaro');
|
|
40
24
|
|
|
41
25
|
// ########## FUNCTIONS
|
|
42
26
|
|
|
27
|
+
// Gets a violation description.
|
|
28
|
+
const getViolationDescription = (change, elapsedTime) =>
|
|
29
|
+
`Hovering over the element changes the related visible element count by ${change} in ${elapsedTime}ms`;
|
|
43
30
|
// Runs the test and returns the result.
|
|
44
31
|
exports.reporter = async (page, withItems) => {
|
|
45
32
|
// Initialize the locators and result.
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
};
|
|
33
|
+
const candidateLocs = await page.locator([
|
|
34
|
+
'[aria-controls]:visible',
|
|
35
|
+
'[aria-expanded]:visible',
|
|
36
|
+
'[aria-haspopup]:visible',
|
|
37
|
+
'[onmouseenter]:visible',
|
|
38
|
+
'[onmouseover]:visible',
|
|
39
|
+
'[onpointerenter]:visible',
|
|
40
|
+
'[onpointerover]:visible',
|
|
41
|
+
'[role="menu"]:visible',
|
|
42
|
+
'[role="menubar"]:visible',
|
|
43
|
+
'[role="menuitem"]:visible',
|
|
44
|
+
'[data-tooltip]:visible',
|
|
45
|
+
'[data-popover]:visible',
|
|
46
|
+
'[data-hover]:visible',
|
|
47
|
+
'[data-menu]:visible',
|
|
48
|
+
'[data-dropdown]:visible',
|
|
49
|
+
'[role=tab]:visible',
|
|
50
|
+
'[role=combobox]:visible'
|
|
51
|
+
].join(', '));
|
|
52
|
+
const allLocs = await candidateLocs.all();
|
|
53
|
+
const violations = [];
|
|
54
|
+
const data = {};
|
|
70
55
|
// For each locator:
|
|
71
|
-
for (const loc of
|
|
72
|
-
// Get
|
|
73
|
-
await
|
|
74
|
-
const
|
|
56
|
+
for (const loc of allLocs) {
|
|
57
|
+
// Get the XPath of the element referenced by the locator.
|
|
58
|
+
let xPath = await loc.evaluate(element => getXPath(element));
|
|
59
|
+
const pathSegments = xPath.split('/');
|
|
60
|
+
const {length} = pathSegments;
|
|
61
|
+
// Change it to the XPath of the desired observation root.
|
|
62
|
+
pathSegments.pop();
|
|
63
|
+
if (! ['main', 'body'].includes(pathSegments[length - 2])) {
|
|
64
|
+
pathSegments.pop();
|
|
65
|
+
}
|
|
66
|
+
xPath = pathSegments.join('/');
|
|
67
|
+
// Get a locator for the observation root.
|
|
68
|
+
const rootLoc = page.locator(`xpath=${xPath}`);
|
|
69
|
+
const loc0 = await rootLoc.locator('*:visible');
|
|
70
|
+
// Get a count of the visible elements in the observation tree.
|
|
75
71
|
const elementCount0 = await loc0.count();
|
|
76
|
-
// Hover over the element, whether or not covered.
|
|
77
72
|
try {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
: `subtracted ${- additions} from the page`;
|
|
91
|
-
all.locs.push([loc, impact]);
|
|
73
|
+
// Hover over the element.
|
|
74
|
+
await loc.hover({timeout: 400});
|
|
75
|
+
// Get the change in the count of the visible elements in the observation tree.
|
|
76
|
+
const changeData = await getVisibleCountChange(rootLoc, elementCount0, 400, 75);
|
|
77
|
+
const {change, elapsedTime} = changeData;
|
|
78
|
+
// If a change occurred:
|
|
79
|
+
if (change) {
|
|
80
|
+
// Add the locator and a violation description to the array of violations.
|
|
81
|
+
violations.push({
|
|
82
|
+
loc,
|
|
83
|
+
what: getViolationDescription(change, elapsedTime)
|
|
84
|
+
});
|
|
92
85
|
}
|
|
86
|
+
// Stop hovering over the element.
|
|
87
|
+
await page.mouse.move(0, 0);
|
|
88
|
+
// Await a reverse change in the count of the visible elements in the observation tree.
|
|
89
|
+
await getVisibleCountChange(rootLoc, elementCount0 + change);
|
|
93
90
|
}
|
|
94
|
-
// If hovering
|
|
91
|
+
// If hovering throws an error:
|
|
95
92
|
catch(error) {
|
|
96
|
-
// Report the test prevented.
|
|
97
|
-
const {data} = all.result;
|
|
93
|
+
// Report that the test was prevented.
|
|
98
94
|
data.prevented = true;
|
|
99
|
-
data.error =
|
|
95
|
+
data.error = `ERROR hovering over an element (${error.message})`;
|
|
100
96
|
break;
|
|
101
97
|
}
|
|
102
98
|
}
|
|
103
|
-
//
|
|
104
|
-
const whats =
|
|
105
|
-
|
|
106
|
-
'Hovering over elements adds elements to or subtracts elements from the page'
|
|
107
|
-
];
|
|
108
|
-
return await getRuleResult(withItems, all, 'hover', whats, 0);
|
|
99
|
+
// Get and return a result.
|
|
100
|
+
const whats = 'Hovering over elements changes the number of related visible elements';
|
|
101
|
+
return await getBasicResult(page, withItems, 'hover', 0, '', whats, data, violations);
|
|
109
102
|
};
|
package/testaro/imageLink.js
CHANGED
|
@@ -2,25 +2,10 @@
|
|
|
2
2
|
© 2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
© 2025 Juan S. Casado. All rights reserved.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
package/testaro/labClash.js
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
3
4
|
|
|
4
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
in the Software without restriction, including without limitation the rights
|
|
9
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
furnished to do so, subject to the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
23
9
|
*/
|
|
24
10
|
|
|
25
11
|
/*
|
|
@@ -29,42 +15,37 @@
|
|
|
29
15
|
labels are additive, not conflicting.
|
|
30
16
|
*/
|
|
31
17
|
|
|
32
|
-
//
|
|
33
|
-
const {init, getRuleResult} = require('../procs/testaro');
|
|
18
|
+
// IMPORTS
|
|
34
19
|
|
|
35
|
-
|
|
20
|
+
const {doTest} = require('../procs/testaro');
|
|
21
|
+
|
|
22
|
+
// FUNCTIONS
|
|
36
23
|
|
|
37
24
|
// Runs the test and returns the result.
|
|
38
25
|
exports.reporter = async (page, withItems) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// Attribute and reference labels.
|
|
47
|
-
['aria-label', 'aria-labelledby'].forEach(type => {
|
|
48
|
-
if (el.hasAttribute(type)) {
|
|
49
|
-
labelTypes.push(type);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
// Explicit and implicit labels.
|
|
53
|
-
const labels = Array.from(el.labels);
|
|
54
|
-
if (labels.length) {
|
|
55
|
-
labelTypes.push('label');
|
|
26
|
+
const getBadWhat = element => {
|
|
27
|
+
// Get the label types of the element.
|
|
28
|
+
const labelTypes = [];
|
|
29
|
+
// Attribute and reference labels.
|
|
30
|
+
['aria-label', 'aria-labelledby'].forEach(type => {
|
|
31
|
+
if (element.hasAttribute(type)) {
|
|
32
|
+
labelTypes.push(type);
|
|
56
33
|
}
|
|
57
|
-
return labelTypes;
|
|
58
34
|
});
|
|
59
|
-
//
|
|
35
|
+
// Explicit and implicit labels.
|
|
36
|
+
const labels = Array.from(element.labels);
|
|
37
|
+
if (labels.length) {
|
|
38
|
+
labelTypes.push('label');
|
|
39
|
+
}
|
|
40
|
+
// If it has more than 1 label type:
|
|
60
41
|
if (labelTypes.length > 1) {
|
|
61
|
-
//
|
|
62
|
-
|
|
42
|
+
// Return a violation description.
|
|
43
|
+
return `Element has inconsistent label types (${labelTypes.join(', ')})`;
|
|
63
44
|
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const whats =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
45
|
+
};
|
|
46
|
+
const selector = 'button, input:not([type=hidden]), select, textarea';
|
|
47
|
+
const whats = 'Elements have inconsistent label types';
|
|
48
|
+
return await doTest(
|
|
49
|
+
page, withItems, 'labClash', selector, whats, 2, null, getBadWhat.toString()
|
|
50
|
+
);
|
|
70
51
|
};
|
package/testaro/legendLoc.js
CHANGED
|
@@ -2,25 +2,10 @@
|
|
|
2
2
|
© 2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
© 2025 Juan S. Casado. All rights reserved.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
package/testaro/lineHeight.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
|
@@ -40,7 +25,6 @@ const {doTest} = require('../procs/testaro');
|
|
|
40
25
|
|
|
41
26
|
// Runs the test and returns the result.
|
|
42
27
|
exports.reporter = async (page, withItems) => {
|
|
43
|
-
// Define a violation function for execution in the browser.
|
|
44
28
|
const getBadWhat = element => {
|
|
45
29
|
// Get whether the element has a non-spacing child text node.
|
|
46
30
|
const hasText = Array.from(element.childNodes).some(child =>
|
|
@@ -65,8 +49,7 @@ exports.reporter = async (page, withItems) => {
|
|
|
65
49
|
}
|
|
66
50
|
};
|
|
67
51
|
const whats = 'Element line heights are less than 1.5 times their font sizes';
|
|
68
|
-
|
|
69
|
-
return doTest(
|
|
52
|
+
return await doTest(
|
|
70
53
|
page, withItems, 'lineHeight', '*', whats, 1, null, getBadWhat.toString()
|
|
71
54
|
);
|
|
72
55
|
};
|
package/testaro/linkAmb.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023–2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
package/testaro/linkTitle.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
package/testaro/linkUl.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
package/testaro/miniText.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2022–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
|
@@ -61,7 +46,7 @@ exports.reporter = async (page, withItems) => {
|
|
|
61
46
|
}
|
|
62
47
|
};
|
|
63
48
|
const whats = 'Visible elements have font sizes smaller than 11 pixels';
|
|
64
|
-
return doTest(
|
|
49
|
+
return await doTest(
|
|
65
50
|
page, withItems, 'miniText', 'body *:not(script, style)', whats, 2, '', getBadWhat.toString()
|
|
66
51
|
);
|
|
67
52
|
};
|
package/testaro/motion.js
CHANGED
package/testaro/motionSolo.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2021–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|
package/testaro/nonTable.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2022–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
MIT License
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
+
https://opensource.org/license/mit/ for details.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
8
|
+
SPDX-License-Identifier: MIT
|
|
24
9
|
*/
|
|
25
10
|
|
|
26
11
|
/*
|