@jrpool/kilotest 45.0.3 → 45.0.6
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/api/listDiagnoses.js +6 -6
- package/api/listIssues.js +5 -5
- package/api/listViolators.js +5 -5
- package/api/requestRetest.js +3 -5
- package/api/testSuite.js +20 -7
- package/api/util.js +15 -18
- package/package.json +1 -1
- package/util.js +3 -3
package/api/listDiagnoses.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// IMPORTS
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
|
-
|
|
9
|
+
getIssueSpec,
|
|
10
10
|
getReportBasics,
|
|
11
11
|
getResponseMetadata,
|
|
12
12
|
getToolsFacts,
|
|
@@ -41,10 +41,10 @@ exports.response = async args => {
|
|
|
41
41
|
// Add them to the response content.
|
|
42
42
|
responseContent['basics about the report'] = reportBasics;
|
|
43
43
|
}
|
|
44
|
-
// Get the
|
|
45
|
-
const
|
|
44
|
+
// Get the specification of the issue.
|
|
45
|
+
const issueSpec = issueID ? getIssueSpec(issueID) : null;
|
|
46
46
|
// If the issue is ignorable or not fully classified:
|
|
47
|
-
if (!
|
|
47
|
+
if (!issueSpec) {
|
|
48
48
|
// Add this to the response content.
|
|
49
49
|
responseContent['basics about the issue'] = {
|
|
50
50
|
'error': 'No information about the specified issue is available'
|
|
@@ -55,7 +55,7 @@ exports.response = async args => {
|
|
|
55
55
|
}
|
|
56
56
|
// Otherwise, i.e. if it is non-ignorable and fully classified:
|
|
57
57
|
else {
|
|
58
|
-
const {summary, wcag, weight, why} =
|
|
58
|
+
const {summary, wcag, weight, why} = issueSpec;
|
|
59
59
|
// Initialize the basics about it.
|
|
60
60
|
const issueBasics = {
|
|
61
61
|
'identifier': issueID,
|
|
@@ -99,7 +99,7 @@ exports.response = async args => {
|
|
|
99
99
|
// Add them to the response content.
|
|
100
100
|
responseContent['details about the element'] = violatorDetails;
|
|
101
101
|
// If the issue is non-ignorable and fully classified:
|
|
102
|
-
if (
|
|
102
|
+
if (issueSpec) {
|
|
103
103
|
// Initialize data about the diagnoses of the violation of the issue.
|
|
104
104
|
const diagnoses = [];
|
|
105
105
|
// For each act in the report:
|
package/api/listIssues.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// IMPORTS
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
|
-
|
|
9
|
+
getIssueSpec,
|
|
10
10
|
getReportBasics,
|
|
11
11
|
getResponseMetadata,
|
|
12
12
|
getRuleEngineFacts,
|
|
@@ -76,11 +76,11 @@ exports.response = async args => {
|
|
|
76
76
|
// For each standard instance of the act:
|
|
77
77
|
instances.forEach(instance => {
|
|
78
78
|
const {catalogIndex, issueID} = instance;
|
|
79
|
-
// Get the
|
|
80
|
-
const
|
|
79
|
+
// Get the specification of its issue.
|
|
80
|
+
const issueSpec = issueID ? getIssueSpec(issueID) : null;
|
|
81
81
|
// If the instance has a non-ignorable and fully classified issue:
|
|
82
|
-
if (
|
|
83
|
-
const {summary, weight, why} =
|
|
82
|
+
if (issueSpec) {
|
|
83
|
+
const {summary, weight, why} = issueSpec;
|
|
84
84
|
// Ensure the rule-engine ID is in the reporters data.
|
|
85
85
|
reporterIDs.add(which);
|
|
86
86
|
// If the instance has a catalog index:
|
package/api/listViolators.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// IMPORTS
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
|
-
|
|
9
|
+
getIssueSpec,
|
|
10
10
|
getReportBasics,
|
|
11
11
|
getResponseMetadata,
|
|
12
12
|
getRuleEnginesFacts,
|
|
@@ -41,10 +41,10 @@ exports.response = async args => {
|
|
|
41
41
|
// Add them to the response content.
|
|
42
42
|
responseContent['basics about the report'] = reportBasics;
|
|
43
43
|
}
|
|
44
|
-
// Get the
|
|
45
|
-
const
|
|
44
|
+
// Get the specification of the issue.
|
|
45
|
+
const issueSpec = issueID ? getIssueSpec(issueID) : null;
|
|
46
46
|
// If the issue is ignorable or not fully classified:
|
|
47
|
-
if (!
|
|
47
|
+
if (!issueSpec) {
|
|
48
48
|
// Add this to the response content.
|
|
49
49
|
responseContent['basics about the issue'] = {
|
|
50
50
|
'error': 'No information about the specified issue is available'
|
|
@@ -52,7 +52,7 @@ exports.response = async args => {
|
|
|
52
52
|
}
|
|
53
53
|
// Otherwise, i.e. if it is non-ignorable and fully classified:
|
|
54
54
|
else {
|
|
55
|
-
const {summary, wcag, weight, why} =
|
|
55
|
+
const {summary, wcag, weight, why} = issueSpec;
|
|
56
56
|
// Initialize the basics and details about it.
|
|
57
57
|
const issueBasics = {
|
|
58
58
|
'identifier': issueID,
|
package/api/requestRetest.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// IMPORTS
|
|
7
7
|
|
|
8
8
|
const {getResponseMetadata, getToolsFacts, processTestRequest, thisHost} = require('./util');
|
|
9
|
-
const {getReportsExtract} = require('../util');
|
|
9
|
+
const {getLatestReportExtracts, getReportsExtract} = require('../util');
|
|
10
10
|
|
|
11
11
|
// FUNCTIONS
|
|
12
12
|
|
|
@@ -35,10 +35,8 @@ exports.response = async args => {
|
|
|
35
35
|
}
|
|
36
36
|
// Otherwise, if the report has been superseded:
|
|
37
37
|
else if (
|
|
38
|
-
|
|
39
|
-
.
|
|
40
|
-
.filter(extract => extract.what === what && extract.url === url)
|
|
41
|
-
.length > 1
|
|
38
|
+
(await getLatestReportExtracts())
|
|
39
|
+
.every(extract => extract.timeStamp !== timeStamp || extract.jobID !== jobID)
|
|
42
40
|
) {
|
|
43
41
|
// Add this to the response content.
|
|
44
42
|
responseContent['details about your request'] = {
|
package/api/testSuite.js
CHANGED
|
@@ -137,6 +137,8 @@ const requestService = async () => {
|
|
|
137
137
|
const reportsBasicsIndex = Math.floor(reportsBasics.length * Math.random());
|
|
138
138
|
// Choose one report at random.
|
|
139
139
|
reportBasics = reportsBasics[reportsBasicsIndex];
|
|
140
|
+
// Get whether the report has been superseded by a later report about the same page.
|
|
141
|
+
const isSuperseded = reportBasics['whether a later report about the same page exists'];
|
|
140
142
|
[timeStamp, jobID] = reportBasics.identifier?.split('-') || [null, null];
|
|
141
143
|
if (!(timeStamp && jobID)) {
|
|
142
144
|
console.log(`reportBasicsIndex: ${reportsBasicsIndex}`);
|
|
@@ -263,13 +265,24 @@ const requestService = async () => {
|
|
|
263
265
|
responseContent = body?.['response content'] ?? {};
|
|
264
266
|
requestDetails = responseContent['details about your request'] ?? {};
|
|
265
267
|
requestDisposition = responseContent['disposition of your request'] ?? {};
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
268
|
+
// If the report has been superseded:
|
|
269
|
+
if (isSuperseded) {
|
|
270
|
+
// Expect the request to be rejected.
|
|
271
|
+
if (!requestDetails.error?.includes('a later report about the page exists')) {
|
|
272
|
+
console.log(`requestDetails: ${JSON.stringify(requestDetails, null, 2)}`);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
// Otherwise, i.e. if the report has not been superseded:
|
|
277
|
+
else {
|
|
278
|
+
if (
|
|
279
|
+
!requestDetails['reason why the page should be retested']
|
|
280
|
+
|| !requestDisposition['how you can check for completion']
|
|
281
|
+
) {
|
|
282
|
+
console.log(`requestDetails: ${JSON.stringify(requestDetails, null, 2)}`);
|
|
283
|
+
console.log(`requestDisposition: ${JSON.stringify(requestDisposition, null, 2)}`);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
273
286
|
}
|
|
274
287
|
console.log('======================\nRequest: Make a feature request');
|
|
275
288
|
path = '/api/requestFeature';
|
package/api/util.js
CHANGED
|
@@ -14,11 +14,11 @@ const {
|
|
|
14
14
|
getRandomString,
|
|
15
15
|
getReportExtract,
|
|
16
16
|
getReportStats,
|
|
17
|
-
issuesClassification,
|
|
18
17
|
objectSort,
|
|
19
18
|
ruleEngines,
|
|
20
19
|
updateRecs
|
|
21
20
|
} = require('../util');
|
|
21
|
+
const {issues: issueSpecs} = require('testaro-issues');
|
|
22
22
|
|
|
23
23
|
// CONSTANTS
|
|
24
24
|
|
|
@@ -107,24 +107,21 @@ exports.getReportBasics = async (timeStamp, jobID) => {
|
|
|
107
107
|
return basics;
|
|
108
108
|
};
|
|
109
109
|
// Returns the classification of an issue.
|
|
110
|
-
exports.
|
|
111
|
-
// Get the issue
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
) {
|
|
124
|
-
// Return the classification.
|
|
125
|
-
return issueClassification;
|
|
110
|
+
exports.getIssueSpec = issueID => {
|
|
111
|
+
// Get the issue specification.
|
|
112
|
+
const issueSpec = issueSpecs[issueID];
|
|
113
|
+
// If it exists:
|
|
114
|
+
if (issueSpec) {
|
|
115
|
+
const {summary, wcag, weight, why} = issueSpec;
|
|
116
|
+
// If the issue is non-ignorable and fully classified:
|
|
117
|
+
if (issueID !== 'ignorable' && summary && wcag && [1, 2, 3, 4].includes(weight) && why) {
|
|
118
|
+
// Return its specification.
|
|
119
|
+
return issueSpec;
|
|
120
|
+
}
|
|
121
|
+
// Otherwise, return this.
|
|
122
|
+
return null;
|
|
126
123
|
}
|
|
127
|
-
// Otherwise, i.e. if it
|
|
124
|
+
// Otherwise, i.e. if it does not exist, return this.
|
|
128
125
|
return null;
|
|
129
126
|
};
|
|
130
127
|
// Processes a test or retest request.
|
package/package.json
CHANGED
package/util.js
CHANGED
|
@@ -560,9 +560,9 @@ exports.getReportData = async (timeStamp, jobID) => {
|
|
|
560
560
|
const instances = result?.standardResult?.instances ?? [];
|
|
561
561
|
// For each standard instance of the act:
|
|
562
562
|
instances.forEach(instance => {
|
|
563
|
-
const {catalogIndex, issueID} = instance;
|
|
564
|
-
// If it has a non-ignorable classified issue ID:
|
|
565
|
-
if (issueID && issueSpecs[issueID] && issueID !== 'ignorable') {
|
|
563
|
+
const {catalogIndex, issueID, outcome} = instance;
|
|
564
|
+
// If it reports a violation and has a non-ignorable classified issue ID:
|
|
565
|
+
if (outcome !== 'cantTell' && issueID && issueSpecs[issueID] && issueID !== 'ignorable') {
|
|
566
566
|
// Ensure that the rule engine is in the temporary data.
|
|
567
567
|
reporterIDSet.add(which);
|
|
568
568
|
// Ensure that the issue is in the temporary data.
|