@jrpool/kilotest 45.0.4 → 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.
@@ -6,7 +6,7 @@
6
6
  // IMPORTS
7
7
 
8
8
  const {
9
- getIssueClassification,
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 classification of the issue.
45
- const issueClassification = issueID ? getIssueClassification(issueID) : null;
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 (!issueClassification) {
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} = issueClassification;
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 (issueClassification) {
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
- getIssueClassification,
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 classification of its issue.
80
- const issueClassification = issueID ? getIssueClassification(issueID) : null;
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 (issueClassification) {
83
- const {summary, weight, why} = issueClassification;
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:
@@ -6,7 +6,7 @@
6
6
  // IMPORTS
7
7
 
8
8
  const {
9
- getIssueClassification,
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 classification of the issue.
45
- const issueClassification = issueID ? getIssueClassification(issueID) : null;
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 (!issueClassification) {
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} = issueClassification;
55
+ const {summary, wcag, weight, why} = issueSpec;
56
56
  // Initialize the basics and details about it.
57
57
  const issueBasics = {
58
58
  'identifier': issueID,
@@ -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
- Object
39
- .values(reportsExtract)
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
- if (
267
- !requestDetails['reason why the page should be retested']
268
- || !requestDisposition['how you can check for completion']
269
- ) {
270
- console.log(`requestDetails: ${JSON.stringify(requestDetails, null, 2)}`);
271
- console.log(`requestDisposition: ${JSON.stringify(requestDisposition, null, 2)}`);
272
- return;
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.getIssueClassification = issueID => {
111
- // Get the issue classification.
112
- const issueClassification = issuesClassification[issueID] ?? {};
113
- const {summary, wcag, weight, why} = issueClassification;
114
- // If the issue is non-ignorable and fully classified:
115
- if (
116
- issueID
117
- && issueID !== 'ignorable'
118
- && issueClassification
119
- && summary
120
- && wcag
121
- && [1, 2, 3, 4].includes(weight)
122
- && why
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 is ignorable or not fully classified, return this.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jrpool/kilotest",
3
- "version": "45.0.4",
3
+ "version": "45.0.6",
4
4
  "description": "Ensemble testing for front-end web quality",
5
5
  "main": "index.js",
6
6
  "engines": {
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.