testaro 2.0.4 → 2.0.5

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/README.md +12 -17
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -413,33 +413,28 @@ A batch offers an efficient way to perform a uniform set of operations on every
413
413
 
414
414
  A no-batch script offers a way to carry out a complex operation, which can include navigating from one host to another, which is not possible with a batch. Any `url` commands are performed as-is, without changes to their URLs.
415
415
 
416
- ## Reports
417
-
418
- Testaro writes reports as files in JSON format. They contain detailed results.
419
-
420
- Testaro also writes to standard output a list of the names of the files containing the reports.
421
-
422
416
  ## Execution
423
417
 
424
418
  ### Invocation
425
419
 
426
- To run Testaro, create an _invocation_ file like this:
420
+ To run Testaro, create an options object like this:
427
421
 
428
422
  ```javascript
429
- const options = {
430
- reports: `${__readdir}/path/to/reports/directory`,
431
- batch: `${__readdir}/path/to/batch/file.json`,
432
- script: `${__readdir}/path/to/script/file.json`
433
- };
434
- const {handleRequest} = require('testaro');
435
- handleRequest(options);
423
+ {
424
+ log: [],
425
+ reports: [],
426
+ script: {abc},
427
+ batch: {def}
428
+ }
436
429
  ```
437
430
 
438
- The `batch` option is optional. If there is no batch, omit it.
431
+ Replace `{abc}` with a script object, like the example script shown above.
432
+
433
+ Replace `{def}` with a batch object, like the example batch shown above, or omit the `batch` property if there is no batch.
439
434
 
440
- The paths are relative to the directory containing the file. So, if the script file is `script.json` and is in the same directory as the invocation file, the path would be `${__readdir}/script.json`.
435
+ Then execute the statement `require('testaro').handleRequest(ghi)`, where `ghi` is replaced with the name of the options object. That statement will run Testaro.
441
436
 
442
- If the invocation file is named `runTestaro.js`, execute it with the statement `node runTestaro`.
437
+ While it runs, Testaro will populate the `log` and `reports` arrays of the options object. When Testaro finishes, the `log` and `reports` arrays will contain its results.
443
438
 
444
439
  ### Environment variables
445
440
 
package/index.js CHANGED
@@ -1068,7 +1068,7 @@ const doActs = async (report, actIndex, page) => {
1068
1068
  await doActs(report, actIndex + 1, page);
1069
1069
  }
1070
1070
  };
1071
- // Performs the commands in a script and returns a report.
1071
+ // Performs the commands in a script.
1072
1072
  const doScript = async (options, report) => {
1073
1073
  // Reinitialize the log statistics.
1074
1074
  logCount = logSize = prohibitedCount = visitTimeoutCount = visitRejectionCount= 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {