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/tests/qualWeb.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.
|
|
@@ -19,8 +19,7 @@ const {QualWeb} = require('@qualweb/core');
|
|
|
19
19
|
const {ACTRules} = require('@qualweb/act-rules');
|
|
20
20
|
const {WCAGTechniques} = require('@qualweb/wcag-techniques');
|
|
21
21
|
const {BestPractices} = require('@qualweb/best-practices');
|
|
22
|
-
const {
|
|
23
|
-
const {getElementData} = require('../procs/getLocatorData');
|
|
22
|
+
const {getAttributeXPath, getXPathCatalogIndex} = require('../procs/xPath');
|
|
24
23
|
|
|
25
24
|
// CONSTANTS
|
|
26
25
|
|
|
@@ -31,6 +30,20 @@ const qualWeb = new QualWeb({
|
|
|
31
30
|
const actRulesModule = new ACTRules({});
|
|
32
31
|
const wcagModule = new WCAGTechniques({});
|
|
33
32
|
const bpModule = new BestPractices({});
|
|
33
|
+
const ordinalSeverities = {
|
|
34
|
+
'act-rules': {
|
|
35
|
+
'warning': 1,
|
|
36
|
+
'failure': 3
|
|
37
|
+
},
|
|
38
|
+
'wcag-techniques': {
|
|
39
|
+
'warning': 0,
|
|
40
|
+
'failure': 2
|
|
41
|
+
},
|
|
42
|
+
'best-practices': {
|
|
43
|
+
'warning': 0,
|
|
44
|
+
'failure': 1
|
|
45
|
+
}
|
|
46
|
+
}
|
|
34
47
|
|
|
35
48
|
// FUNCTIONS
|
|
36
49
|
|
|
@@ -38,15 +51,27 @@ const bpModule = new BestPractices({});
|
|
|
38
51
|
exports.reporter = async (page, report, actIndex, timeLimit) => {
|
|
39
52
|
const act = report.acts[actIndex];
|
|
40
53
|
const {withNewContent, rules} = act;
|
|
41
|
-
const data = {};
|
|
42
|
-
let result = {};
|
|
43
54
|
const clusterOptions = {
|
|
44
55
|
maxConcurrency: 1,
|
|
45
56
|
timeout: timeLimit * 1000,
|
|
46
57
|
monitor: false
|
|
47
58
|
};
|
|
48
|
-
//
|
|
49
|
-
|
|
59
|
+
// Initialize the act report.
|
|
60
|
+
const data = {};
|
|
61
|
+
const result = {
|
|
62
|
+
nativeResult: {},
|
|
63
|
+
standardResult: {}
|
|
64
|
+
};
|
|
65
|
+
const standard = report.standard !== 'no';
|
|
66
|
+
// If standard results are to be reported:
|
|
67
|
+
if (standard) {
|
|
68
|
+
// Initialize the standard result.
|
|
69
|
+
result.standardResult = {
|
|
70
|
+
prevented: false,
|
|
71
|
+
totals: [0, 0, 0, 0],
|
|
72
|
+
instances: []
|
|
73
|
+
};
|
|
74
|
+
}
|
|
50
75
|
try {
|
|
51
76
|
// Start the QualWeb core engine.
|
|
52
77
|
await qualWeb.start(clusterOptions, {
|
|
@@ -162,12 +187,13 @@ exports.reporter = async (page, report, actIndex, timeLimit) => {
|
|
|
162
187
|
};
|
|
163
188
|
}
|
|
164
189
|
// Otherwise, i.e. if the evaluation succeeded, get the report.
|
|
165
|
-
result = qwReport[withNewContent ? qualWebOptions.url : 'customHtml'];
|
|
190
|
+
result.nativeResult = qwReport[withNewContent ? qualWebOptions.url : 'customHtml'];
|
|
191
|
+
const {nativeResult, standardResult} = result;
|
|
166
192
|
// If it contains a copy of the DOM:
|
|
167
|
-
if (
|
|
193
|
+
if (nativeResult?.system?.page?.dom) {
|
|
168
194
|
// Delete the copy.
|
|
169
|
-
delete
|
|
170
|
-
const {modules} =
|
|
195
|
+
delete nativeResult.system.page.dom;
|
|
196
|
+
const {modules} = nativeResult;
|
|
171
197
|
// If the report contains a modules property:
|
|
172
198
|
if (modules) {
|
|
173
199
|
// For each test section in it:
|
|
@@ -184,41 +210,60 @@ exports.reporter = async (page, report, actIndex, timeLimit) => {
|
|
|
184
210
|
for (const ruleID of ruleIDs) {
|
|
185
211
|
const ruleAssertions = assertions[ruleID];
|
|
186
212
|
const {metadata} = ruleAssertions;
|
|
187
|
-
// If
|
|
188
|
-
if (metadata) {
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
213
|
+
// If there were any warnings or failures:
|
|
214
|
+
if (metadata?.warning || metadata?.failed) {
|
|
215
|
+
// Delete nonviolations from the results.
|
|
216
|
+
ruleAssertions.results = ruleAssertions.results.filter(
|
|
217
|
+
raResult => raResult.verdict !== 'passed'
|
|
218
|
+
);
|
|
219
|
+
// For each test result:
|
|
220
|
+
for (const raResult of ruleAssertions.results) {
|
|
221
|
+
const {elements, verdict} = raResult;
|
|
222
|
+
// If any violations are reported:
|
|
223
|
+
if (elements?.length) {
|
|
224
|
+
// For each violating element:
|
|
225
|
+
for (const element of elements) {
|
|
226
|
+
// Limit the size of its reported excerpt.
|
|
227
|
+
if (element.htmlCode?.length > 2000) {
|
|
228
|
+
element.htmlCode = `${element.htmlCode.slice(0, 2000)} …`;
|
|
229
|
+
}
|
|
230
|
+
// If standard results are to be reported:
|
|
231
|
+
if (standard) {
|
|
232
|
+
// Initialize a standard instance.
|
|
233
|
+
const what = `[${verdict}] ${raResult.description}`;
|
|
234
|
+
const instance = {
|
|
235
|
+
ruleID,
|
|
236
|
+
what,
|
|
237
|
+
ordinalSeverity: ordinalSeverities[section][verdict],
|
|
238
|
+
count: 1
|
|
239
|
+
};
|
|
240
|
+
// Get the pathID of the element or, if none, the document pathID.
|
|
241
|
+
const pathID = getAttributeXPath(element.htmlCode) || '/html';
|
|
242
|
+
const {catalog} = report;
|
|
243
|
+
// Use it to get the catalog index.
|
|
244
|
+
const catalogIndex = getXPathCatalogIndex(catalog, pathID);
|
|
245
|
+
// If the acquisition succeeded:
|
|
246
|
+
if (catalogIndex) {
|
|
247
|
+
// Add the catalog index to the instance.
|
|
248
|
+
instance.catalogIndex = catalogIndex;
|
|
249
|
+
}
|
|
250
|
+
// Otherwise, i.e. if the acquisition failed:
|
|
251
|
+
else {
|
|
252
|
+
// Add the XPath to the instance.
|
|
253
|
+
instance.pathID = pathID;
|
|
254
|
+
}
|
|
255
|
+
// Add the instance to the standard result.
|
|
256
|
+
standardResult.instances.push(instance);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
201
259
|
}
|
|
202
|
-
}
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
// Otherwise, i.e. if there were no warnings or failures:
|
|
263
|
+
else {
|
|
264
|
+
// Delete the rule.
|
|
265
|
+
delete assertions[ruleID];
|
|
203
266
|
}
|
|
204
|
-
// Shorten long HTML codes of elements.
|
|
205
|
-
const {results} = ruleAssertions;
|
|
206
|
-
// For each test result:
|
|
207
|
-
for (const raResult of results) {
|
|
208
|
-
const {elements} = raResult;
|
|
209
|
-
// If any violations are reported:
|
|
210
|
-
if (elements && elements.length) {
|
|
211
|
-
// For each violating element:
|
|
212
|
-
for (const element of elements) {
|
|
213
|
-
// Add location data from its excerpt to the element data.
|
|
214
|
-
element.locationData = await getElementData(page, element.htmlCode);
|
|
215
|
-
// Limit the size of its reported excerpt.
|
|
216
|
-
if (element.htmlCode && element.htmlCode.length > 700) {
|
|
217
|
-
element.htmlCode = `${element.htmlCode.slice(0, 700)} …`;
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
267
|
};
|
|
223
268
|
}
|
|
224
269
|
else {
|