testaro 59.2.11 → 59.3.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "59.2.11",
3
+ "version": "59.3.0",
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/run.js CHANGED
@@ -92,6 +92,8 @@ const timeLimits = {
92
92
  ibm: 30,
93
93
  testaro: 150 + Math.round(6 * process.env.WAITS / 1000)
94
94
  };
95
+ // Timeout multiplier.
96
+ const timeoutMultiplier = Number.parseFloat(process.env.TIMEOUT_MULTIPLIER) || 1;
95
97
 
96
98
  // Temporary directory
97
99
  const tmpDir = os.tmpdir();
@@ -721,7 +723,7 @@ const doActs = async (report, opts = {}) => {
721
723
  const actResult = await new Promise(resolve => {
722
724
  let closed = false;
723
725
  const child = fork(
724
- `${__dirname}/procs/doTestAct`, [actIndex], {timeout: 1000 * timeLimits[act.which] || 15000}
726
+ `${__dirname}/procs/doTestAct`, [actIndex], {timeout: timeoutMultiplier * 1000 * (timeLimits[act.which] || 15)}
725
727
  );
726
728
  child.on('message', message => {
727
729
  if (! closed) {
package/tests/testaro.js CHANGED
@@ -40,25 +40,6 @@ const fs = require('fs/promises');
40
40
  // CONSTANTS
41
41
 
42
42
  // The validation job data for the tests listed below are in the pending directory.
43
- /*
44
- const futureEvalRulesTraining = {
45
- altScheme: 'img elements with alt attributes having URLs as their entire values',
46
- captionLoc: 'caption elements that are not first children of table elements',
47
- datalistRef: 'elements with ambiguous or missing referenced datalist elements',
48
- secHeading: 'headings that violate the logical level order in their sectioning containers',
49
- textSem: 'semantically vague elements i, b, and/or small'
50
- };
51
- const futureEvalRulesCleanRoom = {
52
- adbID: 'elements with ambiguous or missing referenced descriptions',
53
- imageLink: 'links with image files as their destinations',
54
- legendLoc: 'legend elements that are not first children of fieldset elements',
55
- optRoleSel: 'Non-option elements with option roles that have no aria-selected attributes',
56
- phOnly: 'input elements with placeholders but no accessible names'
57
- };
58
- */
59
- // The following were previously marked as future (clean-room) rules.
60
- // For local validation runs they are included in evalRules below. Remove from futureRules
61
- // when preparing clean-room submissions.
62
43
  const futureRules = new Set([]);
63
44
  const evalRules = {
64
45
  adbID: 'elements with ambiguous or missing referenced descriptions',
@@ -152,6 +133,7 @@ const slowTestLimits = {
152
133
  tabNav: 10,
153
134
  textSem: 10
154
135
  };
136
+ const timeoutMultiplier = Number.parseFloat(process.env.TIMEOUT_MULTIPLIER) || 1;
155
137
 
156
138
  // ERROR HANDLER
157
139
  process.on('unhandledRejection', reason => {
@@ -296,7 +278,7 @@ exports.reporter = async (page, report, actIndex) => {
296
278
  while (testRetries > 0 && ! testSuccess) {
297
279
  try {
298
280
  // Apply a time limit to the test.
299
- const timeLimit = 1000 * (slowTestLimits[rule] ?? 5);
281
+ const timeLimit = 1000 * timeoutMultiplier * (slowTestLimits[rule] ?? 5);
300
282
  // If the time limit expires during the test:
301
283
  const timer = new Promise(resolve => {
302
284
  timeout = setTimeout(() => {
@@ -383,9 +365,12 @@ exports.reporter = async (page, report, actIndex) => {
383
365
  break;
384
366
  }
385
367
  }
368
+ finally {
369
+ // Clear the timeout.
370
+ clearTimeout(timeout);
371
+ }
386
372
  }
387
- // Clear the timeout and the error listeners.
388
- clearTimeout(timeout);
373
+ // Clear the error listeners.
389
374
  if (page && ! page.isClosed() && crashHandler) {
390
375
  page.off('crash', crashHandler);
391
376
  }