testaro 8.1.8 → 8.1.10
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
CHANGED
|
@@ -119,7 +119,7 @@ Here is an example of a job:
|
|
|
119
119
|
|
|
120
120
|
```javascript
|
|
121
121
|
{
|
|
122
|
-
id: 'be76p-
|
|
122
|
+
id: 'be76p-ts25-w3c',
|
|
123
123
|
what: 'Test host with alfa',
|
|
124
124
|
strict: true,
|
|
125
125
|
timeLimit: 65,
|
|
@@ -161,7 +161,7 @@ This job contains three `commands`, telling Testaro to:
|
|
|
161
161
|
1. perform the tests in the `alfa` package on that URL
|
|
162
162
|
|
|
163
163
|
Job properties:
|
|
164
|
-
- `id`: This is a string consisting of alphanumeric ASCII characters and hyphen-minus (-), intended to be unique. When this job is saved as a JSON file, the file name is `be76p-sp25-w3c.json`. Typically, a job is created from a _script_, and the job ID adds a timestamp prefix and a host suffix to the script ID. Here the script ID would have been `
|
|
164
|
+
- `id`: This is a string consisting of alphanumeric ASCII characters and hyphen-minus (-), intended to be unique. When this job is saved as a JSON file, the file name is `be76p-sp25-w3c.json`. Typically, a job is created from a _script_, and the job ID adds a timestamp prefix and a host suffix to the script ID. Here the script ID would have been `ts25`.
|
|
165
165
|
- `what`: This is a description of the script.
|
|
166
166
|
- `strict`: This is `true` or `false`, indicating whether _substantive redirections_ should be treated as failures. These are redirections that do more than add or subtract a final slash. For example, if `strict` is true, a redirection from `xyz.com` to `www.xyz.com` or to `xyz.com/en` will abort the job.
|
|
167
167
|
- `timeLimit`: This optional property is the number of seconds allowed for the execution of the job. If omitted, Testaro sets a time limit of 300 seconds (5 minutes);
|
|
@@ -220,7 +220,7 @@ Here is an example of a newly initialized _report_.
|
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
This report is an object produced by Testaro when it is about to run a job. The `job` property has the job as its value. The report also has two additional properties:
|
|
223
|
-
- `acts`: This is an empty array. Testaro will copy the `job.commands` property into `acts` and then modify the array. Testaro can add more acts to the original ones. Testaro will also
|
|
223
|
+
- `acts`: This is an empty array. Testaro will copy the `job.commands` property into `acts` and then modify the array. Testaro can add more acts to the original ones. Testaro will also add results to the acts.
|
|
224
224
|
- `jobData`: Some results pertain to a job as a whole, not to any specific act. This property is an object where Testaro will record such job-level results.
|
|
225
225
|
|
|
226
226
|
### Commands
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "00000-ts18-example",
|
|
3
3
|
"what": "Alfa, Axe, Continuum, HTML CodeSniffer, IBM, Nu Html Checker, Tenon, WAVE, and 22 custom tests",
|
|
4
4
|
"strict": true,
|
|
5
5
|
"timeLimit": 500,
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"type": "url",
|
|
14
|
-
"which": "https://example.com
|
|
15
|
-
"what": "
|
|
14
|
+
"which": "https://example.com",
|
|
15
|
+
"what": "Example.com",
|
|
16
|
+
"id": "example"
|
|
16
17
|
},
|
|
17
18
|
{
|
|
18
19
|
"type": "tenonRequest",
|
|
@@ -35,8 +36,9 @@
|
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
38
|
"type": "url",
|
|
38
|
-
"which": "https://example.com
|
|
39
|
-
"what": "
|
|
39
|
+
"which": "https://example.com",
|
|
40
|
+
"what": "Example.com",
|
|
41
|
+
"id": "example"
|
|
40
42
|
},
|
|
41
43
|
{
|
|
42
44
|
"type": "test",
|
|
@@ -213,5 +215,17 @@
|
|
|
213
215
|
"id": "a",
|
|
214
216
|
"what": "Tenon API version 2 result retrieval"
|
|
215
217
|
}
|
|
216
|
-
]
|
|
218
|
+
],
|
|
219
|
+
"sources": {
|
|
220
|
+
"script": "ts18",
|
|
221
|
+
"batch": "",
|
|
222
|
+
"host": {
|
|
223
|
+
"id": "example",
|
|
224
|
+
"which": "https://example.com",
|
|
225
|
+
"what": "Example.com"
|
|
226
|
+
},
|
|
227
|
+
"requester": "user@domain.tld"
|
|
228
|
+
},
|
|
229
|
+
"jobCreationTime": "2022-11-12T22:51:45",
|
|
230
|
+
"timeStamp": "00000"
|
|
217
231
|
}
|
|
@@ -8,46 +8,42 @@ const fs = require('fs/promises');
|
|
|
8
8
|
// ########## CONSTANTS
|
|
9
9
|
|
|
10
10
|
const projectRoot = `${__dirname}/../..`;
|
|
11
|
+
process.env.JOBDIR = `${projectRoot}/validation/jobs`;
|
|
11
12
|
process.env.REPORTDIR = `${projectRoot}/temp`;
|
|
12
13
|
const reportDir = process.env.REPORTDIR;
|
|
14
|
+
const jobID = '00000-simple-example';
|
|
13
15
|
|
|
14
16
|
// ########## OPERATION
|
|
15
17
|
|
|
16
18
|
// Run the simple job and write a report.
|
|
17
19
|
const {runJob} = require(`${projectRoot}/high`);
|
|
18
|
-
runJob(
|
|
20
|
+
runJob(jobID)
|
|
19
21
|
.then(
|
|
20
22
|
// When the report has been written:
|
|
21
23
|
async () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const report = JSON.parse(reportJSON);
|
|
30
|
-
const {log, acts} = report;
|
|
31
|
-
if (log.length !== 2) {
|
|
32
|
-
console.log(
|
|
33
|
-
`Failure: log length is ${log.length} instead of 2 (see temp/${reportNames[0]}})`
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
else if (acts.length !== 3) {
|
|
37
|
-
console.log(
|
|
38
|
-
`Failure: acts length is ${acts.length} instead of 3 (see temp/${reportNames[0]}})`
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
console.log(`Success (report is in temp/${reportNames[0]})`);
|
|
43
|
-
}
|
|
24
|
+
try {
|
|
25
|
+
// Check it against expectations.
|
|
26
|
+
const reportJSON = await fs.readFile(`${reportDir}/${jobID}.json`);
|
|
27
|
+
const report = JSON.parse(reportJSON);
|
|
28
|
+
const {job, acts, jobData} = report;
|
|
29
|
+
if (! job) {
|
|
30
|
+
console.log('Failure: Report omits job');
|
|
44
31
|
}
|
|
45
|
-
|
|
46
|
-
console.log(
|
|
32
|
+
else if (acts.length !== 3) {
|
|
33
|
+
console.log('Failure: Counts of acts is not 3');
|
|
34
|
+
}
|
|
35
|
+
else if (! jobData) {
|
|
36
|
+
console.log('Failure: Report omits jobData');
|
|
37
|
+
}
|
|
38
|
+
else if (jobData.endTime < jobData.startTime) {
|
|
39
|
+
console.log('Failure: End time precedes start time');
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
console.log(`Success (report is in temp/${jobID}.json)`);
|
|
47
43
|
}
|
|
48
44
|
}
|
|
49
|
-
|
|
50
|
-
console.log(
|
|
45
|
+
catch(error) {
|
|
46
|
+
console.log(`ERROR: ${error.message}`);
|
|
51
47
|
}
|
|
52
48
|
},
|
|
53
49
|
error => {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "00000-simple-example",
|
|
3
|
+
"what": "Test example.com with bulk",
|
|
4
|
+
"strict": true,
|
|
5
|
+
"timeLimit": 10,
|
|
6
|
+
"commands": [
|
|
7
|
+
{
|
|
8
|
+
"type": "launch",
|
|
9
|
+
"which": "chromium",
|
|
10
|
+
"what": "Chromium browser"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"type": "url",
|
|
14
|
+
"which": "https://example.com/",
|
|
15
|
+
"what": "Example.com",
|
|
16
|
+
"id": "example"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "test",
|
|
20
|
+
"which": "bulk",
|
|
21
|
+
"what": "count of visible elements"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"sources": {
|
|
25
|
+
"script": "simple",
|
|
26
|
+
"batch": "",
|
|
27
|
+
"host": {
|
|
28
|
+
"id": "example",
|
|
29
|
+
"which": "https://example.com",
|
|
30
|
+
"what": "Example.com"
|
|
31
|
+
},
|
|
32
|
+
"requester": "user@domain.tld"
|
|
33
|
+
},
|
|
34
|
+
"jobCreationTime": "2022-11-12T22:51:45",
|
|
35
|
+
"timeStamp": "00000"
|
|
36
|
+
}
|
package/samples/simple.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "simple",
|
|
3
|
-
"what": "Test example.com with bulk",
|
|
4
|
-
"strict": true,
|
|
5
|
-
"timeLimit": 10,
|
|
6
|
-
"commands": [
|
|
7
|
-
{
|
|
8
|
-
"type": "launch",
|
|
9
|
-
"which": "chromium",
|
|
10
|
-
"what": "Chromium browser"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "url",
|
|
14
|
-
"which": "https://example.com/",
|
|
15
|
-
"what": "page with a few accessibility defects"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"type": "test",
|
|
19
|
-
"which": "bulk",
|
|
20
|
-
"what": "bulk"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|