testaro 69.3.1 → 69.4.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "69.3.1",
3
+ "version": "69.4.1",
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/testaro/tabNav.js CHANGED
@@ -163,7 +163,7 @@ const testTabs = async (tabs, index, listOrientation, listIsCorrect, withItems,
163
163
  // If itemization is required:
164
164
  if (withItems) {
165
165
  // Initialize a report on the element.
166
- itemData.xPath = await page.evaluate(element => window.getXPath(element));
166
+ itemData.xPath = await page.evaluate(element => window.getXPath(element), currentTab);
167
167
  itemData.navigationErrors = [];
168
168
  }
169
169
  // Test the element with each navigation key.
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
- 'failure': 3
36
+ 'failed': 3
37
37
  },
38
38
  'wcag-techniques': {
39
39
  'warning': 0,
40
- 'failure': 2
40
+ 'failed': 2
41
41
  },
42
42
  'best-practices': {
43
43
  'warning': 0,
44
- 'failure': 1
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
- // Otherwise, i.e. if the evaluation succeeded, get the report.
189
+ // Add the report to the result.
190
190
  result.nativeResult = qwReport[withNewContent ? qualWebOptions.url : 'customHtml'];
191
191
  const {nativeResult, standardResult} = result;
192
- // If it contains a copy of the DOM:
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 = `qualWeb evaluation failed (${error.message})`;
314
+ data.error = `QualWeb failed (${error.message})`;
304
315
  }
305
316
  return {
306
317
  data,