testaro 12.0.0 → 12.1.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 +4 -0
- package/package.json +1 -1
- package/tests/qualWeb.js +35 -16
- package/samples/00000-ts18-example.json +0 -231
package/README.md
CHANGED
|
@@ -380,6 +380,10 @@ The changes in `htmlcs/HTMLCS.js` are:
|
|
|
380
380
|
> );
|
|
381
381
|
```
|
|
382
382
|
|
|
383
|
+
###### QualWeb
|
|
384
|
+
|
|
385
|
+
A `qualWeb` test act performs the ACT rules, WCAG Techniques, and best-practices tests of QualWeb. Only failures and warnings are included in the report. The EARL report of QualWeb is not generated, because it is equivalent to the report of the ACT rules tests.
|
|
386
|
+
|
|
383
387
|
###### Tenon
|
|
384
388
|
|
|
385
389
|
Most tools require only one act, but the `tenon` tool requires two acts:
|
package/package.json
CHANGED
package/tests/qualWeb.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This test implements the QualWeb ruleset for accessibility.
|
|
4
4
|
*/
|
|
5
5
|
// IMPORTS
|
|
6
|
-
const {QualWeb
|
|
6
|
+
const {QualWeb} = require('@qualweb/core');
|
|
7
7
|
// CONSTANTS
|
|
8
8
|
const qualweb = new QualWeb({});
|
|
9
9
|
const clusterOptions = {
|
|
@@ -52,24 +52,43 @@ exports.reporter = async (page, rules = null) => {
|
|
|
52
52
|
}
|
|
53
53
|
// Get the report.
|
|
54
54
|
const reports = await qualweb.evaluate(qualwebOptions);
|
|
55
|
-
//
|
|
55
|
+
// Prepare to trim its ACT rules and WCAG Techniques section.
|
|
56
56
|
delete reports.customHtml.system.page.dom;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
['act-rules', 'wcag-techniques', 'best-practices'].forEach(module => {
|
|
58
|
+
const {assertions} = reports.customHtml.modules[module];
|
|
59
|
+
const ruleIDs = Object.keys(assertions);
|
|
60
|
+
ruleIDs.forEach(ruleID => {
|
|
61
|
+
// Remove passing customHtml results.
|
|
62
|
+
const ruleAssertions = assertions[ruleID];
|
|
63
|
+
const {metadata} = ruleAssertions;
|
|
64
|
+
if (metadata) {
|
|
65
|
+
if (metadata.warning === 0 && metadata.failed === 0) {
|
|
66
|
+
delete assertions[ruleID];
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
if (ruleAssertions.results) {
|
|
70
|
+
ruleAssertions.results = ruleAssertions.results.filter(
|
|
71
|
+
result => result.verdict !== 'passed'
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Shorten long HTML codes of elements.
|
|
77
|
+
const {results} = ruleAssertions;
|
|
78
|
+
results.forEach(result => {
|
|
79
|
+
const {elements} = result;
|
|
80
|
+
if (elements && elements.length) {
|
|
81
|
+
elements.forEach(element => {
|
|
82
|
+
if (element.htmlCode && element.htmlCode.length > 700) {
|
|
83
|
+
element.htmlCode = `${element.htmlCode.slice(0, 700)} …`;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
63
89
|
});
|
|
64
90
|
// Stop the QualWeb core engine.
|
|
65
91
|
await qualweb.stop();
|
|
66
|
-
// Specify the EARL options.
|
|
67
|
-
const earlOptions = {};
|
|
68
|
-
// Get the EARL report.
|
|
69
|
-
const earlReports = generateEARLReport(reports, earlOptions);
|
|
70
|
-
// Add the reports to the data.
|
|
71
|
-
data.reports = reports;
|
|
72
|
-
data.earlReports = earlReports;
|
|
73
92
|
// Return the result.
|
|
74
93
|
try {
|
|
75
94
|
JSON.stringify(data);
|
|
@@ -81,5 +100,5 @@ exports.reporter = async (page, rules = null) => {
|
|
|
81
100
|
error: `ERROR: qualWeb result cannot be made JSON (${error.message})`
|
|
82
101
|
};
|
|
83
102
|
}
|
|
84
|
-
return {result:
|
|
103
|
+
return {result: reports};
|
|
85
104
|
};
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "00000-ts18-example",
|
|
3
|
-
"what": "Alfa, Axe, Continuum, HTML CodeSniffer, IBM, Nu Html Checker, Tenon, WAVE, and 22 custom tests",
|
|
4
|
-
"strict": true,
|
|
5
|
-
"timeLimit": 500,
|
|
6
|
-
"commands": [
|
|
7
|
-
{
|
|
8
|
-
"type": "launch",
|
|
9
|
-
"which": "webkit",
|
|
10
|
-
"what": "Webkit browser"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "url",
|
|
14
|
-
"which": "https://example.edu",
|
|
15
|
-
"what": "Example.com",
|
|
16
|
-
"id": "example"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"type": "tenonRequest",
|
|
20
|
-
"id": "a",
|
|
21
|
-
"withNewContent": true,
|
|
22
|
-
"what": "Tenon API version 2 test request"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"type": "test",
|
|
26
|
-
"which": "motion",
|
|
27
|
-
"what": "spontaneous change of content; requires webkit",
|
|
28
|
-
"delay": 2500,
|
|
29
|
-
"interval": 2500,
|
|
30
|
-
"count": 5
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"type": "launch",
|
|
34
|
-
"which": "chromium",
|
|
35
|
-
"what": "Chromium browser"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"type": "url",
|
|
39
|
-
"which": "https://example.edu",
|
|
40
|
-
"what": "Example.com",
|
|
41
|
-
"id": "example"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"type": "test",
|
|
45
|
-
"which": "allHidden",
|
|
46
|
-
"what": "document entirely or mainly hidden"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"type": "test",
|
|
50
|
-
"which": "bulk",
|
|
51
|
-
"what": "count of visible elements"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"type": "test",
|
|
55
|
-
"which": "docType",
|
|
56
|
-
"what": "missing or invalid doctype declaration"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"type": "test",
|
|
60
|
-
"which": "embAc",
|
|
61
|
-
"withItems": true,
|
|
62
|
-
"what": "active elements incorrectly embedded in each other"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"type": "test",
|
|
66
|
-
"which": "filter",
|
|
67
|
-
"withItems": true,
|
|
68
|
-
"what": "filter styles"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"type": "test",
|
|
72
|
-
"which": "focAll",
|
|
73
|
-
"what": "Tab-focusability"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"type": "test",
|
|
77
|
-
"which": "focInd",
|
|
78
|
-
"revealAll": false,
|
|
79
|
-
"allowedDelay": 250,
|
|
80
|
-
"withItems": true,
|
|
81
|
-
"what": "focus indicators"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"type": "test",
|
|
85
|
-
"which": "focOp",
|
|
86
|
-
"withItems": true,
|
|
87
|
-
"what": "focusability and operability of elements"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"type": "test",
|
|
91
|
-
"which": "focVis",
|
|
92
|
-
"withItems": true,
|
|
93
|
-
"what": "links outside display when focused"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"type": "test",
|
|
97
|
-
"which": "hover",
|
|
98
|
-
"sampleSize": 20,
|
|
99
|
-
"withItems": true,
|
|
100
|
-
"what": "hover impacts"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"type": "test",
|
|
104
|
-
"which": "labClash",
|
|
105
|
-
"withItems": true,
|
|
106
|
-
"what": "unlabeled and mislabeled form controls"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"type": "test",
|
|
110
|
-
"which": "linkTo",
|
|
111
|
-
"withItems": true,
|
|
112
|
-
"what": "links without destinations"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"type": "test",
|
|
116
|
-
"which": "linkUl",
|
|
117
|
-
"withItems": true,
|
|
118
|
-
"what": "underlining of inline links"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"type": "test",
|
|
122
|
-
"which": "miniText",
|
|
123
|
-
"withItems": true,
|
|
124
|
-
"what": "small text"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"type": "test",
|
|
128
|
-
"which": "menuNav",
|
|
129
|
-
"withItems": true,
|
|
130
|
-
"what": "keyboard navigation within true-focus menus"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"type": "test",
|
|
134
|
-
"which": "nonTable",
|
|
135
|
-
"withItems": true,
|
|
136
|
-
"what": "tables used for layout"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"type": "test",
|
|
140
|
-
"which": "radioSet",
|
|
141
|
-
"withItems": true,
|
|
142
|
-
"what": "grouping of radio buttons in fieldsets"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"type": "test",
|
|
146
|
-
"which": "role",
|
|
147
|
-
"what": "validity and necessity of role assignments"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"type": "test",
|
|
151
|
-
"which": "styleDiff",
|
|
152
|
-
"withItems": true,
|
|
153
|
-
"what": "style consistency of headings, buttons, and links"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"type": "test",
|
|
157
|
-
"which": "tabNav",
|
|
158
|
-
"withItems": true,
|
|
159
|
-
"what": "keyboard navigation within tab lists"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"type": "test",
|
|
163
|
-
"which": "titledEl",
|
|
164
|
-
"withItems": true,
|
|
165
|
-
"what": "title attributes on inappropriate elements"
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
"type": "test",
|
|
169
|
-
"which": "zIndex",
|
|
170
|
-
"withItems": true,
|
|
171
|
-
"what": "elements with non-auto z indexes"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"type": "test",
|
|
175
|
-
"which": "alfa",
|
|
176
|
-
"what": "Siteimprove alfa"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"type": "test",
|
|
180
|
-
"which": "axe",
|
|
181
|
-
"detailLevel": 2,
|
|
182
|
-
"rules": [],
|
|
183
|
-
"what": "Axe core, all rules"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"type": "test",
|
|
187
|
-
"which": "continuum",
|
|
188
|
-
"what": "Continuum"
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
"type": "test",
|
|
192
|
-
"which": "htmlcs",
|
|
193
|
-
"what": "HTML CodeSniffer"
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"type": "test",
|
|
197
|
-
"which": "ibm",
|
|
198
|
-
"withItems": true,
|
|
199
|
-
"what": "IBM Accessibility Checker, with page content and again with URL"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"type": "test",
|
|
203
|
-
"which": "nuVal",
|
|
204
|
-
"what": "Nu Html Checker"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"type": "test",
|
|
208
|
-
"which": "wave",
|
|
209
|
-
"reportType": 4,
|
|
210
|
-
"what": "WAVE, report-type 4"
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"type": "test",
|
|
214
|
-
"which": "tenon",
|
|
215
|
-
"id": "a",
|
|
216
|
-
"what": "Tenon API version 2 result retrieval"
|
|
217
|
-
}
|
|
218
|
-
],
|
|
219
|
-
"sources": {
|
|
220
|
-
"script": "ts18",
|
|
221
|
-
"batch": "",
|
|
222
|
-
"host": {
|
|
223
|
-
"id": "example",
|
|
224
|
-
"which": "https://example.edu",
|
|
225
|
-
"what": "Example.com"
|
|
226
|
-
},
|
|
227
|
-
"requester": "user@domain.tld"
|
|
228
|
-
},
|
|
229
|
-
"jobCreationTime": "2022-11-12T22:51:45",
|
|
230
|
-
"timeStamp": "00000"
|
|
231
|
-
}
|