testaro 28.2.2 → 28.2.4

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/run.js +8 -11
  3. package/watch.js +3 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "28.2.2",
3
+ "version": "28.2.4",
4
4
  "description": "Run 960 web accessibility tests from 9 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/run.js CHANGED
@@ -13,9 +13,6 @@ const {actSpecs} = require('./actSpecs');
13
13
  const {browserClose, getNonce, goTo, launch} = require('./procs/nav');
14
14
  // Module to standardize report formats.
15
15
  const {standardize} = require('./procs/standardize');
16
- // HTTP and HTTPS clients.
17
- const http = require('http');
18
- const https = require('https');
19
16
 
20
17
  // ########## CONSTANTS
21
18
 
@@ -118,7 +115,7 @@ const hasSubtype = (variable, subtype) => {
118
115
  return tests[variable];
119
116
  }
120
117
  else if (subtype === 'isWaitable') {
121
- return waitables.includes(variable);
118
+ return ['url', 'title', 'body'].includes(variable);
122
119
  }
123
120
  else if (subtype === 'areNumbers') {
124
121
  return areNumbers(variable);
@@ -483,7 +480,7 @@ const doActs = async (report, actIndex, page) => {
483
480
  // If the notification threw an error:
484
481
  request.on('error', error => {
485
482
  // Report the error.
486
- const errorMessage = `ERROR notifying the server of an act`;
483
+ const errorMessage = 'ERROR notifying the server of an act';
487
484
  console.log(`${errorMessage} (${error.message})`);
488
485
  });
489
486
  request.end();
@@ -582,12 +579,12 @@ const doActs = async (report, actIndex, page) => {
582
579
  addError(act, 'badRedirection', 'ERROR: Navigation illicitly redirected');
583
580
  await abortActs();
584
581
  }
585
- }
586
- // If the visit failed:
587
- if (response.error) {
588
- // Report this and quit.
589
- addError(act, 'failure', 'ERROR: Visits failed');
590
- await abortActs();
582
+ // Otherwise, i.e. if the visit failed:
583
+ else {
584
+ // Report this and quit.
585
+ addError(act, 'failure', 'ERROR: Visit failed');
586
+ await abortActs();
587
+ }
591
588
  }
592
589
  }
593
590
  // Otherwise, if the act is a wait for text:
package/watch.js CHANGED
@@ -158,7 +158,7 @@ const writeDirReport = async report => {
158
158
  console.log(`Report ${reportName} saved in ${rawDir}`);
159
159
  }
160
160
  catch(error) {
161
- console.log(`ERROR: Failed to write report (${error.message})`);
161
+ console.log(`ERROR: Failed to write report ${jobID} (${error.message})`);
162
162
  }
163
163
  }
164
164
  else {
@@ -223,7 +223,6 @@ const writeNetReport = async report => {
223
223
  else {
224
224
  return '';
225
225
  }
226
- return ack;
227
226
  };
228
227
  // Archives a job.
229
228
  const archiveJob = async (job, watchee) => {
@@ -255,7 +254,7 @@ const runJob = async (job, isDirWatch) => {
255
254
  }
256
255
  // Otherwise, i.e. if the network was watched:
257
256
  else {
258
- // Send the report to the server.
257
+ // Send the report to the server and report its response.
259
258
  const ack = await writeNetReport(job);
260
259
  console.log(ack);
261
260
  }
@@ -279,7 +278,7 @@ exports.cycle = async (isDirWatch, isForever, interval = 300, watchee = null) =>
279
278
  let empty = false;
280
279
  const intervalMS = 1000 * Number.parseInt(interval);
281
280
  const intervalSpec = isForever ? `with intervals of ${interval} seconds when idle ` : '';
282
- console.log(`Watching started ${intervalSpec}(${nowString()})`);
281
+ console.log(`Watching started ${intervalSpec}(${nowString()})\n`);
283
282
  while (statusOK) {
284
283
  if (empty) {
285
284
  await wait(intervalMS);