testaro 37.0.0 → 37.2.0
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 +3 -3
- package/validation/executors/{watchDir.js → dirWatch.js} +6 -6
- package/validation/executors/{watchNet.js → netWatch.js} +14 -14
- package/validation/executors/run.js +4 -4
- package/validation/executors/tests.js +6 -5
- package/validation/jobs/todo/240101T1200-simple-example.json +31 -0
- package/validation/watch/done/240101T1200-simple-example.json +30 -0
- package/validation/jobs/todo/00000-simple-example.json +0 -39
- package/validation/watch/done/00000-simple-example.json +0 -39
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testaro",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.2.0",
|
|
4
4
|
"description": "Run 1000 web accessibility tests from 10 tools and get a standardized report",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"tests": "node validation/executors/tests",
|
|
8
8
|
"test": "node validation/executors/test",
|
|
9
9
|
"run": "node validation/executors/run",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"dirWatch": "node validation/executors/dirWatch",
|
|
11
|
+
"netWatch": "node validation/executors/netWatch"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
© 2022–
|
|
2
|
+
© 2022–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
/*
|
|
24
|
-
|
|
24
|
+
dirWatch.js
|
|
25
25
|
Validator for directory watching.
|
|
26
26
|
*/
|
|
27
27
|
|
|
@@ -31,14 +31,14 @@ const fs = require('fs/promises');
|
|
|
31
31
|
|
|
32
32
|
// CONSTANTS
|
|
33
33
|
|
|
34
|
-
// Override
|
|
34
|
+
// Override dirWatch environment variables with validation-specific ones.
|
|
35
35
|
process.env.JOBDIR = `${__dirname}/../watch`;
|
|
36
36
|
process.env.REPORTDIR = `${__dirname}/../../temp`;
|
|
37
|
-
const jobID = '
|
|
38
|
-
const {
|
|
37
|
+
const jobID = '240101T1200-simple-example';
|
|
38
|
+
const {dirWatch} = require('../../dirWatch');
|
|
39
39
|
|
|
40
40
|
// Start checking for jobs every 5 seconds.
|
|
41
|
-
|
|
41
|
+
dirWatch(false, 5)
|
|
42
42
|
.then(() => {
|
|
43
43
|
console.log('Success: Watch validation ended');
|
|
44
44
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
© 2022–
|
|
2
|
+
© 2022–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -31,13 +31,13 @@ const fs = require('fs/promises');
|
|
|
31
31
|
|
|
32
32
|
// CONSTANTS
|
|
33
33
|
|
|
34
|
-
// Override
|
|
34
|
+
// Override netWatch environment variables with validation-specific ones.
|
|
35
35
|
const jobDir = `${__dirname}/../jobs/todo`;
|
|
36
|
-
process.env.
|
|
36
|
+
process.env.JOB_URLS = 'http://localhost:3007/api/job';
|
|
37
37
|
process.env.AGENT = 'testarauth';
|
|
38
|
-
const {
|
|
38
|
+
const {netWatch} = require('../../netWatch');
|
|
39
39
|
const client = require('http');
|
|
40
|
-
const jobID = '
|
|
40
|
+
const jobID = '240101T1200-simple-example';
|
|
41
41
|
|
|
42
42
|
// OPERATION
|
|
43
43
|
|
|
@@ -47,7 +47,7 @@ const startTime = Date.now();
|
|
|
47
47
|
let jobGiven = false;
|
|
48
48
|
// Start checking for jobs every 5 seconds in 5 seconds.
|
|
49
49
|
setTimeout(() => {
|
|
50
|
-
|
|
50
|
+
netWatch(false, 5, false);
|
|
51
51
|
}, 5000);
|
|
52
52
|
let server;
|
|
53
53
|
// Handles Testaro requests to the server.
|
|
@@ -104,27 +104,27 @@ const requestHandler = (request, response) => {
|
|
|
104
104
|
const body = JSON.parse(bodyJSON);
|
|
105
105
|
if (
|
|
106
106
|
body.acts
|
|
107
|
-
&& body.
|
|
108
|
-
&& body.
|
|
109
|
-
&& body.
|
|
107
|
+
&& body.sources
|
|
108
|
+
&& body.sources.agent
|
|
109
|
+
&& body.sources.agent === process.env.AGENT
|
|
110
110
|
) {
|
|
111
|
-
ack.
|
|
111
|
+
ack.message = 'Success: Valid report submitted';
|
|
112
112
|
}
|
|
113
113
|
else {
|
|
114
|
-
ack.
|
|
114
|
+
ack.message = 'Failure: Report invalid';
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
catch(error) {
|
|
118
|
-
ack.
|
|
118
|
+
ack.message = `ERROR: ${error.message}`;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
|
-
ack.
|
|
123
|
+
ack.message = 'ERROR: Report submission invalid';
|
|
124
124
|
}
|
|
125
125
|
const ackJSON = JSON.stringify(ack);
|
|
126
126
|
response.end(ackJSON);
|
|
127
|
-
console.log(`Server responded: ${ack.
|
|
127
|
+
console.log(`Server responded: ${ack.message}`);
|
|
128
128
|
// This ends the validation, so stop the server.
|
|
129
129
|
server.close();
|
|
130
130
|
console.log('Server closed');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
© 2022–
|
|
2
|
+
© 2022–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -32,7 +32,7 @@ const fs = require('fs/promises');
|
|
|
32
32
|
// ########## CONSTANTS
|
|
33
33
|
|
|
34
34
|
const {doJob} = require('../../run');
|
|
35
|
-
const jobID = '
|
|
35
|
+
const jobID = '240101T1200-simple-example';
|
|
36
36
|
|
|
37
37
|
// ########## OPERATION
|
|
38
38
|
|
|
@@ -45,8 +45,8 @@ fs.readFile(`${__dirname}/../jobs/todo/${jobID}.json`, 'utf8')
|
|
|
45
45
|
try {
|
|
46
46
|
// Check the report against expectations.
|
|
47
47
|
const {acts, jobData} = report;
|
|
48
|
-
if (acts.length !==
|
|
49
|
-
console.log('Failure: Count of acts is not
|
|
48
|
+
if (acts.length !== 2) {
|
|
49
|
+
console.log('Failure: Count of acts is not 2');
|
|
50
50
|
}
|
|
51
51
|
else if (! jobData) {
|
|
52
52
|
console.log('Failure: Report omits jobData');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
© 2022–
|
|
2
|
+
© 2022–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -32,15 +32,16 @@ const {validateTest} = require('../validateTest');
|
|
|
32
32
|
|
|
33
33
|
// OPERATION
|
|
34
34
|
|
|
35
|
-
// Get the names of the Testaro
|
|
36
|
-
fs.readdir(`${__dirname}
|
|
35
|
+
// Get the names of the Testaro tes files.
|
|
36
|
+
fs.readdir(`${__dirname}/../../testaro/`)
|
|
37
37
|
// When they arrive:
|
|
38
38
|
.then(async fileNames => {
|
|
39
39
|
// For each file name:
|
|
40
40
|
for (const fileName of fileNames) {
|
|
41
|
-
// Get the test ID from it by disregarding its
|
|
42
|
-
const testID = fileName.
|
|
41
|
+
// Get the test ID from it by disregarding its extension.
|
|
42
|
+
const testID = fileName.replace(/\..+$/, '');
|
|
43
43
|
// Validate the test.
|
|
44
|
+
console.log(`### Validating Testaro test ${testID}`);
|
|
44
45
|
await validateTest(testID);
|
|
45
46
|
}
|
|
46
47
|
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "240101T1200-simple-example",
|
|
3
|
+
"what": "Test example.edu with bulk",
|
|
4
|
+
"strict": true,
|
|
5
|
+
"timeLimit": 10,
|
|
6
|
+
"acts": [
|
|
7
|
+
{
|
|
8
|
+
"type": "launch",
|
|
9
|
+
"which": "chromium",
|
|
10
|
+
"url": "https://example.edu/",
|
|
11
|
+
"what": "Chromium browser"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "test",
|
|
15
|
+
"which": "testaro",
|
|
16
|
+
"withItems": false,
|
|
17
|
+
"stopOnFail": true,
|
|
18
|
+
"rules": [
|
|
19
|
+
"y",
|
|
20
|
+
"bulk"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"sources": {
|
|
25
|
+
},
|
|
26
|
+
"standard": "only",
|
|
27
|
+
"observe": false,
|
|
28
|
+
"sendReportTo": "http://localhost:3007/api",
|
|
29
|
+
"timeStamp": "240101T1500",
|
|
30
|
+
"creationTimeStamp": "240101T1200"
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "240101T1200-simple-example",
|
|
3
|
+
"what": "Test example.edu with bulk",
|
|
4
|
+
"strict": true,
|
|
5
|
+
"timeLimit": 10,
|
|
6
|
+
"acts": [
|
|
7
|
+
{
|
|
8
|
+
"type": "launch",
|
|
9
|
+
"which": "chromium",
|
|
10
|
+
"url": "https://example.edu/",
|
|
11
|
+
"what": "Chromium browser"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "test",
|
|
15
|
+
"which": "testaro",
|
|
16
|
+
"withItems": false,
|
|
17
|
+
"stopOnFail": true,
|
|
18
|
+
"rules": [
|
|
19
|
+
"y",
|
|
20
|
+
"bulk"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"sources": {},
|
|
25
|
+
"standard": "only",
|
|
26
|
+
"observe": false,
|
|
27
|
+
"timeStamp": "240101T1500",
|
|
28
|
+
"creationTimeStamp": "240101T1200",
|
|
29
|
+
"sendReportTo": ""
|
|
30
|
+
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "00000-simple-example",
|
|
3
|
-
"what": "Test example.edu with bulk",
|
|
4
|
-
"strict": true,
|
|
5
|
-
"timeLimit": 10,
|
|
6
|
-
"acts": [
|
|
7
|
-
{
|
|
8
|
-
"type": "launch",
|
|
9
|
-
"which": "chromium",
|
|
10
|
-
"what": "Chromium browser"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "url",
|
|
14
|
-
"which": "https://example.edu/",
|
|
15
|
-
"what": "Example.com",
|
|
16
|
-
"id": "example"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"type": "test",
|
|
20
|
-
"which": "testaro",
|
|
21
|
-
"rules": [
|
|
22
|
-
"y",
|
|
23
|
-
"bulk"
|
|
24
|
-
],
|
|
25
|
-
"withItems": false
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"sources": {
|
|
29
|
-
"script": "simple",
|
|
30
|
-
"batch": "",
|
|
31
|
-
"target": {
|
|
32
|
-
"id": "example",
|
|
33
|
-
"what": "Example"
|
|
34
|
-
},
|
|
35
|
-
"requester": "user@domain.tld"
|
|
36
|
-
},
|
|
37
|
-
"creationTime": "2022-11-12T22:51:45",
|
|
38
|
-
"timeStamp": "00000"
|
|
39
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "00000-simple-example",
|
|
3
|
-
"what": "Test example.edu with bulk",
|
|
4
|
-
"strict": true,
|
|
5
|
-
"timeLimit": 10,
|
|
6
|
-
"acts": [
|
|
7
|
-
{
|
|
8
|
-
"type": "launch",
|
|
9
|
-
"which": "chromium",
|
|
10
|
-
"what": "Chromium browser"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "url",
|
|
14
|
-
"which": "https://example.edu/",
|
|
15
|
-
"what": "Example.com",
|
|
16
|
-
"id": "example"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"type": "test",
|
|
20
|
-
"which": "testaro",
|
|
21
|
-
"rules": [
|
|
22
|
-
"y",
|
|
23
|
-
"bulk"
|
|
24
|
-
],
|
|
25
|
-
"withItems": false
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"sources": {
|
|
29
|
-
"script": "simple",
|
|
30
|
-
"batch": "",
|
|
31
|
-
"target": {
|
|
32
|
-
"id": "example",
|
|
33
|
-
"what": "Example"
|
|
34
|
-
},
|
|
35
|
-
"requester": "user@domain.tld"
|
|
36
|
-
},
|
|
37
|
-
"creationTime": "2022-11-12T22:51:45",
|
|
38
|
-
"timeStamp": "00000"
|
|
39
|
-
}
|