testaro 69.3.0 → 69.4.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/package.json +1 -1
- package/procs/doActs.js +3 -1
- package/tests/qualWeb.js +19 -8
package/package.json
CHANGED
package/procs/doActs.js
CHANGED
|
@@ -1154,7 +1154,9 @@ exports.doActs = async (report, opts = {}) => {
|
|
|
1154
1154
|
if (standard === 'only') {
|
|
1155
1155
|
// Remove them.
|
|
1156
1156
|
localReport.acts.forEach(act => {
|
|
1157
|
-
|
|
1157
|
+
if (act.result?.nativeResult) {
|
|
1158
|
+
delete act.result.nativeResult;
|
|
1159
|
+
}
|
|
1158
1160
|
});
|
|
1159
1161
|
}
|
|
1160
1162
|
// If a catalog was created:
|
package/tests/qualWeb.js
CHANGED
|
@@ -33,15 +33,15 @@ const bpModule = new BestPractices({});
|
|
|
33
33
|
const ordinalSeverities = {
|
|
34
34
|
'act-rules': {
|
|
35
35
|
'warning': 1,
|
|
36
|
-
'
|
|
36
|
+
'failed': 3
|
|
37
37
|
},
|
|
38
38
|
'wcag-techniques': {
|
|
39
39
|
'warning': 0,
|
|
40
|
-
'
|
|
40
|
+
'failed': 2
|
|
41
41
|
},
|
|
42
42
|
'best-practices': {
|
|
43
43
|
'warning': 0,
|
|
44
|
-
'
|
|
44
|
+
'failed': 1
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -186,15 +186,15 @@ exports.reporter = async (page, report, actIndex, timeLimit) => {
|
|
|
186
186
|
result
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
//
|
|
189
|
+
// Add the report to the result.
|
|
190
190
|
result.nativeResult = qwReport[withNewContent ? qualWebOptions.url : 'customHtml'];
|
|
191
191
|
const {nativeResult, standardResult} = result;
|
|
192
|
-
// If
|
|
192
|
+
// If the report contains, as it should, a copy of the DOM:
|
|
193
193
|
if (nativeResult?.system?.page?.dom) {
|
|
194
|
-
// Delete the copy.
|
|
194
|
+
// Delete the copy for parsimony.
|
|
195
195
|
delete nativeResult.system.page.dom;
|
|
196
196
|
const {modules} = nativeResult;
|
|
197
|
-
// If the report contains a modules property:
|
|
197
|
+
// If the report contains, as it should, a modules property:
|
|
198
198
|
if (modules) {
|
|
199
199
|
// For each test section in it:
|
|
200
200
|
for (const section of ['act-rules', 'wcag-techniques', 'best-practices']) {
|
|
@@ -229,6 +229,9 @@ exports.reporter = async (page, report, actIndex, timeLimit) => {
|
|
|
229
229
|
}
|
|
230
230
|
// If standard results are to be reported:
|
|
231
231
|
if (standard) {
|
|
232
|
+
const ordinalSeverity = ordinalSeverities[section][verdict];
|
|
233
|
+
// Increment the applicable total.
|
|
234
|
+
standardResult.totals[ordinalSeverity]++;
|
|
232
235
|
// Initialize a standard instance.
|
|
233
236
|
const what = `[${verdict}] ${raResult.description}`;
|
|
234
237
|
const instance = {
|
|
@@ -266,24 +269,32 @@ exports.reporter = async (page, report, actIndex, timeLimit) => {
|
|
|
266
269
|
}
|
|
267
270
|
};
|
|
268
271
|
}
|
|
272
|
+
// Otherwise, i.e. if it contains no assertions:
|
|
269
273
|
else {
|
|
274
|
+
// Report this.
|
|
270
275
|
data.prevented = true;
|
|
271
276
|
data.error = 'No assertions';
|
|
272
277
|
}
|
|
273
278
|
}
|
|
279
|
+
// Otherwise, i.e. if the section is missing:
|
|
274
280
|
else {
|
|
281
|
+
// Report this.
|
|
275
282
|
data.prevented = true;
|
|
276
283
|
data.error = `No ${section} section`;
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
286
|
}
|
|
280
287
|
}
|
|
288
|
+
// Otherwise, i.e. if the report does not contain a modules property:
|
|
281
289
|
else {
|
|
290
|
+
// Report this.
|
|
282
291
|
data.prevented = true;
|
|
283
292
|
data.error = 'No modules';
|
|
284
293
|
}
|
|
285
294
|
}
|
|
295
|
+
// Otherwise, i.e. if the report does not contain a copy of the DOM:
|
|
286
296
|
else {
|
|
297
|
+
// Report this.
|
|
287
298
|
data.prevented = true;
|
|
288
299
|
data.error = 'No DOM';
|
|
289
300
|
}
|
|
@@ -300,7 +311,7 @@ exports.reporter = async (page, report, actIndex, timeLimit) => {
|
|
|
300
311
|
}
|
|
301
312
|
catch(error) {
|
|
302
313
|
data.prevented = true;
|
|
303
|
-
data.error = `
|
|
314
|
+
data.error = `QualWeb failed (${error.message})`;
|
|
304
315
|
}
|
|
305
316
|
return {
|
|
306
317
|
data,
|