testaro 12.1.0 → 12.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/actSpecs.js +1 -0
- package/package.json +1 -1
- package/tests/qualWeb.js +25 -19
- package/samples/00000-ts18-example.json +0 -231
package/actSpecs.js
CHANGED
|
@@ -308,6 +308,7 @@ exports.actSpecs = {
|
|
|
308
308
|
qualWeb: [
|
|
309
309
|
'Perform a qualWeb test',
|
|
310
310
|
{
|
|
311
|
+
withNewContent: [true, 'boolean', '', 'whether to use a URL instead of page content'],
|
|
311
312
|
rules: [false, 'array', 'areStrings', 'QualWeb or ACT IDs of ACT rules to include, if not all']
|
|
312
313
|
}
|
|
313
314
|
],
|
package/package.json
CHANGED
package/tests/qualWeb.js
CHANGED
|
@@ -5,21 +5,18 @@
|
|
|
5
5
|
// IMPORTS
|
|
6
6
|
const {QualWeb} = require('@qualweb/core');
|
|
7
7
|
// CONSTANTS
|
|
8
|
-
const
|
|
8
|
+
const qualWeb = new QualWeb({});
|
|
9
9
|
const clusterOptions = {
|
|
10
10
|
timeout: 25 * 1000
|
|
11
11
|
};
|
|
12
12
|
// FUNCTIONS
|
|
13
13
|
// Conducts and reports a QualWeb test.
|
|
14
|
-
exports.reporter = async (page, rules = null) => {
|
|
14
|
+
exports.reporter = async (page, withNewContent, rules = null) => {
|
|
15
15
|
// Initialize the report.
|
|
16
|
-
let data = {};
|
|
17
16
|
// Start the QualWeb core engine.
|
|
18
|
-
await
|
|
17
|
+
await qualWeb.start(clusterOptions);
|
|
19
18
|
// Specify the page.
|
|
20
|
-
const
|
|
21
|
-
const qualwebOptions = {
|
|
22
|
-
html,
|
|
19
|
+
const qualWebOptions = {
|
|
23
20
|
log: {
|
|
24
21
|
console: true
|
|
25
22
|
},
|
|
@@ -41,24 +38,33 @@ exports.reporter = async (page, rules = null) => {
|
|
|
41
38
|
exclude: []
|
|
42
39
|
}
|
|
43
40
|
};
|
|
41
|
+
if (withNewContent) {
|
|
42
|
+
qualWebOptions.url = page.url();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
qualWebOptions.html = await page.content();
|
|
46
|
+
}
|
|
44
47
|
if (rules) {
|
|
45
|
-
|
|
48
|
+
qualWebOptions['act-rules'].rules = rules;
|
|
46
49
|
}
|
|
47
50
|
else {
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
qualWebOptions['act-rules'].levels = ['A', 'AA', 'AAA'];
|
|
52
|
+
qualWebOptions['act-rules'].principles = [
|
|
50
53
|
'Perceivable', 'Operable', 'Understandable', 'Robust'
|
|
51
54
|
];
|
|
52
55
|
}
|
|
53
56
|
// Get the report.
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
+
let reports = await qualWeb.evaluate(qualWebOptions);
|
|
58
|
+
// Remove the copy of the DOM from it.
|
|
59
|
+
let report = reports[withNewContent ? qualWebOptions.url : 'customHtml'];
|
|
60
|
+
delete report.system.page.dom;
|
|
61
|
+
// For each section of the report:
|
|
57
62
|
['act-rules', 'wcag-techniques', 'best-practices'].forEach(module => {
|
|
58
|
-
|
|
63
|
+
// For each test:
|
|
64
|
+
const {assertions} = report.modules[module];
|
|
59
65
|
const ruleIDs = Object.keys(assertions);
|
|
60
66
|
ruleIDs.forEach(ruleID => {
|
|
61
|
-
// Remove passing
|
|
67
|
+
// Remove passing results.
|
|
62
68
|
const ruleAssertions = assertions[ruleID];
|
|
63
69
|
const {metadata} = ruleAssertions;
|
|
64
70
|
if (metadata) {
|
|
@@ -88,17 +94,17 @@ exports.reporter = async (page, rules = null) => {
|
|
|
88
94
|
});
|
|
89
95
|
});
|
|
90
96
|
// Stop the QualWeb core engine.
|
|
91
|
-
await
|
|
97
|
+
await qualWeb.stop();
|
|
92
98
|
// Return the result.
|
|
93
99
|
try {
|
|
94
|
-
JSON.stringify(
|
|
100
|
+
JSON.stringify(reports);
|
|
95
101
|
}
|
|
96
102
|
catch(error) {
|
|
97
103
|
console.log(`ERROR: qualWeb result cannot be made JSON (${error.message})`);
|
|
98
|
-
|
|
104
|
+
report = {
|
|
99
105
|
prevented: true,
|
|
100
106
|
error: `ERROR: qualWeb result cannot be made JSON (${error.message})`
|
|
101
107
|
};
|
|
102
108
|
}
|
|
103
|
-
return {result:
|
|
109
|
+
return {result: report};
|
|
104
110
|
};
|
|
@@ -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
|
-
}
|