testaro 16.1.0 → 16.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/testaro/motion.js CHANGED
@@ -5,16 +5,16 @@
5
5
  by the time a user manages to stop motion, the motion may have caused annoyance or harm. For
6
6
  superior accessibility, a page contains no motion until and unless the user authorizes it. The
7
7
  test compares two screen shots of the viewport 2 seconds and 6 seconds after page load. It
8
- reports a rule violation if more than 1% of the pixels change. The larger the change fraction,
9
- the greater the ordinal severity.
8
+ reports a rule violation if any pixels change. The larger the change fraction, the greater the
9
+ ordinal severity.
10
10
 
11
- WARNING: This test uses the Playwright page.screenshot method, which produces incorrect results
12
- when the browser type is chromium and is not implemented for the firefox browser type. The only
13
- browser type usable with this test is webkit.
11
+ WARNING: This test uses the Playwright page.screenshot method, which is not implemented for the
12
+ firefox browser type.
14
13
  */
15
14
 
16
15
  // IMPORTS
17
16
 
17
+ // Module to get pixel changes between two times.
18
18
  const {visChange} = require('../procs/visChange');
19
19
 
20
20
  // FUNCTIONS
@@ -31,10 +31,10 @@ exports.reporter = async page => {
31
31
  });
32
32
  // If the screenshots succeeded:
