testaro 8.1.9 → 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/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
|
-
}
|