testilo 21.4.2 → 21.5.1
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 +6 -3
- package/merge.js +9 -6
- package/package.json +1 -1
- package/procs/digest/{tdp38 → tdp39}/index.html +1 -1
- package/procs/digest/{tdp38 → tdp39}/index.js +4 -3
- package/procs/score/{tic38.js → tic39.js} +25 -20
- package/procs/score/{tsp38.js → tsp39.js} +2 -2
- package/scripts/{ts37.json → ts39.json} +1 -1
- package/procs/score/tsp38-old.js +0 -300
- package/scripts/ts31.json +0 -56
- package/scripts/ts33.json +0 -56
- package/scripts/ts34.json +0 -77
- package/scripts/ts36.json +0 -56
package/README.md
CHANGED
|
@@ -169,13 +169,16 @@ Here is a script:
|
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
A script has several properties that specify facts about the jobs to be created. They include:
|
|
172
|
+
- `id`: an ID that uniquely distinguishes the script from other scripts.
|
|
173
|
+
- `what`: a description of the script.
|
|
174
|
+
- `strict`: You decide whether Testaro is to throw an error on an attempt to navigate to a URL if the server redirects the request to a URL differing substantially from the specified URL. All differences are considered substantial unless the URLs differ only in the presence and absence of a trailing slash.
|
|
172
175
|
- `isolate`: You decide whether to isolate test acts, as needed, from effects of previous test acts. If `true`, the `merge` module will add a copy of the latest placeholder after each target-modifying test act before the immediately following test act.
|
|
173
|
-
- `
|
|
174
|
-
- `observe`: You decide how granularly Testaro will allow a server to observe job progress. If `true`, Testaro sends a message to the server to announce each test act (identifying the tool), and the `testaro` tool sends a message to the server to announce each rule when its test is performed. The server can further update the requesting client on the basis of these messages.
|
|
176
|
+
- `standard`: You choose how the reports of test acts should be standardized. The alternatives are `'no'` (do not standardize), `'also'` (standardize and report both the original and the standardized results), and `'only'` (standardize and report only the standardized results).
|
|
177
|
+
- `observe`: You decide how granularly Testaro will allow a server to observe job progress. If `true`, Testaro sends a message to the server to announce each test act (identifying the tool), and the `testaro` tool sends a message to the server to announce each rule when its test is performed. The server can further update the requesting client on the basis of these messages. It is generally user-friendly to make `observe` `true` if the user application makes the user wait while the job is assigned and performed. If the application allows the user to leave and sends the user a message when the job has been completed, `observe` can be set to `false`.
|
|
175
178
|
- `timeStamp`: You can specify the date and time that the job is to wait for before it is performed. This specification is a string with the format `yymmddThhMM`.
|
|
176
179
|
- `acts`: an array of acts.
|
|
177
180
|
|
|
178
|
-
The first act in this script is a placeholder, whose `which` property is `'private'`. If the above batch were merged with this script, in each job the placeholder would be replaced with the `private` acts of a target. For example, the first act of the first job would launch a Chromium browser, navigate to the Acme login page, complete and submit the login form, wait for the account page to load, run the Axe tests, and then run the QualWeb tests. If the batch contained additional targets, additional jobs would be created, with the login actions for each target specified in the `private` array of the `acts` object of that target.
|
|
181
|
+
The first act in this example script is a placeholder, whose `which` property is `'private'`. If the above batch were merged with this script, in each job the placeholder would be replaced with the `private` acts of a target. For example, the first act of the first job would launch a Chromium browser, navigate to the Acme login page, complete and submit the login form, wait for the account page to load, run the Axe tests, and then run the QualWeb tests. If the batch contained additional targets, additional jobs would be created, with the login actions for each target specified in the `private` array of the `acts` object of that target.
|
|
179
182
|
|
|
180
183
|
As shown in this example, when a browser is launched by placeholder substitution, the script can determine the browser type (`chromium`, `firefox`, or `webkit`) by assigning a value to a `launch` property of the placeholder.
|
|
181
184
|
|
package/merge.js
CHANGED
|
@@ -18,7 +18,10 @@ require('dotenv').config();
|
|
|
18
18
|
|
|
19
19
|
// ########## CONSTANTS
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
// Standard requester.
|
|
22
|
+
const stdRequester = process.env.REQUESTER || 'nobody@nodomain.tld';
|
|
23
|
+
// Length of the random part of a job ID, as a string.
|
|
24
|
+
const randomIDLength = process.env.RANDOM_ID_LENGTH || '3';
|
|
22
25
|
// Tools that alter the page.
|
|
23
26
|
const contaminantNames = new Set([
|
|
24
27
|
'alfa',
|
|
@@ -33,7 +36,7 @@ const randomIDChars = (() => {
|
|
|
33
36
|
const lowers = Array(26).fill('').map((letter, index) => String.fromCodePoint(97 + index));
|
|
34
37
|
return digits.concat(uppers, lowers);
|
|
35
38
|
})();
|
|
36
|
-
|
|
39
|
+
|
|
37
40
|
|
|
38
41
|
// ########## FUNCTIONS
|
|
39
42
|
|
|
@@ -68,7 +71,7 @@ const getRandomID = length => {
|
|
|
68
71
|
return chars.join('');
|
|
69
72
|
};
|
|
70
73
|
// Merges a script and a batch and returns jobs.
|
|
71
|
-
exports.merge = (script, batch, requester, isolate, standard,
|
|
74
|
+
exports.merge = (script, batch, requester, isolate, standard, observe, timeStamp) => {
|
|
72
75
|
if (isolate === 'false') {
|
|
73
76
|
isolate = false;
|
|
74
77
|
}
|
|
@@ -89,11 +92,11 @@ exports.merge = (script, batch, requester, isolate, standard, isGranular, timeSt
|
|
|
89
92
|
// If the requester is blank or unspecified, make it the standard requester.
|
|
90
93
|
requester ||= stdRequester;
|
|
91
94
|
// Create a creation-time description.
|
|
92
|
-
const creationTime = (new Date()).toISOString().slice(0,
|
|
95
|
+
const creationTime = (new Date()).toISOString().slice(0, 16);
|
|
93
96
|
// Initialize a target-independent job.
|
|
94
97
|
const protoJob = JSON.parse(JSON.stringify(script));
|
|
95
98
|
// Make the timestamp and a random string the ID of the job.
|
|
96
|
-
protoJob.id = `${timeStamp}-${getRandomID(Number.parseInt(
|
|
99
|
+
protoJob.id = `${timeStamp}-${getRandomID(Number.parseInt(randomIDLength, 10))}`;
|
|
97
100
|
// Add a sources property to the job.
|
|
98
101
|
protoJob.sources = {
|
|
99
102
|
script: script.id,
|
|
@@ -110,7 +113,7 @@ exports.merge = (script, batch, requester, isolate, standard, isGranular, timeSt
|
|
|
110
113
|
protoJob.creationTime = creationTime;
|
|
111
114
|
protoJob.timeStamp = timeStamp;
|
|
112
115
|
protoJob.standard = standard || 'only';
|
|
113
|
-
protoJob.observe =
|
|
116
|
+
protoJob.observe = observe || false;
|
|
114
117
|
// If isolation was requested:
|
|
115
118
|
if (isolate) {
|
|
116
119
|
// Configure the job for it.
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<h2>Introduction</h2>
|
|
35
35
|
<p>How <a href="https://www.w3.org/WAI/">accessible</a> is the __org__ web page at <a href="__url__"><code>__url__</code></a>?</p>
|
|
36
36
|
<p>This digest can help answer that question. Nine different tools (Alfa, ASLint, Axe, Equal Access, HTML CodeSniffer, Nu Html Checker, QualWeb, Testaro, and WAVE) tested the page to check its compliance with their accessibility rules. In all, the tools define about 915 rules, which are classified here into about 300 accessibility issues.</p>
|
|
37
|
-
<p>The results were interpreted to yield a score, with 0 being ideal. The score for this page was __total__, the sum of __issueCount__ for the count of issues, __issue__ for specific issues, __tool__ for tool-by-tool ratings, __prevention__ for the page preventing tools from running, __log__ for browser warnings, and __latency__ for delayed page responses.</p>
|
|
37
|
+
<p>The results were interpreted to yield a score, with 0 being ideal. The score for this page was __total__, the sum of __issueCount__ for the count of issues, __issue__ for specific issues, __solo__ for unclassified rule violations, __tool__ for tool-by-tool ratings, __prevention__ for the page preventing tools from running, __log__ for browser warnings, and __latency__ for delayed page responses.</p>
|
|
38
38
|
<h2>Issue summary</h2>
|
|
39
39
|
<table class="allBorder thirdCellRight">
|
|
40
40
|
<caption>Summary of issues</caption>
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
// IMPORTS
|
|
4
4
|
|
|
5
5
|
// Module to classify tool rules into issues
|
|
6
|
-
const {issues} = require('../../score/
|
|
6
|
+
const {issues} = require('../../score/tic39');
|
|
7
7
|
// Module to process files.
|
|
8
8
|
const fs = require('fs/promises');
|
|
9
9
|
|
|
10
10
|
// CONSTANTS
|
|
11
11
|
|
|
12
12
|
// Digester ID.
|
|
13
|
-
const id = '
|
|
13
|
+
const id = 'tdp39';
|
|
14
14
|
// Newline with indentations.
|
|
15
15
|
const innerJoiner = '\n ';
|
|
16
16
|
|
|
@@ -43,7 +43,8 @@ const populateQuery = (report, query) => {
|
|
|
43
43
|
summaryRows: [],
|
|
44
44
|
issueRows: []
|
|
45
45
|
};
|
|
46
|
-
['total', 'issueCount', 'issue', 'tool', 'prevention', 'log', 'latency']
|
|
46
|
+
['total', 'issueCount', 'issue', 'solo', 'tool', 'prevention', 'log', 'latency']
|
|
47
|
+
.forEach(sumItem => {
|
|
47
48
|
query[sumItem] = summary[sumItem];
|
|
48
49
|
rows.summaryRows.push(getScoreRow(sumItem, query[sumItem]));
|
|
49
50
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
|
|
3
|
-
Testilo issue classification
|
|
2
|
+
tic39
|
|
3
|
+
Testilo issue classification 39
|
|
4
4
|
|
|
5
5
|
Classifies about 900 rules of the tools of Testaro into about 300 issues.
|
|
6
6
|
|
|
@@ -4363,28 +4363,12 @@ exports.issues = {
|
|
|
4363
4363
|
}
|
|
4364
4364
|
}
|
|
4365
4365
|
},
|
|
4366
|
-
|
|
4367
|
-
summary: '
|
|
4366
|
+
h1Not1: {
|
|
4367
|
+
summary: 'not exactly 1 h1 heading',
|
|
4368
4368
|
why: 'User cannot understand the topic of the document',
|
|
4369
4369
|
wcag: '1.3.1',
|
|
4370
4370
|
weight: 2,
|
|
4371
4371
|
max: 1,
|
|
4372
|
-
tools: {
|
|
4373
|
-
nuVal: {
|
|
4374
|
-
'Consider using the h1 element as a top-level heading only (all h1 elements are treated as top-level headings by many screen readers and other tools).': {
|
|
4375
|
-
variable: false,
|
|
4376
|
-
quality: 1,
|
|
4377
|
-
what: 'Page contains more than 1 h1 element'
|
|
4378
|
-
}
|
|
4379
|
-
}
|
|
4380
|
-
}
|
|
4381
|
-
},
|
|
4382
|
-
h1Missing: {
|
|
4383
|
-
summary: 'h1 missing',
|
|
4384
|
-
why: 'User cannot understand the topic of the document',
|
|
4385
|
-
wcag: '1.3.1',
|
|
4386
|
-
weight: 3,
|
|
4387
|
-
max: 1,
|
|
4388
4372
|
tools: {
|
|
4389
4373
|
aslint: {
|
|
4390
4374
|
'h1_must_be': {
|
|
@@ -4400,6 +4384,20 @@ exports.issues = {
|
|
|
4400
4384
|
what: 'Document contains no level-one heading'
|
|
4401
4385
|
}
|
|
4402
4386
|
},
|
|
4387
|
+
nuVal: {
|
|
4388
|
+
'Consider using the h1 element as a top-level heading only (all h1 elements are treated as top-level headings by many screen readers and other tools).': {
|
|
4389
|
+
variable: false,
|
|
4390
|
+
quality: 1,
|
|
4391
|
+
what: 'Page contains more than 1 h1 element'
|
|
4392
|
+
}
|
|
4393
|
+
},
|
|
4394
|
+
qualWeb: {
|
|
4395
|
+
'QW-BP28': {
|
|
4396
|
+
variable: false,
|
|
4397
|
+
quality: 1,
|
|
4398
|
+
what: 'h1 element missing or used more than once'
|
|
4399
|
+
}
|
|
4400
|
+
},
|
|
4403
4401
|
wave: {
|
|
4404
4402
|
'h1_missing': {
|
|
4405
4403
|
variable: false,
|
|
@@ -4696,6 +4694,13 @@ exports.issues = {
|
|
|
4696
4694
|
quality: 1,
|
|
4697
4695
|
what: 'Element is not contained by a ul or ol element'
|
|
4698
4696
|
}
|
|
4697
|
+
},
|
|
4698
|
+
qualWeb: {
|
|
4699
|
+
'QW-BP23': {
|
|
4700
|
+
variable: false,
|
|
4701
|
+
quality: 0.1,
|
|
4702
|
+
what: 'Element is not in a true list'
|
|
4703
|
+
}
|
|
4699
4704
|
}
|
|
4700
4705
|
}
|
|
4701
4706
|
},
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
// IMPORTS
|
|
9
9
|
|
|
10
|
-
const {issues} = require('./
|
|
10
|
+
const {issues} = require('./tic39');
|
|
11
11
|
|
|
12
12
|
// CONSTANTS
|
|
13
13
|
|
|
14
14
|
// ID of this proc.
|
|
15
|
-
const scoreProcID = '
|
|
15
|
+
const scoreProcID = 'tsp39';
|
|
16
16
|
// Latency weight (how much each second of excess latency adds to the score).
|
|
17
17
|
const latencyWeight = 1;
|
|
18
18
|
// Normal latency (6 visits, with 1.5 second per visit).
|
package/procs/score/tsp38-old.js
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
tsp37
|
|
3
|
-
Testilo score proc 37
|
|
4
|
-
|
|
5
|
-
Computes target score data and adds them to a ts37 report.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// IMPORTS
|
|
9
|
-
|
|
10
|
-
const {issues} = require('./tic38');
|
|
11
|
-
|
|
12
|
-
// CONSTANTS
|
|
13
|
-
|
|
14
|
-
// ID of this proc.
|
|
15
|
-
const scoreProcID = 'tsp38';
|
|
16
|
-
// Latency weight (how much each second of excess latency adds to the score).
|
|
17
|
-
const latencyWeight = 1;
|
|
18
|
-
// Normal latency (6 visits, with 1.5 second per visit).
|
|
19
|
-
const normalLatency = 9;
|
|
20
|
-
// Prevention weight (how much each prevention adds to the score).
|
|
21
|
-
const preventionWeight = 300;
|
|
22
|
-
// Maximum instance count addition weight (divisor of max).
|
|
23
|
-
const maxWeight = 30;
|
|
24
|
-
// Other weights.
|
|
25
|
-
const severityWeights = [1, 2, 3, 4];
|
|
26
|
-
const toolWeight = 0.1;
|
|
27
|
-
const logWeights = {
|
|
28
|
-
logCount: 0.1,
|
|
29
|
-
logSize: 0.002,
|
|
30
|
-
errorLogCount: 0.2,
|
|
31
|
-
errorLogSize: 0.004,
|
|
32
|
-
prohibitedCount: 3,
|
|
33
|
-
visitRejectionCount: 2
|
|
34
|
-
};
|
|
35
|
-
// Initialize a table of tool rules.
|
|
36
|
-
const issueIndex = {};
|
|
37
|
-
// Initialize an array of variably named tool rules.
|
|
38
|
-
const issueMatcher = [];
|
|
39
|
-
// For each issue:
|
|
40
|
-
Object.keys(issues).forEach(issueName => {
|
|
41
|
-
// For each tool with rules belonging to that issue:
|
|
42
|
-
Object.keys(issues[issueName].tools).forEach(toolName => {
|
|
43
|
-
// For each of those rules:
|
|
44
|
-
Object.keys(issues[issueName].tools[toolName]).forEach(ruleID => {
|
|
45
|
-
// Add it to the table of tool rules.
|
|
46
|
-
if (! issueIndex[toolName]) {
|
|
47
|
-
issueIndex[toolName] = {};
|
|
48
|
-
}
|
|
49
|
-
issueIndex[toolName][ruleID] = issueName;
|
|
50
|
-
// If it is variably named:
|
|
51
|
-
if (issues[issueName].tools[toolName][ruleID].variable) {
|
|
52
|
-
// Add it to the array of variably named tool rules.
|
|
53
|
-
issueMatcher.push(ruleID);
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// FUNCTIONS
|
|
60
|
-
|
|
61
|
-
// Scores a report.
|
|
62
|
-
exports.scorer = report => {
|
|
63
|
-
// If there are any acts in the report:
|
|
64
|
-
const {acts} = report;
|
|
65
|
-
if (Array.isArray(acts) && acts.length) {
|
|
66
|
-
// If any of them are test acts:
|
|
67
|
-
const testActs = acts.filter(act => act.type === 'test');
|
|
68
|
-
if (testActs.length) {
|
|
69
|
-
// Initialize the score data.
|
|
70
|
-
const score = {
|
|
71
|
-
scoreProcID,
|
|
72
|
-
weights: {
|
|
73
|
-
severities: severityWeights,
|
|
74
|
-
tool: toolWeight,
|
|
75
|
-
log: logWeights,
|
|
76
|
-
latency: latencyWeight,
|
|
77
|
-
prevention: preventionWeight,
|
|
78
|
-
maxInstanceCount: maxWeight
|
|
79
|
-
},
|
|
80
|
-
normalLatency,
|
|
81
|
-
summary: {
|
|
82
|
-
total: 0,
|
|
83
|
-
issue: 0,
|
|
84
|
-
solo: 0,
|
|
85
|
-
tool: 0,
|
|
86
|
-
prevention: 0,
|
|
87
|
-
log: 0,
|
|
88
|
-
latency: 0
|
|
89
|
-
},
|
|
90
|
-
details: {
|
|
91
|
-
severity: {
|
|
92
|
-
total: [0, 0, 0, 0],
|
|
93
|
-
byTool: {}
|
|
94
|
-
},
|
|
95
|
-
prevention: {},
|
|
96
|
-
issue: {},
|
|
97
|
-
solo: {},
|
|
98
|
-
tool: {}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
const {summary, details} = score;
|
|
102
|
-
// For each test act:
|
|
103
|
-
testActs.forEach(act => {
|
|
104
|
-
// If the page prevented the tool from operating:
|
|
105
|
-
const {which, standardResult} = act;
|
|
106
|
-
if (! standardResult || standardResult.prevented) {
|
|
107
|
-
// Add this to the score.
|
|
108
|
-
details.prevention[which] = preventionWeight;
|
|
109
|
-
}
|
|
110
|
-
// Otherwise, if a valid standard result exists:
|
|
111
|
-
else if (
|
|
112
|
-
standardResult
|
|
113
|
-
&& standardResult.totals
|
|
114
|
-
&& standardResult.totals.length === 4
|
|
115
|
-
&& standardResult.instances
|
|
116
|
-
) {
|
|
117
|
-
// Add the severity totals of the tool to the score.
|
|
118
|
-
const {totals} = standardResult;
|
|
119
|
-
details.severity.byTool[which] = totals;
|
|
120
|
-
// Add the severity-weighted tool totals to the score.
|
|
121
|
-
details.tool[which] = totals.reduce(
|
|
122
|
-
(sum, current, index) => sum + severityWeights[index] * current, 0
|
|
123
|
-
);
|
|
124
|
-
// For each instance of the tool:
|
|
125
|
-
standardResult.instances.forEach(instance => {
|
|
126
|
-
// Get the rule ID.
|
|
127
|
-
const {ruleID, ordinalSeverity, count} = instance;
|
|
128
|
-
// If it is not in the table of tool rules:
|
|
129
|
-
let canonicalRuleID = ruleID;
|
|
130
|
-
if (! issueIndex[which][ruleID]) {
|
|
131
|
-
// Convert it to the variably named tool rule that it matches, if any.
|
|
132
|
-
canonicalRuleID = issueMatcher.find(pattern => {
|
|
133
|
-
const patternRE = new RegExp(pattern);
|
|
134
|
-
return patternRE.test(instance.ruleID);
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
// If the rule ID belongs to an issue:
|
|
138
|
-
if (canonicalRuleID) {
|
|
139
|
-
// Get the issue.
|
|
140
|
-
const issueName = issueIndex[which][canonicalRuleID];
|
|
141
|
-
// Add the instance to the issue details of the score data.
|
|
142
|
-
if (! details.issue[issueName]) {
|
|
143
|
-
details.issue[issueName] = {
|
|
144
|
-
summary: issues[issueName].summary,
|
|
145
|
-
score: 0,
|
|
146
|
-
maxCount: 0,
|
|
147
|
-
weight: issues[issueName].weight,
|
|
148
|
-
countLimit: issues[issueName].max,
|
|
149
|
-
tools: {}
|
|
150
|
-
};
|
|
151
|
-
if (! details.issue[issueName].countLimit) {
|
|
152
|
-
delete details.issue[issueName].countLimit;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (! details.issue[issueName].tools[which]) {
|
|
156
|
-
details.issue[issueName].tools[which] = {};
|
|
157
|
-
}
|
|
158
|
-
if (! details.issue[issueName].tools[which][canonicalRuleID]) {
|
|
159
|
-
const ruleData = issues[issueName].tools[which][canonicalRuleID];
|
|
160
|
-
details.issue[issueName].tools[which][canonicalRuleID] = {
|
|
161
|
-
quality: ruleData.quality,
|
|
162
|
-
what: ruleData.what,
|
|
163
|
-
complaints: {
|
|
164
|
-
countTotal: 0,
|
|
165
|
-
texts: []
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
details
|
|
170
|
-
.issue[issueName]
|
|
171
|
-
.tools[which][canonicalRuleID]
|
|
172
|
-
.complaints
|
|
173
|
-
.countTotal += instance.count || 1;
|
|
174
|
-
if (
|
|
175
|
-
! details
|
|
176
|
-
.issue[issueName]
|
|
177
|
-
.tools[which][canonicalRuleID]
|
|
178
|
-
.complaints
|
|
179
|
-
.texts
|
|
180
|
-
.includes(instance.what)
|
|
181
|
-
) {
|
|
182
|
-
details
|
|
183
|
-
.issue[issueName]
|
|
184
|
-
.tools[which][canonicalRuleID]
|
|
185
|
-
.complaints
|
|
186
|
-
.texts
|
|
187
|
-
.push(instance.what);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
// Otherwise, i.e. if the rule ID belongs to no issue:
|
|
191
|
-
else {
|
|
192
|
-
// Add the instance to the solo details of the score data.
|
|
193
|
-
if (! details.solo[which]) {
|
|
194
|
-
details.solo[which] = {};
|
|
195
|
-
}
|
|
196
|
-
if (! details.solo[which][ruleID]) {
|
|
197
|
-
details.solo[which][ruleID] = 0;
|
|
198
|
-
}
|
|
199
|
-
details.solo[which][ruleID] += (count || 1) * (ordinalSeverity + 1);
|
|
200
|
-
// Report this.
|
|
201
|
-
console.log(`ERROR: ${instance.ruleID} of ${which} not found in issues`);
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
// Otherwise, i.e. if a failed standard result exists:
|
|
206
|
-
else {
|
|
207
|
-
// Add an inferred prevention to the score.
|
|
208
|
-
details.prevention[which] = preventionWeight;
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
// For each issue with any complaints:
|
|
212
|
-
Object.keys(details.issue).forEach(issueName => {
|
|
213
|
-
const issueData = details.issue[issueName];
|
|
214
|
-
// For each tool with any complaints for the issue:
|
|
215
|
-
Object.keys(issueData.tools).forEach(toolID => {
|
|
216
|
-
// Get the sum of the quality-weighted counts of its issue rules.
|
|
217
|
-
let weightedCount = 0;
|
|
218
|
-
Object.values(issueData.tools[toolID]).forEach(ruleData => {
|
|
219
|
-
weightedCount += ruleData.quality * ruleData.complaints.countTotal;
|
|
220
|
-
});
|
|
221
|
-
// If the sum exceeds the existing maximum weighted count for the issue:
|
|
222
|
-
if (weightedCount > issueData.maxCount) {
|
|
223
|
-
// Change the maximum count for the issue to the sum.
|
|
224
|
-
issueData.maxCount = weightedCount;
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
// Get the score for the issue, including any addition for the instance count limit.
|
|
228
|
-
const maxAddition = issueData.countLimit ? maxWeight / issueData.countLimit : 0;
|
|
229
|
-
issueData.score = Math.round(issueData.weight * issueData.maxCount * (1 + maxAddition));
|
|
230
|
-
});
|
|
231
|
-
// Add the severity detail totals to the score.
|
|
232
|
-
details.severity.total = Object.keys(details.severity.byTool).reduce((severityTotals, toolID) => {
|
|
233
|
-
details.severity.byTool[toolID].forEach((severityScore, index) => {
|
|
234
|
-
severityTotals[index] += severityScore;
|
|
235
|
-
});
|
|
236
|
-
return severityTotals;
|
|
237
|
-
}, details.severity.total);
|
|
238
|
-
// Add the summary issue total to the score.
|
|
239
|
-
summary.issue = Object
|
|
240
|
-
.values(details.issue)
|
|
241
|
-
.reduce((total, current) => total + current.score, 0);
|
|
242
|
-
// Add the summary solo total to the score.
|
|
243
|
-
Object.keys(details.solo).forEach(tool => {
|
|
244
|
-
summary.solo += Object
|
|
245
|
-
.values(details.solo[tool])
|
|
246
|
-
.reduce((total, current) => total + current);
|
|
247
|
-
});
|
|
248
|
-
// Add the summary tool total to the score.
|
|
249
|
-
summary.tool = toolWeight * details.severity.total.reduce(
|
|
250
|
-
(total, current, index) => total + severityWeights[index] * current, 0
|
|
251
|
-
);
|
|
252
|
-
// Add the summary prevention total to the score.
|
|
253
|
-
summary.prevention = Object.values(details.prevention).reduce(
|
|
254
|
-
(total, current) => total + current, 0
|
|
255
|
-
);
|
|
256
|
-
// Add the summary log score to the score.
|
|
257
|
-
const {jobData} = report;
|
|
258
|
-
if (jobData) {
|
|
259
|
-
summary.log = Math.max(0, Math.round(
|
|
260
|
-
logWeights.logCount * jobData.logCount
|
|
261
|
-
+ logWeights.logSize * jobData.logSize +
|
|
262
|
-
+ logWeights.errorLogCount * jobData.errorLogCount
|
|
263
|
-
+ logWeights.errorLogSize * jobData.errorLogSize
|
|
264
|
-
+ logWeights.prohibitedCount * jobData.prohibitedCount +
|
|
265
|
-
+ logWeights.visitRejectionCount * jobData.visitRejectionCount
|
|
266
|
-
));
|
|
267
|
-
// Add the summary latency score to the score.
|
|
268
|
-
summary.latency = Math.round(
|
|
269
|
-
latencyWeight * (Math.max(0, jobData.visitLatency - normalLatency))
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
// Round the unrounded scores.
|
|
273
|
-
Object.keys(summary).forEach(summaryTypeName => {
|
|
274
|
-
summary[summaryTypeName] = Math.round(summary[summaryTypeName]);
|
|
275
|
-
});
|
|
276
|
-
details.severity.total.forEach((severityTotal, index) => {
|
|
277
|
-
details.severity.total[index] = Math.round(severityTotal);
|
|
278
|
-
});
|
|
279
|
-
// Add the summary total score to the score.
|
|
280
|
-
summary.total = summary.issue
|
|
281
|
-
+ summary.solo
|
|
282
|
-
+ summary.tool
|
|
283
|
-
+ summary.prevention
|
|
284
|
-
+ summary.log
|
|
285
|
-
+ summary.latency;
|
|
286
|
-
// Add the score to the report or replace the existing score of the report.
|
|
287
|
-
report.score = score;
|
|
288
|
-
}
|
|
289
|
-
// Otherwise, i.e. if none of them is a test act:
|
|
290
|
-
else {
|
|
291
|
-
// Report this.
|
|
292
|
-
console.log('ERROR: No test acts');
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
// Otherwise, i.e. if there are no acts in the report:
|
|
296
|
-
else {
|
|
297
|
-
// Report this.
|
|
298
|
-
console.log('ERROR: No acts');
|
|
299
|
-
}
|
|
300
|
-
};
|
package/scripts/ts31.json
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "ts31",
|
|
3
|
-
"what": "accessibility tests",
|
|
4
|
-
"strict": true,
|
|
5
|
-
"timeLimit": 330,
|
|
6
|
-
"acts": [
|
|
7
|
-
{
|
|
8
|
-
"type": "placeholder",
|
|
9
|
-
"which": "main",
|
|
10
|
-
"launch": "chromium"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "test",
|
|
14
|
-
"which": "alfa"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"type": "test",
|
|
18
|
-
"which": "axe",
|
|
19
|
-
"detailLevel": 2
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"type": "test",
|
|
23
|
-
"which": "continuum"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"type": "test",
|
|
27
|
-
"which": "htmlcs"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"type": "test",
|
|
31
|
-
"which": "ibm",
|
|
32
|
-
"withItems": true,
|
|
33
|
-
"withNewContent": false
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"type": "test",
|
|
37
|
-
"which": "nuVal"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"type": "test",
|
|
41
|
-
"which": "qualWeb",
|
|
42
|
-
"withNewContent": false
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"type": "test",
|
|
46
|
-
"which": "testaro",
|
|
47
|
-
"withItems": true,
|
|
48
|
-
"stopOnFail": false
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"type": "test",
|
|
52
|
-
"which": "wave",
|
|
53
|
-
"reportType": 4
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
package/scripts/ts33.json
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "ts33",
|
|
3
|
-
"what": "comprehensive accessibility tests",
|
|
4
|
-
"strict": true,
|
|
5
|
-
"timeLimit": 330,
|
|
6
|
-
"acts": [
|
|
7
|
-
{
|
|
8
|
-
"type": "placeholder",
|
|
9
|
-
"which": "main",
|
|
10
|
-
"launch": "chromium"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "test",
|
|
14
|
-
"which": "alfa"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"type": "test",
|
|
18
|
-
"which": "axe",
|
|
19
|
-
"detailLevel": 2
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"type": "test",
|
|
23
|
-
"which": "continuum"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"type": "test",
|
|
27
|
-
"which": "htmlcs"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"type": "test",
|
|
31
|
-
"which": "ibm",
|
|
32
|
-
"withItems": true,
|
|
33
|
-
"withNewContent": false
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"type": "test",
|
|
37
|
-
"which": "nuVal"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"type": "test",
|
|
41
|
-
"which": "qualWeb",
|
|
42
|
-
"withNewContent": false
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"type": "test",
|
|
46
|
-
"which": "testaro",
|
|
47
|
-
"withItems": true,
|
|
48
|
-
"stopOnFail": false
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"type": "test",
|
|
52
|
-
"which": "wave",
|
|
53
|
-
"reportType": 4
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
package/scripts/ts34.json
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "ts34",
|
|
3
|
-
"what": "comprehensive accessibility tests",
|
|
4
|
-
"strict": true,
|
|
5
|
-
"timeLimit": 330,
|
|
6
|
-
"acts": [
|
|
7
|
-
{
|
|
8
|
-
"type": "placeholder",
|
|
9
|
-
"which": "main",
|
|
10
|
-
"launch": "chromium"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "test",
|
|
14
|
-
"which": "alfa"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"type": "test",
|
|
18
|
-
"which": "axe",
|
|
19
|
-
"detailLevel": 2
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"type": "test",
|
|
23
|
-
"which": "continuum"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"type": "test",
|
|
27
|
-
"which": "htmlcs"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"type": "test",
|
|
31
|
-
"which": "ibm",
|
|
32
|
-
"withItems": true,
|
|
33
|
-
"withNewContent": false
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"type": "test",
|
|
37
|
-
"which": "nuVal"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"type": "test",
|
|
41
|
-
"which": "qualWeb",
|
|
42
|
-
"withNewContent": false
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"type": "test",
|
|
46
|
-
"which": "wave",
|
|
47
|
-
"reportType": 4
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"type": "test",
|
|
51
|
-
"which": "testaro",
|
|
52
|
-
"withItems": true,
|
|
53
|
-
"stopOnFail": false,
|
|
54
|
-
"rules": [
|
|
55
|
-
"n",
|
|
56
|
-
"hover",
|
|
57
|
-
"motion"
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"type": "placeholder",
|
|
62
|
-
"which": "main",
|
|
63
|
-
"launch": "webkit"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"type": "test",
|
|
67
|
-
"which": "testaro",
|
|
68
|
-
"withItems": true,
|
|
69
|
-
"stopOnFail": false,
|
|
70
|
-
"rules": [
|
|
71
|
-
"y",
|
|
72
|
-
"hover",
|
|
73
|
-
"motion"
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
}
|
package/scripts/ts36.json
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "ts36",
|
|
3
|
-
"what": "comprehensive accessibility tests with webkit and redirection permitted",
|
|
4
|
-
"strict": false,
|
|
5
|
-
"timeLimit": 330,
|
|
6
|
-
"acts": [
|
|
7
|
-
{
|
|
8
|
-
"type": "placeholder",
|
|
9
|
-
"which": "main",
|
|
10
|
-
"launch": "webkit"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "test",
|
|
14
|
-
"which": "alfa"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"type": "test",
|
|
18
|
-
"which": "aslint"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"type": "test",
|
|
22
|
-
"which": "axe",
|
|
23
|
-
"detailLevel": 2
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"type": "test",
|
|
27
|
-
"which": "htmlcs"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"type": "test",
|
|
31
|
-
"which": "ibm",
|
|
32
|
-
"withItems": true,
|
|
33
|
-
"withNewContent": false
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"type": "test",
|
|
37
|
-
"which": "nuVal"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"type": "test",
|
|
41
|
-
"which": "qualWeb",
|
|
42
|
-
"withNewContent": false
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"type": "test",
|
|
46
|
-
"which": "testaro",
|
|
47
|
-
"withItems": true,
|
|
48
|
-
"stopOnFail": false
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"type": "test",
|
|
52
|
-
"which": "wave",
|
|
53
|
-
"reportType": 4
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|