@a11y-skills/audit 0.2.0 → 0.3.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/CHANGELOG.md +44 -0
- package/README.ja.md +52 -4
- package/README.md +53 -4
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +5 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/playwright/runAutoPlayDetection.js +8 -2
- package/dist/playwright/runAutocompleteAudit.js +40 -10
- package/dist/playwright/runAxeAudit.d.ts +4 -0
- package/dist/playwright/runAxeAudit.js +26 -30
- package/dist/playwright/runFocusIndicatorCheck.js +55 -12
- package/dist/playwright/runOrientationCheck.js +13 -7
- package/dist/playwright/runReflowCheck.js +18 -11
- package/dist/playwright/runTargetSizeCheck.js +42 -10
- package/dist/playwright/runTextSpacingCheck.js +52 -8
- package/dist/playwright/runTimeLimitDetector.js +36 -11
- package/dist/playwright/runZoomCheck.js +35 -11
- package/dist/schemas/index.d.ts +8 -1
- package/dist/schemas/index.js +388 -292
- package/dist/types.d.ts +137 -53
- package/dist/types.js +9 -0
- package/dist/utils/axe-format.d.ts +88 -0
- package/dist/utils/axe-format.js +361 -0
- package/dist/utils/layout.d.ts +2 -0
- package/dist/utils/layout.js +20 -1
- package/dist/utils/rule-registry.d.ts +216 -0
- package/dist/utils/rule-registry.js +220 -0
- package/dist/utils/test-harness.d.ts +2 -2
- package/dist/utils/test-harness.js +5 -6
- package/package.json +2 -1
package/dist/schemas/index.js
CHANGED
|
@@ -6,7 +6,50 @@
|
|
|
6
6
|
* (e.g. an issue creator that reads `*-result.json`). They are intentionally
|
|
7
7
|
* permissive (no `additionalProperties: false`) so that additive changes to a
|
|
8
8
|
* result shape do not break downstream validation.
|
|
9
|
+
*
|
|
10
|
+
* Every check shares the same envelope (`source` / `url` / `timestamp` / the
|
|
11
|
+
* four normalized buckets / `summary` / `details` / `disclaimer`); the common
|
|
12
|
+
* pieces live in `$defs` and each check schema defines its own `details`.
|
|
9
13
|
*/
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// Shared $defs
|
|
16
|
+
// =============================================================================
|
|
17
|
+
const NORMALIZED_NODE_SCHEMA = {
|
|
18
|
+
type: 'object',
|
|
19
|
+
required: ['target', 'html', 'htmlTruncated', 'failureSummary'],
|
|
20
|
+
properties: {
|
|
21
|
+
target: { type: 'array', items: { type: 'string' } },
|
|
22
|
+
html: { type: 'string' },
|
|
23
|
+
htmlTruncated: { type: 'boolean' },
|
|
24
|
+
failureSummary: { type: 'string' },
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const NORMALIZED_RULE_RESULT_SCHEMA = {
|
|
28
|
+
type: 'object',
|
|
29
|
+
required: ['id', 'impact', 'description', 'help', 'helpUrl', 'tags', 'nodes'],
|
|
30
|
+
properties: {
|
|
31
|
+
id: { type: 'string' },
|
|
32
|
+
impact: {
|
|
33
|
+
type: ['string', 'null'],
|
|
34
|
+
enum: ['critical', 'serious', 'moderate', 'minor', null],
|
|
35
|
+
},
|
|
36
|
+
description: { type: 'string' },
|
|
37
|
+
help: { type: 'string' },
|
|
38
|
+
helpUrl: { type: 'string' },
|
|
39
|
+
tags: { type: 'array', items: { type: 'string' } },
|
|
40
|
+
nodes: { type: 'array', items: { $ref: '#/$defs/normalizedNode' } },
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
const SUMMARY_SCHEMA = {
|
|
44
|
+
type: 'object',
|
|
45
|
+
required: ['violationCount', 'incompleteCount', 'passCount'],
|
|
46
|
+
properties: {
|
|
47
|
+
violationCount: { type: 'number' },
|
|
48
|
+
incompleteCount: { type: 'number' },
|
|
49
|
+
passCount: { type: 'number' },
|
|
50
|
+
checkedNodes: { type: 'number' },
|
|
51
|
+
},
|
|
52
|
+
};
|
|
10
53
|
const DISCLAIMER_SCHEMA = {
|
|
11
54
|
type: 'object',
|
|
12
55
|
properties: {
|
|
@@ -16,342 +59,395 @@ const DISCLAIMER_SCHEMA = {
|
|
|
16
59
|
moreInfo: { type: 'string' },
|
|
17
60
|
},
|
|
18
61
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
+
const COMMON_DEFS = {
|
|
63
|
+
normalizedNode: NORMALIZED_NODE_SCHEMA,
|
|
64
|
+
normalizedRuleResult: NORMALIZED_RULE_RESULT_SCHEMA,
|
|
65
|
+
summary: SUMMARY_SCHEMA,
|
|
66
|
+
disclaimer: DISCLAIMER_SCHEMA,
|
|
67
|
+
};
|
|
68
|
+
const RULE_ARRAY = {
|
|
69
|
+
type: 'array',
|
|
70
|
+
items: { $ref: '#/$defs/normalizedRuleResult' },
|
|
71
|
+
};
|
|
72
|
+
/** Build the envelope schema for one check, plugging in its details schema. */
|
|
73
|
+
function buildEnvelopeSchema(args) {
|
|
74
|
+
return {
|
|
75
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
76
|
+
$id: `https://masup9.github.io/a11y-audit/schemas/${args.id}.json`,
|
|
77
|
+
title: args.title,
|
|
78
|
+
type: 'object',
|
|
79
|
+
required: [
|
|
80
|
+
'source',
|
|
81
|
+
'url',
|
|
82
|
+
'timestamp',
|
|
83
|
+
'violations',
|
|
84
|
+
'incomplete',
|
|
85
|
+
'passes',
|
|
86
|
+
'inapplicable',
|
|
87
|
+
'summary',
|
|
88
|
+
'details',
|
|
89
|
+
'disclaimer',
|
|
90
|
+
],
|
|
91
|
+
properties: {
|
|
92
|
+
source: { const: args.source },
|
|
93
|
+
url: { type: 'string' },
|
|
94
|
+
timestamp: { type: 'string' },
|
|
95
|
+
violations: RULE_ARRAY,
|
|
96
|
+
incomplete: RULE_ARRAY,
|
|
97
|
+
passes: RULE_ARRAY,
|
|
98
|
+
inapplicable: RULE_ARRAY,
|
|
99
|
+
summary: { $ref: '#/$defs/summary' },
|
|
100
|
+
details: args.details,
|
|
101
|
+
disclaimer: { $ref: '#/$defs/disclaimer' },
|
|
62
102
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
103
|
+
$defs: COMMON_DEFS,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
// =============================================================================
|
|
107
|
+
// Detail building blocks
|
|
108
|
+
// =============================================================================
|
|
109
|
+
const ELEMENT_EVIDENCE_PROPS = {
|
|
110
|
+
selector: { type: 'string' },
|
|
111
|
+
tagName: { type: 'string' },
|
|
112
|
+
html: { type: 'string' },
|
|
113
|
+
htmlTruncated: { type: 'boolean' },
|
|
69
114
|
};
|
|
70
115
|
const FOCUS_ELEMENT_REF_SCHEMA = {
|
|
71
116
|
type: 'object',
|
|
72
|
-
required: ['tag', 'name', 'selector'],
|
|
117
|
+
required: ['tag', 'name', 'selector', 'html', 'htmlTruncated'],
|
|
73
118
|
properties: {
|
|
74
119
|
tag: { type: 'string' },
|
|
75
120
|
role: { type: ['string', 'null'] },
|
|
76
121
|
name: { type: 'string' },
|
|
77
122
|
selector: { type: 'string' },
|
|
123
|
+
html: { type: 'string' },
|
|
124
|
+
htmlTruncated: { type: 'boolean' },
|
|
78
125
|
},
|
|
79
126
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
'
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
type: 'array',
|
|
105
|
-
items: {
|
|
106
|
-
type: 'object',
|
|
107
|
-
required: ['tag', 'name'],
|
|
108
|
-
properties: {
|
|
109
|
-
tag: { type: 'string' },
|
|
110
|
-
role: { type: ['string', 'null'] },
|
|
111
|
-
name: { type: 'string' },
|
|
112
|
-
},
|
|
113
|
-
},
|
|
127
|
+
// =============================================================================
|
|
128
|
+
// Check schemas
|
|
129
|
+
// =============================================================================
|
|
130
|
+
export const AXE_AUDIT_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
131
|
+
id: 'axe-audit-result',
|
|
132
|
+
title: 'AxeAuditResult',
|
|
133
|
+
source: 'axe-audit',
|
|
134
|
+
details: {
|
|
135
|
+
type: 'object',
|
|
136
|
+
required: [
|
|
137
|
+
'tagsRun',
|
|
138
|
+
'rulesOverride',
|
|
139
|
+
'violationRuleCount',
|
|
140
|
+
'passRuleCount',
|
|
141
|
+
'incompleteRuleCount',
|
|
142
|
+
'inapplicableRuleCount',
|
|
143
|
+
],
|
|
144
|
+
properties: {
|
|
145
|
+
tagsRun: { type: 'array', items: { type: 'string' } },
|
|
146
|
+
rulesOverride: { type: ['object', 'null'] },
|
|
147
|
+
violationRuleCount: { type: 'number' },
|
|
148
|
+
passRuleCount: { type: 'number' },
|
|
149
|
+
incompleteRuleCount: { type: 'number' },
|
|
150
|
+
inapplicableRuleCount: { type: 'number' },
|
|
114
151
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
export const FOCUS_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
155
|
+
id: 'focus-check-result',
|
|
156
|
+
title: 'FocusCheckResult',
|
|
157
|
+
source: 'focus-indicator-check',
|
|
158
|
+
details: {
|
|
159
|
+
type: 'object',
|
|
160
|
+
required: [
|
|
161
|
+
'totalFocusableElements',
|
|
162
|
+
'elementsWithFocusStyle',
|
|
163
|
+
'elementsWithoutFocusStyle',
|
|
164
|
+
'issues',
|
|
165
|
+
'onFocusViolations',
|
|
166
|
+
'focusObscuredIssues',
|
|
167
|
+
'elementsWithObscuredFocus',
|
|
168
|
+
'allElements',
|
|
169
|
+
'interrupted',
|
|
170
|
+
'screenshotPath',
|
|
171
|
+
],
|
|
172
|
+
properties: {
|
|
173
|
+
totalFocusableElements: { type: 'number' },
|
|
174
|
+
elementsWithFocusStyle: { type: 'number' },
|
|
175
|
+
elementsWithoutFocusStyle: { type: 'number' },
|
|
176
|
+
issues: { type: 'array', items: FOCUS_ELEMENT_REF_SCHEMA },
|
|
177
|
+
onFocusViolations: {
|
|
178
|
+
type: 'array',
|
|
179
|
+
items: {
|
|
180
|
+
type: 'object',
|
|
181
|
+
required: ['element', 'fromUrl', 'toUrl', 'changeType'],
|
|
182
|
+
properties: {
|
|
183
|
+
element: FOCUS_ELEMENT_REF_SCHEMA,
|
|
184
|
+
fromUrl: { type: 'string' },
|
|
185
|
+
toUrl: { type: 'string' },
|
|
186
|
+
changeType: {
|
|
187
|
+
type: 'string',
|
|
188
|
+
enum: ['navigation', 'new-window', 'dialog'],
|
|
189
|
+
},
|
|
127
190
|
},
|
|
128
191
|
},
|
|
129
192
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
193
|
+
focusObscuredIssues: {
|
|
194
|
+
type: 'array',
|
|
195
|
+
items: {
|
|
196
|
+
type: 'object',
|
|
197
|
+
required: ['element', 'elementRect', 'overlaps', 'obscuredRatio'],
|
|
198
|
+
properties: {
|
|
199
|
+
element: FOCUS_ELEMENT_REF_SCHEMA,
|
|
200
|
+
elementRect: { type: 'object' },
|
|
201
|
+
overlaps: { type: 'array', items: { type: 'object' } },
|
|
202
|
+
obscuredRatio: { type: 'number' },
|
|
203
|
+
},
|
|
141
204
|
},
|
|
142
205
|
},
|
|
206
|
+
elementsWithObscuredFocus: { type: 'number' },
|
|
207
|
+
allElements: { type: 'array', items: { type: 'object' } },
|
|
208
|
+
interrupted: { type: 'boolean' },
|
|
209
|
+
interruptedAt: { type: 'number' },
|
|
210
|
+
screenshotPath: { type: 'string' },
|
|
143
211
|
},
|
|
144
|
-
elementsWithObscuredFocus: { type: 'number' },
|
|
145
|
-
allElements: { type: 'array', items: { type: 'object' } },
|
|
146
|
-
interrupted: { type: 'boolean' },
|
|
147
|
-
interruptedAt: { type: 'number' },
|
|
148
|
-
screenshotPath: { type: 'string' },
|
|
149
|
-
disclaimer: DISCLAIMER_SCHEMA,
|
|
150
212
|
},
|
|
151
|
-
};
|
|
152
|
-
export const REFLOW_CHECK_RESULT_SCHEMA = {
|
|
153
|
-
|
|
154
|
-
$id: 'https://masup9.github.io/a11y-audit/schemas/reflow-check-result.json',
|
|
213
|
+
});
|
|
214
|
+
export const REFLOW_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
215
|
+
id: 'reflow-check-result',
|
|
155
216
|
title: 'ReflowCheckResult',
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
'
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
type: 'object',
|
|
170
|
-
required: ['width', 'height'],
|
|
171
|
-
properties: {
|
|
172
|
-
width: { type: 'number' },
|
|
173
|
-
height: { type: 'number' },
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
hasHorizontalScroll: { type: 'boolean' },
|
|
177
|
-
documentScrollWidth: { type: 'number' },
|
|
178
|
-
documentClientWidth: { type: 'number' },
|
|
179
|
-
overflowingElements: {
|
|
180
|
-
type: 'array',
|
|
181
|
-
items: {
|
|
217
|
+
source: 'reflow-check',
|
|
218
|
+
details: {
|
|
219
|
+
type: 'object',
|
|
220
|
+
required: [
|
|
221
|
+
'viewport',
|
|
222
|
+
'hasHorizontalScroll',
|
|
223
|
+
'documentScrollWidth',
|
|
224
|
+
'documentClientWidth',
|
|
225
|
+
'overflowingElements',
|
|
226
|
+
'clippedTextElements',
|
|
227
|
+
],
|
|
228
|
+
properties: {
|
|
229
|
+
viewport: {
|
|
182
230
|
type: 'object',
|
|
183
|
-
required: ['
|
|
231
|
+
required: ['width', 'height'],
|
|
184
232
|
properties: {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
233
|
+
width: { type: 'number' },
|
|
234
|
+
height: { type: 'number' },
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
hasHorizontalScroll: { type: 'boolean' },
|
|
238
|
+
documentScrollWidth: { type: 'number' },
|
|
239
|
+
documentClientWidth: { type: 'number' },
|
|
240
|
+
overflowingElements: {
|
|
241
|
+
type: 'array',
|
|
242
|
+
items: {
|
|
243
|
+
type: 'object',
|
|
244
|
+
required: [
|
|
245
|
+
'selector',
|
|
246
|
+
'tagName',
|
|
247
|
+
'html',
|
|
248
|
+
'htmlTruncated',
|
|
249
|
+
'rect',
|
|
250
|
+
'viewportWidth',
|
|
251
|
+
'reason',
|
|
252
|
+
],
|
|
253
|
+
properties: {
|
|
254
|
+
...ELEMENT_EVIDENCE_PROPS,
|
|
255
|
+
rect: { type: 'object' },
|
|
256
|
+
viewportWidth: { type: 'number' },
|
|
257
|
+
reason: {
|
|
258
|
+
type: 'string',
|
|
259
|
+
enum: ['overflow-right', 'overflow-left', 'clipped-text'],
|
|
260
|
+
},
|
|
192
261
|
},
|
|
193
262
|
},
|
|
194
263
|
},
|
|
264
|
+
clippedTextElements: { type: 'array', items: { type: 'object' } },
|
|
195
265
|
},
|
|
196
|
-
clippedTextElements: { type: 'array', items: { type: 'object' } },
|
|
197
|
-
disclaimer: DISCLAIMER_SCHEMA,
|
|
198
266
|
},
|
|
199
|
-
};
|
|
200
|
-
export const TARGET_SIZE_CHECK_RESULT_SCHEMA = {
|
|
201
|
-
|
|
202
|
-
$id: 'https://masup9.github.io/a11y-audit/schemas/target-size-check-result.json',
|
|
267
|
+
});
|
|
268
|
+
export const TARGET_SIZE_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
269
|
+
id: 'target-size-check-result',
|
|
203
270
|
title: 'TargetSizeCheckResult',
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
'
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
271
|
+
source: 'target-size-check',
|
|
272
|
+
details: {
|
|
273
|
+
type: 'object',
|
|
274
|
+
required: [
|
|
275
|
+
'totalTargetsChecked',
|
|
276
|
+
'failAA',
|
|
277
|
+
'failAAAOnly',
|
|
278
|
+
'passedTargets',
|
|
279
|
+
'exceptedTargets',
|
|
280
|
+
'summary',
|
|
281
|
+
],
|
|
282
|
+
properties: {
|
|
283
|
+
totalTargetsChecked: { type: 'number' },
|
|
284
|
+
failAA: {
|
|
285
|
+
type: 'array',
|
|
286
|
+
items: {
|
|
287
|
+
type: 'object',
|
|
288
|
+
required: [
|
|
289
|
+
'selector',
|
|
290
|
+
'tagName',
|
|
291
|
+
'html',
|
|
292
|
+
'htmlTruncated',
|
|
293
|
+
'width',
|
|
294
|
+
'height',
|
|
295
|
+
'minDimension',
|
|
296
|
+
'level',
|
|
297
|
+
'exceptionAssessment',
|
|
298
|
+
],
|
|
299
|
+
properties: {
|
|
300
|
+
...ELEMENT_EVIDENCE_PROPS,
|
|
301
|
+
role: { type: ['string', 'null'] },
|
|
302
|
+
accessibleName: { type: ['string', 'null'] },
|
|
303
|
+
width: { type: 'number' },
|
|
304
|
+
height: { type: 'number' },
|
|
305
|
+
minDimension: { type: 'number' },
|
|
306
|
+
level: {
|
|
307
|
+
type: 'string',
|
|
308
|
+
enum: ['fail-aa', 'fail-aaa-only', 'pass'],
|
|
309
|
+
},
|
|
310
|
+
exception: { type: ['string', 'null'] },
|
|
311
|
+
exceptionDetails: { type: ['string', 'null'] },
|
|
312
|
+
exceptionAssessment: {
|
|
313
|
+
type: 'string',
|
|
314
|
+
enum: ['ruled-out', 'possible', 'not-assessed'],
|
|
315
|
+
},
|
|
316
|
+
href: { type: ['string', 'null'] },
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
failAAAOnly: { type: 'array', items: { type: 'object' } },
|
|
321
|
+
passedTargets: { type: 'number' },
|
|
322
|
+
exceptedTargets: { type: 'array', items: { type: 'object' } },
|
|
323
|
+
summary: {
|
|
324
|
+
type: 'object',
|
|
325
|
+
required: [
|
|
326
|
+
'failAACount',
|
|
327
|
+
'failAAAOnlyCount',
|
|
328
|
+
'passCount',
|
|
329
|
+
'exceptedCount',
|
|
330
|
+
],
|
|
331
|
+
properties: {
|
|
332
|
+
failAACount: { type: 'number' },
|
|
333
|
+
failAAAOnlyCount: { type: 'number' },
|
|
334
|
+
passCount: { type: 'number' },
|
|
335
|
+
exceptedCount: { type: 'number' },
|
|
336
|
+
},
|
|
234
337
|
},
|
|
235
338
|
},
|
|
236
|
-
disclaimer: DISCLAIMER_SCHEMA,
|
|
237
339
|
},
|
|
238
|
-
};
|
|
239
|
-
export const TEXT_SPACING_CHECK_RESULT_SCHEMA = {
|
|
240
|
-
|
|
241
|
-
$id: 'https://masup9.github.io/a11y-audit/schemas/text-spacing-check-result.json',
|
|
340
|
+
});
|
|
341
|
+
export const TEXT_SPACING_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
342
|
+
id: 'text-spacing-check-result',
|
|
242
343
|
title: 'TextSpacingCheckResult',
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
344
|
+
source: 'text-spacing-check',
|
|
345
|
+
details: {
|
|
346
|
+
type: 'object',
|
|
347
|
+
required: ['clippedElements', 'totalElementsChecked'],
|
|
348
|
+
properties: {
|
|
349
|
+
clippedElements: { type: 'array', items: { type: 'object' } },
|
|
350
|
+
totalElementsChecked: { type: 'number' },
|
|
351
|
+
},
|
|
250
352
|
},
|
|
251
|
-
};
|
|
252
|
-
export const ZOOM_CHECK_RESULT_SCHEMA = {
|
|
253
|
-
|
|
254
|
-
$id: 'https://masup9.github.io/a11y-audit/schemas/zoom-check-result.json',
|
|
353
|
+
});
|
|
354
|
+
export const ZOOM_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
355
|
+
id: 'zoom-check-result',
|
|
255
356
|
title: 'ZoomCheckResult',
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
'
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
357
|
+
source: 'zoom-200-check',
|
|
358
|
+
details: {
|
|
359
|
+
type: 'object',
|
|
360
|
+
required: [
|
|
361
|
+
'zoomFactor',
|
|
362
|
+
'viewport',
|
|
363
|
+
'hasHorizontalScroll',
|
|
364
|
+
'documentScrollWidth',
|
|
365
|
+
'documentClientWidth',
|
|
366
|
+
'clippedElements',
|
|
367
|
+
],
|
|
368
|
+
properties: {
|
|
369
|
+
zoomFactor: { type: 'number' },
|
|
370
|
+
viewport: { type: 'object' },
|
|
371
|
+
hasHorizontalScroll: { type: 'boolean' },
|
|
372
|
+
documentScrollWidth: { type: 'number' },
|
|
373
|
+
documentClientWidth: { type: 'number' },
|
|
374
|
+
clippedElements: { type: 'array', items: { type: 'object' } },
|
|
375
|
+
},
|
|
275
376
|
},
|
|
276
|
-
};
|
|
277
|
-
export const ORIENTATION_CHECK_RESULT_SCHEMA = {
|
|
278
|
-
|
|
279
|
-
$id: 'https://masup9.github.io/a11y-audit/schemas/orientation-check-result.json',
|
|
377
|
+
});
|
|
378
|
+
export const ORIENTATION_CHECK_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
379
|
+
id: 'orientation-check-result',
|
|
280
380
|
title: 'OrientationCheckResult',
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
381
|
+
source: 'orientation-check',
|
|
382
|
+
details: {
|
|
383
|
+
type: 'object',
|
|
384
|
+
required: ['portrait', 'landscape', 'hasOrientationLock', 'lockDetectedIn'],
|
|
385
|
+
properties: {
|
|
386
|
+
portrait: { type: 'object' },
|
|
387
|
+
landscape: { type: 'object' },
|
|
388
|
+
hasOrientationLock: { type: 'boolean' },
|
|
389
|
+
lockDetectedIn: {
|
|
390
|
+
type: 'string',
|
|
391
|
+
enum: ['portrait', 'landscape', 'both', 'none'],
|
|
392
|
+
},
|
|
291
393
|
},
|
|
292
|
-
disclaimer: DISCLAIMER_SCHEMA,
|
|
293
394
|
},
|
|
294
|
-
};
|
|
295
|
-
export const AUTOCOMPLETE_AUDIT_RESULT_SCHEMA = {
|
|
296
|
-
|
|
297
|
-
$id: 'https://masup9.github.io/a11y-audit/schemas/autocomplete-audit-result.json',
|
|
395
|
+
});
|
|
396
|
+
export const AUTOCOMPLETE_AUDIT_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
397
|
+
id: 'autocomplete-audit-result',
|
|
298
398
|
title: 'AutocompleteAuditResult',
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
'
|
|
302
|
-
'totalFieldsChecked',
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
totalFieldsChecked: { type: 'number' },
|
|
309
|
-
missingAutocomplete: { type: 'array', items: { type: 'object' } },
|
|
310
|
-
invalidAutocomplete: { type: 'array', items: { type: 'object' } },
|
|
311
|
-
disclaimer: DISCLAIMER_SCHEMA,
|
|
399
|
+
source: 'autocomplete-audit',
|
|
400
|
+
details: {
|
|
401
|
+
type: 'object',
|
|
402
|
+
required: ['totalFieldsChecked', 'missingAutocomplete', 'invalidAutocomplete'],
|
|
403
|
+
properties: {
|
|
404
|
+
totalFieldsChecked: { type: 'number' },
|
|
405
|
+
missingAutocomplete: { type: 'array', items: { type: 'object' } },
|
|
406
|
+
invalidAutocomplete: { type: 'array', items: { type: 'object' } },
|
|
407
|
+
},
|
|
312
408
|
},
|
|
313
|
-
};
|
|
314
|
-
export const TIME_LIMIT_DETECTOR_RESULT_SCHEMA = {
|
|
315
|
-
|
|
316
|
-
$id: 'https://masup9.github.io/a11y-audit/schemas/time-limit-detector-result.json',
|
|
409
|
+
});
|
|
410
|
+
export const TIME_LIMIT_DETECTOR_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
411
|
+
id: 'time-limit-detector-result',
|
|
317
412
|
title: 'TimeLimitDetectorResult',
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
413
|
+
source: 'time-limit-detector',
|
|
414
|
+
details: {
|
|
415
|
+
type: 'object',
|
|
416
|
+
required: ['metaRefresh', 'timers', 'countdownIndicators', 'hasTimeLimits'],
|
|
417
|
+
properties: {
|
|
418
|
+
metaRefresh: { type: 'array', items: { type: 'object' } },
|
|
419
|
+
timers: { type: 'array', items: { type: 'object' } },
|
|
420
|
+
countdownIndicators: { type: 'array', items: { type: 'object' } },
|
|
421
|
+
hasTimeLimits: { type: 'boolean' },
|
|
422
|
+
},
|
|
327
423
|
},
|
|
328
|
-
};
|
|
329
|
-
export const AUTO_PLAY_DETECTION_RESULT_SCHEMA = {
|
|
330
|
-
|
|
331
|
-
$id: 'https://masup9.github.io/a11y-audit/schemas/auto-play-detection-result.json',
|
|
424
|
+
});
|
|
425
|
+
export const AUTO_PLAY_DETECTION_RESULT_SCHEMA = buildEnvelopeSchema({
|
|
426
|
+
id: 'auto-play-detection-result',
|
|
332
427
|
title: 'AutoPlayDetectionResult',
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
'
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
428
|
+
source: 'auto-play-detection',
|
|
429
|
+
details: {
|
|
430
|
+
type: 'object',
|
|
431
|
+
required: [
|
|
432
|
+
'screenshotRecords',
|
|
433
|
+
'comparisons',
|
|
434
|
+
'hasAutoPlayContent',
|
|
435
|
+
'stopsWithin5Seconds',
|
|
436
|
+
'pauseControls',
|
|
437
|
+
'pauseVerification',
|
|
438
|
+
'recommendation',
|
|
439
|
+
],
|
|
440
|
+
properties: {
|
|
441
|
+
screenshotRecords: { type: 'array', items: { type: 'object' } },
|
|
442
|
+
comparisons: { type: 'array', items: { type: 'object' } },
|
|
443
|
+
hasAutoPlayContent: { type: 'boolean' },
|
|
444
|
+
stopsWithin5Seconds: { type: 'boolean' },
|
|
445
|
+
pauseControls: { type: 'object' },
|
|
446
|
+
pauseVerification: { type: 'object' },
|
|
447
|
+
recommendation: { type: 'string' },
|
|
448
|
+
},
|
|
353
449
|
},
|
|
354
|
-
};
|
|
450
|
+
});
|
|
355
451
|
/** All result schemas keyed by check id. */
|
|
356
452
|
export const RESULT_SCHEMAS = {
|
|
357
453
|
'axe-audit': AXE_AUDIT_RESULT_SCHEMA,
|