testaro 67.0.0 → 68.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/LICENSE +4 -16
- package/README.md +10 -2
- package/UPGRADES.md +1 -1
- package/dirWatch.js +2 -3
- package/ed11y/editoria11y.min.js +109 -690
- package/ed11y/editoria11y210.min.js +747 -0
- package/netWatch.js +6 -6
- package/package.json +1 -1
- package/procs/aslint.js +2 -2
- package/procs/catalog.js +190 -0
- package/procs/{dateOf.js → dateTime.js} +6 -4
- package/procs/doActs.js +1227 -0
- package/procs/doTestAct.js +63 -29
- package/procs/error.js +53 -0
- package/procs/job.js +64 -38
- package/procs/launch.js +596 -0
- package/procs/nu.js +3 -18
- package/procs/shoot.js +18 -2
- package/procs/testaro.js +102 -125
- package/procs/xPath.js +62 -0
- package/run.js +42 -1938
- package/scratch/README.md +9 -0
- package/testaro/adbID.js +3 -3
- package/testaro/allCaps.js +4 -5
- package/testaro/allHidden.js +19 -18
- package/testaro/allSlanted.js +4 -5
- package/testaro/altScheme.js +3 -3
- package/testaro/attVal.js +19 -35
- package/testaro/autocomplete.js +65 -62
- package/testaro/bulk.js +21 -20
- package/testaro/buttonMenu.js +112 -33
- package/testaro/captionLoc.js +3 -3
- package/testaro/datalistRef.js +4 -5
- package/testaro/distortion.js +3 -3
- package/testaro/docType.js +6 -9
- package/testaro/dupAtt.js +12 -25
- package/testaro/elements.js +4 -3
- package/testaro/embAc.js +4 -2
- package/testaro/focAll.js +6 -13
- package/testaro/focAndOp.js +3 -3
- package/testaro/focInd.js +3 -3
- package/testaro/focVis.js +4 -3
- package/testaro/headEl.js +5 -12
- package/testaro/headingAmb.js +45 -88
- package/testaro/hovInd.js +5 -5
- package/testaro/hover.js +44 -8
- package/testaro/hr.js +4 -4
- package/testaro/imageLink.js +3 -3
- package/testaro/labClash.js +3 -3
- package/testaro/legendLoc.js +3 -3
- package/testaro/lineHeight.js +3 -3
- package/testaro/linkAmb.js +25 -17
- package/testaro/linkExt.js +5 -5
- package/testaro/linkOldAtt.js +4 -3
- package/testaro/linkTo.js +4 -3
- package/testaro/linkUl.js +4 -5
- package/testaro/miniText.js +4 -3
- package/testaro/motion.js +3 -22
- package/testaro/nonTable.js +4 -5
- package/testaro/optRoleSel.js +3 -3
- package/testaro/phOnly.js +3 -3
- package/testaro/pseudoP.js +5 -5
- package/testaro/radioSet.js +4 -5
- package/testaro/role.js +4 -5
- package/testaro/secHeading.js +4 -5
- package/testaro/shoot0.js +3 -2
- package/testaro/shoot1.js +3 -2
- package/testaro/styleDiff.js +5 -12
- package/testaro/tabNav.js +30 -118
- package/testaro/targetSmall.js +30 -15
- package/testaro/textNodes.js +3 -1
- package/testaro/textSem.js +4 -5
- package/testaro/title.js +4 -2
- package/testaro/titledEl.js +3 -3
- package/testaro/zIndex.js +3 -3
- package/tests/alfa.js +28 -54
- package/tests/aslint.js +20 -53
- package/tests/axe.js +76 -13
- package/tests/ed11y.js +69 -141
- package/tests/htmlcs.js +69 -38
- package/tests/ibm.js +54 -9
- package/tests/nuVal.js +65 -12
- package/tests/nuVnu.js +76 -26
- package/tests/qualWeb.js +89 -44
- package/tests/testaro.js +288 -273
- package/tests/wave.js +142 -117
- package/tests/wax.js +61 -42
- package/procs/getLocatorData.js +0 -192
- package/procs/identify.js +0 -250
- package/procs/isInlineLink.js +0 -42
- package/procs/screenShot.js +0 -32
- package/procs/standardize.js +0 -524
- package/procs/target.js +0 -90
- package/procs/tellServer.js +0 -43
- package/scripts/dumpAlts.js +0 -28
package/testaro/hover.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2021–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
-
https://opensource.org/license/mit/ for details.
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or https://opensource.org/license/mit/ for details.
|
|
7
6
|
|
|
8
7
|
SPDX-License-Identifier: MIT
|
|
9
8
|
*/
|
|
@@ -15,18 +14,55 @@
|
|
|
15
14
|
|
|
16
15
|
// IMPORTS
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
const {getBasicResult, getVisibleCountChange} = require('../procs/testaro');
|
|
20
|
-
// Module to perform Playwright operations.
|
|
17
|
+
const {getBasicResult} = require('../procs/testaro');
|
|
21
18
|
const playwright = require('playwright');
|
|
22
19
|
|
|
23
20
|
// FUNCTIONS
|
|
24
21
|
|
|
22
|
+
// Returns an awaited change in a visible element count.
|
|
23
|
+
const getVisibleCountChange = async (
|
|
24
|
+
rootLoc, elementCount0, timeLimit = 400, settleInterval = 75
|
|
25
|
+
) => {
|
|
26
|
+
const startTime = Date.now();
|
|
27
|
+
let timeout;
|
|
28
|
+
let settleChecker;
|
|
29
|
+
let elementCount1 = elementCount0;
|
|
30
|
+
// Set a time limit on the change.
|
|
31
|
+
const timeoutPromise = new Promise(resolve => {
|
|
32
|
+
timeout = setTimeout(() => {
|
|
33
|
+
clearInterval(settleChecker);
|
|
34
|
+
resolve();
|
|
35
|
+
}, timeLimit);
|
|
36
|
+
});
|
|
37
|
+
// Until the time limit expires, periodically:
|
|
38
|
+
const settlePromise = new Promise(resolve => {
|
|
39
|
+
settleChecker = setInterval(async () => {
|
|
40
|
+
const visiblesLoc = await rootLoc.locator('*:visible');
|
|
41
|
+
// Get the count.
|
|
42
|
+
elementCount1 = await visiblesLoc.count();
|
|
43
|
+
// If the count has changed:
|
|
44
|
+
if (elementCount1 !== elementCount0) {
|
|
45
|
+
// Stop.
|
|
46
|
+
clearTimeout(timeout);
|
|
47
|
+
clearInterval(settleChecker);
|
|
48
|
+
resolve();
|
|
49
|
+
}
|
|
50
|
+
}, settleInterval);
|
|
51
|
+
});
|
|
52
|
+
// When a change occurs or the time limit expires:
|
|
53
|
+
await Promise.race([timeoutPromise, settlePromise]);
|
|
54
|
+
const elapsedTime = Math.round(Date.now() - startTime);
|
|
55
|
+
// Return the change.
|
|
56
|
+
return {
|
|
57
|
+
change: elementCount1 - elementCount0,
|
|
58
|
+
elapsedTime
|
|
59
|
+
};
|
|
60
|
+
};
|
|
25
61
|
// Gets a violation description.
|
|
26
62
|
const getViolationDescription = (change, elapsedTime) =>
|
|
27
63
|
`Hovering over the element changes the related visible element count by ${change} in ${elapsedTime}ms`;
|
|
28
64
|
// Runs the test and returns the result.
|
|
29
|
-
exports.reporter = async (page, withItems) => {
|
|
65
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
30
66
|
// Initialize the locators and result.
|
|
31
67
|
const candidateLocs = await page.locator([
|
|
32
68
|
'[aria-controls]:visible',
|
|
@@ -103,5 +139,5 @@ exports.reporter = async (page, withItems) => {
|
|
|
103
139
|
}
|
|
104
140
|
// Get and return a result.
|
|
105
141
|
const whats = 'Hovering over elements changes the number of related visible elements';
|
|
106
|
-
return await getBasicResult(
|
|
142
|
+
return await getBasicResult(catalog, withItems, 'hover', 0, whats, data, violations);
|
|
107
143
|
};
|
package/testaro/hr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
2
|
+
© 2023–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
5
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
6
|
https://opensource.org/license/mit/ for details.
|
|
@@ -20,13 +20,13 @@ const {doTest} = require('../procs/testaro');
|
|
|
20
20
|
// FUNCTIONS
|
|
21
21
|
|
|
22
22
|
// Runs the test and returns the result.
|
|
23
|
-
exports.reporter = async (page, withItems) => {
|
|
23
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
24
24
|
const getBadWhat = element => {
|
|
25
25
|
// Return a violation description.
|
|
26
26
|
return `hr element is used for vertical segmentation`;
|
|
27
27
|
}
|
|
28
28
|
const whats = 'HR elements are used for vertical segmentation';
|
|
29
29
|
return await doTest(
|
|
30
|
-
page, withItems, 'hr', 'hr', whats, 0,
|
|
30
|
+
page, catalog, withItems, 'hr', 'hr', whats, 0, getBadWhat.toString()
|
|
31
31
|
);
|
|
32
32
|
};
|
package/testaro/imageLink.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
© 2025 Juan S. Casado.
|
|
4
|
-
© 2025 Jonathan Robert Pool
|
|
4
|
+
© 2025–2026 Jonathan Robert Pool
|
|
5
5
|
|
|
6
6
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
7
7
|
https://opensource.org/license/mit/ for details.
|
|
@@ -22,7 +22,7 @@ const {doTest} = require('../procs/testaro');
|
|
|
22
22
|
// FUNCTIONS
|
|
23
23
|
|
|
24
24
|
// Runs the test and returns the result.
|
|
25
|
-
exports.reporter = async (page, withItems) => {
|
|
25
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
26
26
|
const getBadWhat = element => {
|
|
27
27
|
const href = element.getAttribute('href') || '';
|
|
28
28
|
// If the destination of the element is an image file:
|
|
@@ -33,6 +33,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
33
33
|
};
|
|
34
34
|
const whats = 'Links have image files as their destinations';
|
|
35
35
|
return await doTest(
|
|
36
|
-
page, withItems, 'imageLink', 'a[href]', whats, 0,
|
|
36
|
+
page, catalog, withItems, 'imageLink', 'a[href]', whats, 0, getBadWhat.toString()
|
|
37
37
|
);
|
|
38
38
|
};
|
package/testaro/labClash.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
5
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
6
|
https://opensource.org/license/mit/ for details.
|
|
@@ -20,7 +20,7 @@ const {doTest} = require('../procs/testaro');
|
|
|
20
20
|
// FUNCTIONS
|
|
21
21
|
|
|
22
22
|
// Runs the test and returns the result.
|
|
23
|
-
exports.reporter = async (page, withItems) => {
|
|
23
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
24
24
|
const getBadWhat = element => {
|
|
25
25
|
// Get the label types of the element.
|
|
26
26
|
const labelTypes = [];
|
|
@@ -44,6 +44,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
44
44
|
const selector = 'button, input:not([type=hidden]), select, textarea';
|
|
45
45
|
const whats = 'Elements have inconsistent label types';
|
|
46
46
|
return await doTest(
|
|
47
|
-
page, withItems, 'labClash', selector, whats, 2,
|
|
47
|
+
page, catalog, withItems, 'labClash', selector, whats, 2, getBadWhat.toString()
|
|
48
48
|
);
|
|
49
49
|
};
|
package/testaro/legendLoc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
© 2025 Juan S. Casado.
|
|
4
|
-
© 2025 Jonathan Robert Pool.
|
|
4
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
5
5
|
|
|
6
6
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
7
7
|
https://opensource.org/license/mit/ for details.
|
|
@@ -22,7 +22,7 @@ const {doTest} = require('../procs/testaro');
|
|
|
22
22
|
// FUNCTIONS
|
|
23
23
|
|
|
24
24
|
// Runs the test and returns the result.
|
|
25
|
-
exports.reporter = async (page, withItems) => {
|
|
25
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
26
26
|
const getBadWhat = element => {
|
|
27
27
|
const parent = element.parentElement;
|
|
28
28
|
// If the element violates the rule:
|
|
@@ -33,6 +33,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
33
33
|
};
|
|
34
34
|
const whats = 'Legend elements are not the first children of fieldset elements';
|
|
35
35
|
return await doTest(
|
|
36
|
-
page, withItems, 'legendLoc', 'legend', whats, 3,
|
|
36
|
+
page, catalog, withItems, 'legendLoc', 'legend', whats, 3, getBadWhat.toString()
|
|
37
37
|
);
|
|
38
38
|
};
|
package/testaro/lineHeight.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
5
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
6
|
https://opensource.org/license/mit/ for details.
|
|
@@ -21,7 +21,7 @@ const {doTest} = require('../procs/testaro');
|
|
|
21
21
|
// FUNCTIONS
|
|
22
22
|
|
|
23
23
|
// Runs the test and returns the result.
|
|
24
|
-
exports.reporter = async (page, withItems) => {
|
|
24
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
25
25
|
const getBadWhat = element => {
|
|
26
26
|
// Get whether the element has a non-spacing child text node.
|
|
27
27
|
const hasText = Array.from(element.childNodes).some(child =>
|
|
@@ -47,6 +47,6 @@ exports.reporter = async (page, 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, withItems, 'lineHeight', '*', whats, 1,
|
|
50
|
+
page, catalog, withItems, 'lineHeight', '*', whats, 1, getBadWhat.toString()
|
|
51
51
|
);
|
|
52
52
|
};
|
package/testaro/linkAmb.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023–2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
5
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
6
|
https://opensource.org/license/mit/ for details.
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
// FUNCTIONS
|
|
18
18
|
|
|
19
19
|
// Runs the test and returns the result.
|
|
20
|
-
exports.reporter = async (page, withItems) => {
|
|
21
|
-
// Return totals and standard instances for the rule.
|
|
20
|
+
exports.reporter = async (page, _, withItems) => {
|
|
22
21
|
return await page.evaluate(withItems => {
|
|
23
22
|
// Get all links.
|
|
24
23
|
const allLinks = Array.from(document.body.getElementsByTagName('a'));
|
|
@@ -50,33 +49,42 @@ exports.reporter = async (page, withItems) => {
|
|
|
50
49
|
linkData.hrefs.add(href);
|
|
51
50
|
});
|
|
52
51
|
let violationCount = 0;
|
|
53
|
-
const
|
|
54
|
-
// For each
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (hrefs.size > 1) {
|
|
52
|
+
const standardInstances = [];
|
|
53
|
+
// For each link text:
|
|
54
|
+
for (const [text, {linkCount, hrefs}] of Object.entries(linksData.textTotals)) {
|
|
55
|
+
const destinationCount = hrefs.size;
|
|
56
|
+
// If links with it violate the rule:
|
|
57
|
+
if (destinationCount > 1) {
|
|
60
58
|
// Increment the violation count.
|
|
61
|
-
violationCount
|
|
59
|
+
violationCount += linkCount;
|
|
62
60
|
// If itemization is required:
|
|
63
61
|
if (withItems) {
|
|
64
|
-
const what = `${linkCount} links with
|
|
65
|
-
// Add an instance to the instances.
|
|
66
|
-
|
|
62
|
+
const what = `${linkCount} links with the text “${text}” have ${destinationCount} different destinations`;
|
|
63
|
+
// Add an instance to the standard instances.
|
|
64
|
+
standardInstances.push({
|
|
65
|
+
ruleID: 'linkAmb',
|
|
66
|
+
what,
|
|
67
|
+
ordinalSeverity: 2,
|
|
68
|
+
count: linkCount
|
|
69
|
+
});
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
|
-
}
|
|
72
|
+
}
|
|
70
73
|
// If there were any violations and itemization is not required:
|
|
71
74
|
if (violationCount && ! withItems) {
|
|
72
75
|
const what = 'Links have the same text but different destinations';
|
|
73
76
|
// Add a summary instance to the instances.
|
|
74
|
-
|
|
77
|
+
standardInstances.push({
|
|
78
|
+
ruleID: 'linkAmb',
|
|
79
|
+
what,
|
|
80
|
+
ordinalSeverity: 2,
|
|
81
|
+
count: violationCount
|
|
82
|
+
});
|
|
75
83
|
}
|
|
76
84
|
return {
|
|
77
85
|
data: {},
|
|
78
86
|
totals: [0, 0, violationCount, 0],
|
|
79
|
-
standardInstances
|
|
87
|
+
standardInstances
|
|
80
88
|
};
|
|
81
89
|
}, withItems);
|
|
82
90
|
};
|
package/testaro/linkExt.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
-
https://opensource.org/license/mit/ for details.
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or https://opensource.org/license/mit/ for details.
|
|
7
6
|
|
|
8
7
|
SPDX-License-Identifier: MIT
|
|
9
8
|
*/
|
|
@@ -19,13 +18,14 @@ const {doTest} = require('../procs/testaro');
|
|
|
19
18
|
|
|
20
19
|
// FUNCTIONS
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
// Runs the test and returns the result.
|
|
22
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
23
23
|
const getBadWhat = element => {
|
|
24
24
|
// Return a violation description.
|
|
25
25
|
return `Link has a target=_blank attribute`;
|
|
26
26
|
};
|
|
27
27
|
const whats = 'Links have target=_blank attributes';
|
|
28
28
|
return await doTest(
|
|
29
|
-
page, withItems, 'linkExt', 'a[target=_blank]', whats, 0,
|
|
29
|
+
page, catalog, withItems, 'linkExt', 'a[target=_blank]', whats, 0, getBadWhat.toString()
|
|
30
30
|
);
|
|
31
31
|
};
|
package/testaro/linkOldAtt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
5
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
6
|
https://opensource.org/license/mit/ for details.
|
|
@@ -19,7 +19,8 @@ const {doTest} = require('../procs/testaro');
|
|
|
19
19
|
|
|
20
20
|
// FUNCTIONS
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
// Runs the test and returns the result.
|
|
23
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
23
24
|
const getBadWhat = element => {
|
|
24
25
|
const attNames = element.getAttributeNames();
|
|
25
26
|
const allBadAttNames = ['charset', 'coords', 'name', 'rev', 'shape'];
|
|
@@ -38,6 +39,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
38
39
|
const selector = 'a[charset], a[coords], a[name], a[rev], a[shape]';
|
|
39
40
|
const whats = 'Links have deprecated attributes';
|
|
40
41
|
return await doTest(
|
|
41
|
-
page, withItems, 'linkOldAtt', selector, whats, 1,
|
|
42
|
+
page, catalog, withItems, 'linkOldAtt', selector, whats, 1, getBadWhat.toString()
|
|
42
43
|
);
|
|
43
44
|
};
|
package/testaro/linkTo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
5
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
6
|
https://opensource.org/license/mit/ for details.
|
|
@@ -17,7 +17,8 @@ const {doTest} = require('../procs/testaro');
|
|
|
17
17
|
|
|
18
18
|
// FUNCTIONS
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
// Runs the test and returns the result.
|
|
21
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
21
22
|
const getBadWhat = element => {
|
|
22
23
|
const isVisible = element.checkVisibility({
|
|
23
24
|
contentVisibilityAuto: true,
|
|
@@ -32,6 +33,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
32
33
|
};
|
|
33
34
|
const whats = 'Links are missing href attributes';
|
|
34
35
|
return await doTest(
|
|
35
|
-
page, withItems, 'linkTo', 'a:not([href]', whats, 2,
|
|
36
|
+
page, catalog, withItems, 'linkTo', 'a:not([href]', whats, 2, getBadWhat.toString()
|
|
36
37
|
);
|
|
37
38
|
};
|
package/testaro/linkUl.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
-
https://opensource.org/license/mit/ for details.
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or https://opensource.org/license/mit/ for details.
|
|
7
6
|
|
|
8
7
|
SPDX-License-Identifier: MIT
|
|
9
8
|
*/
|
|
@@ -20,7 +19,7 @@ const {doTest} = require('../procs/testaro');
|
|
|
20
19
|
// FUNCTIONS
|
|
21
20
|
|
|
22
21
|
// Runs the test and returns the result.
|
|
23
|
-
exports.reporter = async (page, withItems) => {
|
|
22
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
24
23
|
const getBadWhat = element => {
|
|
25
24
|
const liAncestor = element.closest('li');
|
|
26
25
|
// If the element is not the only link inside a list item:
|
|
@@ -41,6 +40,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
41
40
|
};
|
|
42
41
|
const whats = 'Links that are not list items are not underlined';
|
|
43
42
|
return await doTest(
|
|
44
|
-
page, withItems, 'linkUl', 'a', whats, 1,
|
|
43
|
+
page, catalog, withItems, 'linkUl', 'a', whats, 1, getBadWhat.toString()
|
|
45
44
|
);
|
|
46
45
|
};
|
package/testaro/miniText.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2022–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
5
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
6
|
https://opensource.org/license/mit/ for details.
|
|
@@ -21,7 +21,8 @@ const {doTest} = require('../procs/testaro');
|
|
|
21
21
|
|
|
22
22
|
// FUNCTIONS
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// Runs the test and returns the result.
|
|
25
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
25
26
|
const getBadWhat = element => {
|
|
26
27
|
const rawText = element.textContent || '';
|
|
27
28
|
// If the element has text content with any non-whitespace:
|
|
@@ -47,6 +48,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
47
48
|
};
|
|
48
49
|
const whats = 'Visible elements have font sizes smaller than 11 pixels';
|
|
49
50
|
return await doTest(
|
|
50
|
-
page, withItems, 'miniText', 'body *:not(script, style)', whats, 2,
|
|
51
|
+
page, catalog, withItems, 'miniText', 'body *:not(script, style)', whats, 2, getBadWhat.toString()
|
|
51
52
|
);
|
|
52
53
|
};
|
package/testaro/motion.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
© 2025 Jonathan Robert Pool.
|
|
2
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
3
3
|
Licensed under the MIT License. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -14,13 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
// IMPORTS
|
|
16
16
|
|
|
17
|
-
// Module to process files.
|
|
18
17
|
const fs = require('fs/promises');
|
|
19
|
-
// Module to get operating-system properties.
|
|
20
18
|
const os = require('os');
|
|
21
|
-
// Module to compare screenshots.
|
|
22
19
|
const blazediff = require('@blazediff/core').diff;
|
|
23
|
-
// Module to parse PNGs.
|
|
24
20
|
const {PNG} = require('pngjs');
|
|
25
21
|
|
|
26
22
|
// CONSTANTS
|
|
@@ -29,7 +25,7 @@ const tmpDir = os.tmpdir();
|
|
|
29
25
|
|
|
30
26
|
// FUNCTIONS
|
|
31
27
|
|
|
32
|
-
//
|
|
28
|
+
// Runs the test and returns the result.
|
|
33
29
|
exports.reporter = async page => {
|
|
34
30
|
// Initialize the totals and standard instances.
|
|
35
31
|
const data = {};
|
|
@@ -81,23 +77,8 @@ exports.reporter = async page => {
|
|
|
81
77
|
standardInstances.push({
|
|
82
78
|
ruleID: 'motion',
|
|
83
79
|
what: violationWhat,
|
|
84
|
-
count: 1,
|
|
85
80
|
ordinalSeverity,
|
|
86
|
-
|
|
87
|
-
id: '',
|
|
88
|
-
location: {
|
|
89
|
-
doc: 'dom',
|
|
90
|
-
type: 'box',
|
|
91
|
-
spec: {
|
|
92
|
-
x: 0,
|
|
93
|
-
y: 0,
|
|
94
|
-
width,
|
|
95
|
-
height
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
excerpt: '<html>…</html>',
|
|
99
|
-
boxID: `0:0:${width}:${height}`,
|
|
100
|
-
pathID: '/html'
|
|
81
|
+
count: 1
|
|
101
82
|
});
|
|
102
83
|
}
|
|
103
84
|
}
|
package/testaro/nonTable.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2022–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
-
https://opensource.org/license/mit/ for details.
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or https://opensource.org/license/mit/ for details.
|
|
7
6
|
|
|
8
7
|
SPDX-License-Identifier: MIT
|
|
9
8
|
*/
|
|
@@ -21,7 +20,7 @@ const {doTest} = require('../procs/testaro');
|
|
|
21
20
|
// FUNCTIONS
|
|
22
21
|
|
|
23
22
|
// Runs the test and returns the result.
|
|
24
|
-
exports.reporter = async (page, withItems) => {
|
|
23
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
25
24
|
const getBadWhat = element => {
|
|
26
25
|
// If the element contains another table:
|
|
27
26
|
if (element.querySelector('table')) {
|
|
@@ -57,6 +56,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
57
56
|
};
|
|
58
57
|
const whats = 'table elements are misused for non-table content';
|
|
59
58
|
return await doTest(
|
|
60
|
-
page, withItems, 'nonTable', 'table', whats, 2,
|
|
59
|
+
page, catalog, withItems, 'nonTable', 'table', whats, 2, getBadWhat.toString()
|
|
61
60
|
);
|
|
62
61
|
};
|
package/testaro/optRoleSel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
© 2025 Juan S. Casado.
|
|
4
|
-
© 2025 Jonathan Robert Pool.
|
|
4
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
5
5
|
|
|
6
6
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
7
7
|
https://opensource.org/license/mit/ for details.
|
|
@@ -22,7 +22,7 @@ const {doTest} = require('../procs/testaro');
|
|
|
22
22
|
// FUNCTIONS
|
|
23
23
|
|
|
24
24
|
// Runs the test and returns the result.
|
|
25
|
-
exports.reporter = async (page, withItems) => {
|
|
25
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
26
26
|
const getBadWhat = element => {
|
|
27
27
|
// If the element has no aria-selected attribute:
|
|
28
28
|
if (! element.hasAttribute('aria-selected')) {
|
|
@@ -32,6 +32,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
32
32
|
};
|
|
33
33
|
const whats = 'Elements with role=option have no aria-selected attributes';
|
|
34
34
|
return await doTest(
|
|
35
|
-
page, withItems, 'optRoleSel', '[role="option"]', whats, 1,
|
|
35
|
+
page, catalog, withItems, 'optRoleSel', '[role="option"]', whats, 1, getBadWhat.toString()
|
|
36
36
|
);
|
|
37
37
|
};
|
package/testaro/phOnly.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
© 2025 Juan S. Casado.
|
|
4
|
-
© 2025 Jonathan Robert Pool.
|
|
4
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
5
5
|
|
|
6
6
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
7
7
|
https://opensource.org/license/mit/ for details.
|
|
@@ -22,7 +22,7 @@ const {doTest} = require('../procs/testaro');
|
|
|
22
22
|
// FUNCTIONS
|
|
23
23
|
|
|
24
24
|
// Runs the test and returns the result.
|
|
25
|
-
exports.reporter = async (page, withItems) => {
|
|
25
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
26
26
|
const getBadWhat = element => {
|
|
27
27
|
// Get the accessible name of the element.
|
|
28
28
|
const accessibleName = window.getAccessibleName(element);
|
|
@@ -34,6 +34,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
34
34
|
};
|
|
35
35
|
const whats = 'input elements have placeholders but no accessible names';
|
|
36
36
|
return await doTest(
|
|
37
|
-
page, withItems, 'phOnly', 'input[placeholder]', whats, 2,
|
|
37
|
+
page, catalog, withItems, 'phOnly', 'input[placeholder]', whats, 2, getBadWhat.toString()
|
|
38
38
|
);
|
|
39
39
|
};
|
package/testaro/pseudoP.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
-
https://opensource.org/license/mit/ for details.
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or https://opensource.org/license/mit/ for details.
|
|
7
6
|
|
|
8
7
|
SPDX-License-Identifier: MIT
|
|
9
8
|
*/
|
|
@@ -18,7 +17,8 @@ const {doTest} = require('../procs/testaro');
|
|
|
18
17
|
|
|
19
18
|
// FUNCTIONS
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
// Runs the test and returns the result.
|
|
21
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
22
22
|
const getBadWhat = element => {
|
|
23
23
|
// Get the node before the element node.
|
|
24
24
|
const previousNode = element.previousSibling;
|
|
@@ -49,6 +49,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
49
49
|
};
|
|
50
50
|
const whats = 'br elements follow other br elements, possibly constituting pseudo-paragraphs';
|
|
51
51
|
return await doTest(
|
|
52
|
-
page, withItems, 'pseudoP', 'body br', whats, 0,
|
|
52
|
+
page, catalog, withItems, 'pseudoP', 'body br', whats, 0, getBadWhat.toString()
|
|
53
53
|
);
|
|
54
54
|
};
|
package/testaro/radioSet.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2021–2023 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
-
https://opensource.org/license/mit/ for details.
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or https://opensource.org/license/mit/ for details.
|
|
7
6
|
|
|
8
7
|
SPDX-License-Identifier: MIT
|
|
9
8
|
*/
|
|
@@ -20,7 +19,7 @@ const {doTest} = require('../procs/testaro');
|
|
|
20
19
|
// FUNCTIONS
|
|
21
20
|
|
|
22
21
|
// Runs the test and returns the result.
|
|
23
|
-
exports.reporter = async (page, withItems) => {
|
|
22
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
24
23
|
const getBadWhat = element => {
|
|
25
24
|
// Get the name of the element.
|
|
26
25
|
const elName = element.name;
|
|
@@ -70,6 +69,6 @@ exports.reporter = async (page, withItems) => {
|
|
|
70
69
|
};
|
|
71
70
|
const whats = 'Radio buttons are not validly grouped in fieldsets with legends';
|
|
72
71
|
return await doTest(
|
|
73
|
-
page, withItems, 'radioSet', 'input[type=radio]', whats, 2,
|
|
72
|
+
page, catalog, withItems, 'radioSet', 'input[type=radio]', whats, 2, getBadWhat.toString()
|
|
74
73
|
);
|
|
75
74
|
};
|
package/testaro/role.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2021–2025 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
-
© 2025 Jonathan Robert Pool.
|
|
3
|
+
© 2025–2026 Jonathan Robert Pool.
|
|
4
4
|
|
|
5
|
-
Licensed under the MIT License. See LICENSE file at the project root or
|
|
6
|
-
https://opensource.org/license/mit/ for details.
|
|
5
|
+
Licensed under the MIT License. See LICENSE file at the project root or https://opensource.org/license/mit/ for details.
|
|
7
6
|
|
|
8
7
|
SPDX-License-Identifier: MIT
|
|
9
8
|
*/
|
|
@@ -26,7 +25,7 @@ const implicitRoles = new Set(Array.from(elementRoles.values()).flat());
|
|
|
26
25
|
// FUNCTIONS
|
|
27
26
|
|
|
28
27
|
// Runs the test and returns the result.
|
|
29
|
-
exports.reporter = async (page, withItems) => {
|
|
28
|
+
exports.reporter = async (page, catalog, withItems) => {
|
|
30
29
|
// Get locators for the elements with explicit roles.
|
|
31
30
|
const loc = page.locator('[role]');
|
|
32
31
|
const locs = await loc.all();
|
|
@@ -45,5 +44,5 @@ exports.reporter = async (page, withItems) => {
|
|
|
45
44
|
}
|
|
46
45
|
// Get and return a result.
|
|
47
46
|
const whats = 'Elements have roles assigned that are also implicit HTML element roles';
|
|
48
|
-
return await getBasicResult(
|
|
47
|
+
return await getBasicResult(catalog, withItems, 'role', 0, whats, {}, violations);
|
|
49
48
|
};
|