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.
- package/README.md +12 -17
- package/index.js +1 -1
- 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
|
|
420
|
+
To run Testaro, create an options object like this:
|
|
427
421
|
|
|
428
422
|
```javascript
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
script:
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
handleRequest(options);
|
|
423
|
+
{
|
|
424
|
+
log: [],
|
|
425
|
+
reports: [],
|
|
426
|
+
script: {abc},
|
|
427
|
+
batch: {def}
|
|
428
|
+
}
|
|
436
429
|
```
|
|
437
430
|
|
|
438
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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;
|