33
33
  if (data.success) {
34
- // Get the ordinal severity from the fractional pixel change.
35
- const ordinalSeverity = Math.floor(Math.min(3, 0.4 * Math.sqrt(data.changePercent)));
36
34
  // If any pixels were changed:
37
35
  if (data.pixelChanges) {
36
+ // Get the ordinal severity from the fractional pixel change.
37
+ const ordinalSeverity = Math.floor(Math.min(3, 0.4 * Math.sqrt(data.changePercent)));
38
38
  // Add to the totals.
39
39
  totals[ordinalSeverity] = 1;
40
40
  // Get a summary standard instance.
@@ -0,0 +1,320 @@
1
+ {
2
+ "id": "hover",
3
+ "what": "validation of hover test",
4
+ "strict": true,
5
+ "timeLimit": 40,
6
+ "acts": [
7
+ {
8
+ "type": "launch",
9
+ "which": "webkit",
10
+ "what": "only compatible browser"
11
+ },
12
+ {
13
+ "type": "url",
14
+ "which": "__targets__/hover/good.html",
15
+ "what": "page with standard hover behavior"
16
+ },
17
+ {
18
+ "type": "test",
19
+ "which": "testaro",
20
+ "withItems": true,
21
+ "expect": [
22
+ [
23
+ "standardResult.totals.0",
24
+ "=",
25
+ 0
26
+ ],
27
+ [
28
+ "standardResult.totals.2",
29
+ "=",
30
+ 0
31
+ ],
32
+ [
33
+ "standardResult.instances.length",
34
+ "=",
35
+ 0
36
+ ]
37
+ ],
38
+ "rules": [
39
+ "y",
40
+ "hover"
41
+ ],
42
+ "args": {
43
+ "hover": [5]
44
+ }
45
+ },
46
+ {
47
+ "type": "url",
48
+ "which": "__targets__/hover/bad.html",
49
+ "what": "page with deviant hover behavior"
50
+ },
51
+ {
52
+ "type": "test",
53
+ "which": "testaro",
54
+ "withItems": true,
55
+ "expect": [
56
+ [
57
+ "standardResult.totals.3",
58
+ ">",
59
+ 0
60
+ ],
61
+ [
62
+ "standardResult.instances.0.ruleID",
63
+ "=",
64
+ "hover"
65
+ ],
66
+ [
67
+ "standardResult.instances.0.what",
68
+ "i",
69
+ "over the element"
70
+ ],
71
+ [
72
+ "standardResult.instances.0.tagName",
73
+ "=",
74
+ "A"
75
+ ],
76
+ [
77
+ "standardResult.instances.0.location.doc",
78
+ "=",
79
+ "dom"
80
+ ],
81
+ [
82
+ "standardResult.instances.0.location.type",
83
+ "=",
84
+ "box"
85
+ ],
86
+ [
87
+ "standardResult.instances.0.location.spec.height",
88
+ "<",
89
+ "20"
90
+ ],
91
+ [
92
+ "standardResult.instances.0.excerpt",
93
+ "i",
94
+ "Trigger 1"
95
+ ],
96
+ [
97
+ "standardResult.instances.2.what",
98
+ "i",
99
+ "is not hoverable"
100
+ ],
101
+ [
102
+ "standardResult.instances.2.ordinalSeverity",
103
+ "=",
104
+ 3
105
+ ],
106
+ [
107
+ "standardResult.instances.2.tagName",
108
+ "=",
109
+ "BUTTON"
110
+ ],
111
+ [
112
+ "standardResult.instances.2.id",
113
+ "=",
114
+ "smallButton"
115
+ ],
116
+ [
117
+ "standardResult.instances.0.location.doc",
118
+ "=",
119
+ "dom"
120
+ ],
121
+ [
122
+ "standardResult.instances.0.location.type",
123
+ "=",
124
+ "selector"
125
+ ],
126
+ [
127
+ "standardResult.instances.0.location.spec",
128
+ "=",
129
+ "#smallButton"
130
+ ],
131
+ [
132
+ "standardResult.instances.2.excerpt",
133
+ "i",
134
+ "Trigger 3"
135
+ ]
136
+ ],
137
+ "rules": [
138
+ "y",
139
+ "hover"
140
+ ],
141
+ "args": {
142
+ "hover": [6]
143
+ }
144
+ },
145
+ {
146
+ "type": "test",
147
+ "which": "testaro",
148
+ "withItems": false,
149
+ "expect": [
150
+ [
151
+ "standardResult.totals.3",
152
+ ">",
153
+ 0
154
+ ],
155
+ [
156
+ "standardResult.instances.length",
157
+ ">",
158
+ 0
159
+ ],
160
+ [
161
+ "standardResult.instances.0.ruleID",
162
+ "=",
163
+ "hover"
164
+ ],
165
+ [
166
+ "standardResult.instances.0.what",
167
+ "i",
168
+ "over elements"
169
+ ],
170
+ [
171
+ "standardResult.instances.0.ordinalSeverity",
172
+ ">",
173
+ -1
174
+ ],
175
+ [
176
+ "standardResult.instances.0.count",
177
+ ">",
178
+ 0
179
+ ]
180
+ ],
181
+ "rules": [
182
+ "y",
183
+ "hover"
184
+ ],
185
+ "args": {
186
+ "hover": [6]
187
+ }
188
+ },
189
+ {
190
+ "type": "test",
191
+ "which": "testaro",
192
+ "withItems": false,
193
+ "expect": [
194
+ [
195
+ "standardResult.totals.3",
196
+ "<",
197
+ 7
198
+ ],
199
+ [
200
+ "standardResult.totals.2",
201
+ "<",
202
+ 4
203
+ ],
204
+ [
205
+ "standardResult.totals.1",
206
+ "<",
207
+ 13
208
+ ],
209
+ [
210
+ "standardResult.totals.0",
211
+ "<",
212
+ 4
213
+ ]
214
+ ],
215
+ "rules": [
216
+ "y",
217
+ "hover"
218
+ ],
219
+ "args": {
220
+ "hover": [2]
221
+ }
222
+ },
223
+ {
224
+ "type": "url",
225
+ "which": "__targets__/hover/styleBad.html",
226
+ "what": "page with deviant trigger styles"
227
+ },
228
+ {
229
+ "type": "test",
230
+ "which": "testaro",
231
+ "withItems": true,
232
+ "expect": [
233
+ [
234
+ "standardResult.totals.1",
235
+ "=",
236
+ 0
237
+ ],
238
+ [
239
+ "standardResult.totals.2",
240
+ "=",
241
+ 2
242
+ ],
243
+ [
244
+ "standardResult.totals.3",
245
+ "=",
246
+ 1
247
+ ],
248
+ [
249
+ "standardResult.instances.0.ruleID",
250
+ "=",
251
+ "hover"
252
+ ],
253
+ [
254
+ "standardResult.instances.0.what",
255
+ "i",
256
+ "hides"
257
+ ],
258
+ [
259
+ "standardResult.instances.0.tagName",
260
+ "=",
261
+ "LI"
262
+ ],
263
+ [
264
+ "standardResult.instances.0.ordinalSeverity",
265
+ "=",
266
+ 3
267
+ ],
268
+ [
269
+ "standardResult.instances.0.excerpt",
270
+ "i",
271
+ "loses its cursor"
272
+ ],
273
+ [
274
+ "standardResult.instances.1.ruleID",
275
+ "=",
276
+ "hover"
277
+ ],
278
+ [
279
+ "standardResult.instances.1.what",
280
+ "i",
281
+ "cursor nonstandard"
282
+ ],
283
+ [
284
+ "standardResult.instances.1.tagName",
285
+ "=",
286
+ "A"
287
+ ],
288
+ [
289
+ "standardResult.instances.1.id",
290
+ "=",
291
+ "trigger1"
292
+ ],
293
+ [
294
+ "standardResult.instances.1.ordinalSeverity",
295
+ "=",
296
+ 2
297
+ ],
298
+ [
299
+ "standardResult.instances.1.excerpt",
300
+ "i",
301
+ "Trigger 1"
302
+ ]
303
+ ],
304
+ "rules": [
305
+ "y",
306
+ "hover"
307
+ ],
308
+ "args": {
309
+ "hover": [4]
310
+ }
311
+ }
312
+ ],
313
+ "sources": {
314
+ "script": "",
315
+ "host": {},
316
+ "requester": ""
317
+ },
318
+ "creationTime": "2013-05-28T12:00:00",
319
+ "timeStamp": "00000"
320
+ }
@@ -7,7 +7,7 @@
7
7
  {
8
8
  "type": "launch",
9
9
  "which": "chromium",
10
- "what": "usual browser"
10
+ "what": "only compatible browser"
11
11
  },
12
12
  {
13
13
  "type": "url",
@@ -17,7 +17,6 @@
17
17
  {
18
18
  "type": "test",
19
19
  "which": "testaro",
20
- "what": "hover",
21
20
  "withItems": true,
22
21
  "expect": [
23
22
  [
@@ -52,78 +51,132 @@
52
51
  {
53
52
  "type": "test",
54
53
  "which": "testaro",
55
- "what": "hover",
56
54
  "withItems": true,
57
55
  "expect": [
58
56
  [
59
57
  "standardResult.totals.3",
60
- "=",
61
- 4
58
+ ">",
59
+ 0
62
60
  ],
63
61
  [
64
- "standardResult.totals.2",
62
+ "standardResult.instances.0.ruleID",
65
63
  "=",
66
- 1
64
+ "hover"
67
65
  ],
68
66
  [
69
- "standardResult.totals.1",
67
+ "standardResult.instances.length",
70
68
  "=",
71
69
  4
72
70
  ],
73
71
  [
74
- "standardResult.totals.0",
72
+ "standardResult.instances.0.what",
73
+ "i",
74
+ "over the element"
75
+ ],
76
+ [
77
+ "standardResult.instances.0.tagName",
75
78
  "=",
76
- 1
79
+ "A"
77
80
  ],
78
81
  [
79
- "standardResult.instances.0.ruleID",
82
+ "standardResult.instances.0.location.doc",
80
83
  "=",
81
- "hover"
84
+ "dom"
82
85
  ],
83
86
  [
84
- "standardResult.instances.0.what",
87
+ "standardResult.instances.0.location.type",
88
+ "=",
89
+ "box"
90
+ ],
91
+ [
92
+ "standardResult.instances.0.location.spec.height",
93
+ "<",
94
+ "20"
95
+ ],
96
+ [
97
+ "standardResult.instances.0.excerpt",
85
98
  "i",
86
- "unexpected"
99
+ "Trigger 1"
87
100
  ],
88
101
  [
89
- "standardResult.instances.0.ordinalSeverity",
102
+ "standardResult.instances.2.what",
103
+ "i",
104
+ "is not hoverable"
105
+ ],
106
+ [
107
+ "standardResult.instances.2.ordinalSeverity",
90
108
  "=",
91
109
  3
92
110
  ],
93
111
  [
94
- "standardResult.instances.0.tagName",
112
+ "standardResult.instances.2.tagName",
95
113
  "=",
96
- "A"
114
+ "BUTTON"
97
115
  ],
98
116
  [
99
- "standardResult.instances.0.excerpt",
117
+ "standardResult.instances.2.id",
118
+ "=",
119
+ "smallButton"
120
+ ],
121
+ [
122
+ "standardResult.instances.2.location.doc",
123
+ "=",
124
+ "dom"
125
+ ],
126
+ [
127
+ "standardResult.instances.2.location.type",
128
+ "=",
129
+ "selector"
130
+ ],
131
+ [
132
+ "standardResult.instances.2.location.spec",
133
+ "=",
134
+ "#smallButton"
135
+ ],
136
+ [
137
+ "standardResult.instances.2.excerpt",
100
138
  "i",
101
- "Trigger 1"
139
+ "Trigger 3"
102
140
  ],
103
141
  [
104
142
  "standardResult.instances.3.what",
105
143
  "i",
106
- "cannot be hovered"
144
+ "over the element"
107
145
  ],
108
146
  [
109
147
  "standardResult.instances.3.ordinalSeverity",
110
- "=",
111
- 3
148
+ ">",
149
+ -1
112
150
  ],
113
151
  [
114
152
  "standardResult.instances.3.tagName",
115
153
  "=",
116
- "BUTTON"
154
+ "LI"
117
155
  ],
118
156
  [
119
157
  "standardResult.instances.3.id",
120
158
  "=",
121
- "smallButton"
159
+ ""
160
+ ],
161
+ [
162
+ "standardResult.instances.3.location.doc",
163
+ "=",
164
+ "dom"
165
+ ],
166
+ [
167
+ "standardResult.instances.3.location.type",
168
+ "=",
169
+ "box"
170
+ ],
171
+ [
172
+ "standardResult.instances.3.location.spec.x",
173
+ ">",
174
+ 0
122
175
  ],
123
176
  [
124
177
  "standardResult.instances.3.excerpt",
125
178
  "i",
126
- "Trigger 3"
179
+ "item, Trigger 5"
127
180
  ]
128
181
  ],
129
182
  "rules": [
@@ -131,39 +184,23 @@
131
184
  "hover"
132
185
  ],
133
186
  "args": {
134
- "hover": [6]
187
+ "hover": [8]
135
188
  }
136
189
  },
137
190
  {
138
191
  "type": "test",
139
192
  "which": "testaro",
140
- "what": "hover",
141
193
  "withItems": false,
142
194
  "expect": [
143
195
  [
144
196
  "standardResult.totals.3",
145
- "=",
146
- 4
147
- ],
148
- [
149
- "standardResult.totals.2",
150
- "=",
151
- 1
152
- ],
153
- [
154
- "standardResult.totals.1",
155
- "=",
156
- 4
157
- ],
158
- [
159
- "standardResult.totals.0",
160
- "=",
161
- 1
197
+ ">",
198
+ 0
162
199
  ],
163
200
  [
164
201
  "standardResult.instances.length",
165
- "=",
166
- 1
202
+ ">",
203
+ 0
167
204
  ],
168
205
  [
169
206
  "standardResult.instances.0.ruleID",
@@ -173,17 +210,17 @@
173
210
  [
174
211
  "standardResult.instances.0.what",
175
212
  "i",
176
- "behaves"
213
+ "over elements"
177
214
  ],
178
215
  [
179
216
  "standardResult.instances.0.ordinalSeverity",
180
- "=",
181
- 3
217
+ ">",
218
+ -1
182
219
  ],
183
220
  [
184
221
  "standardResult.instances.0.count",
185
- "=",
186
- 10
222
+ ">",
223
+ 0
187
224
  ]
188
225
  ],
189
226
  "rules": [
@@ -191,13 +228,12 @@
191
228
  "hover"
192
229
  ],
193
230
  "args": {
194
- "hover": [6]
231
+ "hover": [8]
195
232
  }
196
233
  },
197
234
  {
198
235
  "type": "test",
199
236
  "which": "testaro",
200
- "what": "hover",
201
237
  "withItems": false,
202
238
  "expect": [
203
239
  [
@@ -228,96 +264,6 @@
228
264
  "args": {
229
265
  "hover": [2]
230
266
  }
231
- },
232
- {
233
- "type": "url",
234
- "which": "__targets__/hover/styleBad.html",
235
- "what": "page with deviant trigger styles"
236
- },
237
- {
238
- "type": "test",
239
- "which": "testaro",
240
- "what": "hover",
241
- "withItems": true,
242
- "expect": [
243
- [
244
- "standardResult.totals.1",
245
- "=",
246
- 0
247
- ],
248
- [
249
- "standardResult.totals.2",
250
- "=",
251
- 2
252
- ],
253
- [
254
- "standardResult.totals.3",
255
- "=",
256
- 1
257
- ],
258
- [
259
- "standardResult.instances.0.ruleID",
260
- "=",
261
- "hover"
262
- ],
263
- [
264
- "standardResult.instances.0.what",
265
- "i",
266
- "hides"
267
- ],
268
- [
269
- "standardResult.instances.0.tagName",
270
- "=",
271
- "LI"
272
- ],
273
- [
274
- "standardResult.instances.0.ordinalSeverity",
275
- "=",
276
- 3
277
- ],
278
- [
279
- "standardResult.instances.0.excerpt",
280
- "i",
281
- "loses its cursor"
282
- ],
283
- [
284
- "standardResult.instances.1.ruleID",
285
- "=",
286
- "hover"
287
- ],
288
- [
289
- "standardResult.instances.1.what",
290
- "i",
291
- "cursor nonstandard"
292
- ],
293
- [
294
- "standardResult.instances.1.tagName",
295
- "=",
296
- "A"
297
- ],
298
- [
299
- "standardResult.instances.1.id",
300
- "=",
301
- "trigger1"
302
- ],
303
- [
304
- "standardResult.instances.1.ordinalSeverity",
305
- "=",
306
- 2
307
- ],
308
- [
309
- "standardResult.instances.1.excerpt",
310
- "i",
311
- "Trigger 1"
312
- ]
313
- ],
314
- "rules": [
315
- "y",
316
- "hover"
317
- ],
318
- "args": {
319
- "hover": [4]
320
- }
321
267
  }
322
268
  ],
323
269
  "sources": {