@public-ui/visual-tests 2.2.11-rc.1 → 3.0.0-023e727fba43bcd74fd9f7ce52558eee4a3aa906.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/README.md CHANGED
@@ -48,8 +48,12 @@ Add the following npm scripts to the theme's `package.json`:
48
48
  }
49
49
  ```
50
50
 
51
- - `THEME_MODULE` defines the relative path to the TypeScript module containing the the theme definitions. Without file extension.
52
- - `THEME_EXPERT` defines the name of the export within the the module. (e.g., `export const THEME_NAME = {/**/};`) Defaults to `default`.
51
+ ### Environment variables
52
+
53
+ - `THEME_MODULE`: Define the relative path to the TypeScript module containing the theme definitions. Without file extension.
54
+ - `THEME_EXPERT`: Define the name of the export within the module. (e.g., `export const THEME_NAME = {/**/};`) Defaults to `default`.
55
+ - `KOLIBRI_VISUAL_TESTS_TIMEOUT`: Define the Playwright [test timeout](https://playwright.dev/docs/test-timeouts).
56
+ - `KOLIBRI_VISUAL_TESTS_EXPECT_TIMEOUT`: Define the Playwright [expect timeout](https://playwright.dev/docs/test-timeouts).
53
57
 
54
58
  Run the tests with `npm test`. The first time, this will create a new folder `snapshots` which is supposed to be committed to the repository.
55
59
  In the following runs, new screenshots will be compared to this reference.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/visual-tests",
3
- "version": "2.2.11-rc.1",
3
+ "version": "3.0.0-023e727fba43bcd74fd9f7ce52558eee4a3aa906.0",
4
4
  "license": "EUPL-1.2",
5
5
  "homepage": "https://public-ui.github.io",
6
6
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "axe-playwright": "2.1.0",
30
30
  "portfinder": "1.0.35",
31
31
  "serve": "14.2.4",
32
- "@public-ui/sample-react": "2.2.11-rc.1"
32
+ "@public-ui/sample-react": "3.0.0-023e727fba43bcd74fd9f7ce52558eee4a3aa906.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@babel/eslint-parser": "7.26.10",
@@ -36,31 +36,21 @@ test.use({
36
36
  },
37
37
  });
38
38
 
39
+ const blocklist = [];
40
+
39
41
  ROUTES.forEach((options, route) => {
40
- // Skip unnecessary axe tests
41
- if (options?.axe?.skip === true) {
42
+ if (blocklist.includes(route)) {
42
43
  return;
43
44
  }
44
45
  test(`snapshot for ${route}`, async ({ page }, testInfo) => {
45
46
  const outputPath = rename(testInfo.outputDir);
46
- const hideMenusParam = `${route.includes('?') ? '&' : '?'}hideMenus`;
47
- await page.goto(`/#${route}${hideMenusParam}`);
48
- await page.waitForLoadState('networkidle');
49
- await page.addStyleTag({
50
- content: `
51
- * {
52
- transition: none !important;
53
- animation: none !important;
54
- }
55
- `,
56
- });
57
- if (options?.snapshot?.viewportSize) {
58
- await page.setViewportSize(options?.snapshot?.viewportSize);
47
+ await page.goto(`/#${route}?hideMenus`, { waitUntil: 'networkidle' });
48
+ if (options?.viewportSize) {
49
+ await page.setViewportSize(options.viewportSize);
59
50
  }
60
- if (options?.snapshot?.waitForTimeout) {
61
- await page.waitForTimeout(options?.snapshot?.waitForTimeout);
51
+ if (options?.waitForTimeout) {
52
+ await page.waitForTimeout(options.waitForTimeout);
62
53
  }
63
-
64
54
  await injectAxe(page);
65
55
  await checkA11y(
66
56
  page,
@@ -77,7 +67,7 @@ ROUTES.forEach((options, route) => {
77
67
  html: true,
78
68
  },
79
69
  },
80
- options?.axe?.skipFailures ?? false,
70
+ options?.axe?.skipFailures ?? true,
81
71
  'html',
82
72
  {
83
73
  outputDirPath: outputPath.replace(/\/[^/]+$/, ''),
@@ -3,279 +3,491 @@ export const ROUTES = new Map();
3
3
  /**
4
4
  * Actually we support the following options:
5
5
  *
6
- * Axe options:
7
- * - axe:
8
- * - skip: boolean (Default: false)
9
- * - skipFailures: boolean (Default: false)
6
+ * Details: https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-screenshot-1
7
+ * - fullPage: boolean (Default: true)
8
+ * - maxDiffPixelRatio: number (Default: undefined)
9
+ * - maxDiffPixels: number (Default: undefined)
10
+ * - threshold: number (Default: undefined)
11
+ * - timeout: number (Default: 0)
12
+ *
13
+ * To set the viewport size, use the following options:
14
+ * - viewportSize: { width, height } (Default: 800x600)
10
15
  *
11
- * Snapshot options:
12
- * - snapshot:
13
- * - options:
14
- * - maxDiffPixelRatio: number (Default: 0)
15
- * - skip: boolean (Default: false)
16
- * - viewportSize:
17
- * - width (Default: 800)
18
- * - height (Default: 600)
19
- * - waitForTimeout: number (Default: 15000)
20
- * - zoom:
21
- * - options:
22
- * - maxDiffPixelRatio: number (Default: 0)
23
- * - skip: boolean (Default: false)
24
16
  */
25
17
 
26
- ROUTES.set('abbr/basic');
27
- ROUTES.set('accordion/basic');
28
- ROUTES.set('accordion/headlines');
29
- ROUTES.set('alert/basic');
30
- ROUTES.set('alert/card-msg');
31
- ROUTES.set('alert/html');
32
- ROUTES.set('avatar/basic');
33
- ROUTES.set('badge/basic');
34
- ROUTES.set('badge/button');
35
- ROUTES.set('breadcrumb/basic');
36
- ROUTES.set('button-group/basic');
37
- ROUTES.set('button-link/basic');
38
- ROUTES.set('button-link/icons');
39
- ROUTES.set('button-link/image');
40
- ROUTES.set('button/basic');
41
- ROUTES.set('button/icons');
42
- ROUTES.set('button/width');
43
- ROUTES.set('button/access-key');
44
- ROUTES.set('button/baselined');
45
- ROUTES.set('button/short-key');
46
- ROUTES.set('card/basic');
47
- ROUTES.set('combobox/basic');
48
- ROUTES.set('details/basic');
18
+ ROUTES.set('abbr/basic', {
19
+ axe: {
20
+ skipFailures: false,
21
+ },
22
+ });
23
+ ROUTES.set('accordion/basic', null);
24
+ ROUTES.set('accordion/headlines', {
25
+ axe: {
26
+ skipFailures: false,
27
+ },
28
+ });
29
+ ROUTES.set('alert/basic', {
30
+ axe: {
31
+ skipFailures: false,
32
+ },
33
+ });
34
+ ROUTES.set('alert/card-msg', {
35
+ axe: {
36
+ skipFailures: false,
37
+ },
38
+ });
39
+ ROUTES.set('alert/html', {
40
+ axe: {
41
+ skipFailures: false,
42
+ },
43
+ });
44
+ ROUTES.set('avatar/basic', {
45
+ axe: {
46
+ skipFailures: false,
47
+ },
48
+ });
49
+ ROUTES.set('badge/basic', null);
50
+ ROUTES.set('badge/button', null);
51
+ ROUTES.set('breadcrumb/basic', {
52
+ axe: {
53
+ skipFailures: false,
54
+ },
55
+ });
56
+ ROUTES.set('button-link/basic', {
57
+ axe: {
58
+ skipFailures: false,
59
+ },
60
+ });
61
+ ROUTES.set('button-link/icons', {
62
+ axe: {
63
+ skipFailures: false,
64
+ },
65
+ });
66
+ ROUTES.set('button-link/image', {
67
+ axe: {
68
+ skipFailures: false,
69
+ },
70
+ });
71
+ ROUTES.set('button/basic', {
72
+ axe: {
73
+ skipFailures: false,
74
+ },
75
+ });
76
+ ROUTES.set('button/icons', {
77
+ axe: {
78
+ skipFailures: false,
79
+ },
80
+ });
81
+ ROUTES.set('button/width', {
82
+ axe: {
83
+ skipFailures: false,
84
+ },
85
+ });
86
+ ROUTES.set('button/access-key', {
87
+ axe: {
88
+ skipFailures: false,
89
+ },
90
+ });
91
+ ROUTES.set('button/baselined', {
92
+ axe: {
93
+ skipFailures: false,
94
+ },
95
+ });
96
+ ROUTES.set('button/short-key', {
97
+ axe: {
98
+ skipFailures: false,
99
+ },
100
+ });
101
+ ROUTES.set('card/basic', {
102
+ axe: {
103
+ skipFailures: false,
104
+ },
105
+ });
106
+ ROUTES.set('combobox/basic?noColumns', {
107
+ axe: {
108
+ skipFailures: false,
109
+ },
110
+ });
111
+ ROUTES.set('details/basic', {
112
+ axe: {
113
+ skipFailures: false,
114
+ },
115
+ });
49
116
  ROUTES.set('drawer/basic?align=left', {
50
- snapshot: {
51
- viewportSize: {
52
- width: 1920,
53
- height: 600,
54
- },
117
+ viewportSize: {
118
+ width: 1920,
119
+ height: 600,
55
120
  },
56
121
  });
57
122
  ROUTES.set('drawer/basic?align=top', {
58
- snapshot: {
59
- viewportSize: {
60
- width: 800,
61
- height: 600,
62
- },
123
+ viewportSize: {
124
+ width: 800,
125
+ height: 600,
63
126
  },
64
127
  });
65
128
  ROUTES.set('drawer/basic?align=right', {
66
- snapshot: {
67
- viewportSize: {
68
- width: 1920,
69
- height: 600,
70
- },
129
+ viewportSize: {
130
+ width: 1920,
131
+ height: 600,
71
132
  },
72
133
  });
73
134
  ROUTES.set('drawer/basic?align=bottom', {
74
- snapshot: {
75
- viewportSize: {
76
- width: 800,
77
- height: 600,
78
- },
79
- },
80
- });
81
- ROUTES.set('form/basic');
82
- ROUTES.set('form/error-list');
83
- ROUTES.set('heading/badge');
84
- ROUTES.set('heading/basic');
85
- ROUTES.set('heading/paragraph');
86
- ROUTES.set('icon/basic');
87
- ROUTES.set('image/basic');
88
- ROUTES.set('indented-text/basic');
89
- ROUTES.set('input-checkbox/basic');
90
- ROUTES.set('input-checkbox/button');
91
- ROUTES.set('input-checkbox/switch');
92
- ROUTES.set('input-color/basic');
93
- ROUTES.set('input-date/basic');
94
- ROUTES.set('input-email/basic');
95
- ROUTES.set('input-file/basic');
96
- ROUTES.set('input-number/basic');
97
- ROUTES.set('input-password/basic');
98
- ROUTES.set('input-password/show-password');
99
- ROUTES.set('input-radio/basic');
100
- ROUTES.set('input-radio/horizontal');
101
- ROUTES.set('input-radio/object');
102
- ROUTES.set('input-range/basic');
103
- ROUTES.set('input-text/basic', {
104
- axe: {
105
- skipFailures: true,
106
- },
107
- });
108
- ROUTES.set('input-text/focus');
109
- ROUTES.set('kolibri/basic');
110
- ROUTES.set('link-button/basic');
111
- ROUTES.set('link-group/basic');
112
- ROUTES.set('link-group/horizontal');
113
- ROUTES.set('link/basic');
114
- ROUTES.set('link/icons');
115
- ROUTES.set('link/image');
116
- ROUTES.set('link/target');
117
- ROUTES.set('modal/basic');
135
+ viewportSize: {
136
+ width: 800,
137
+ height: 600,
138
+ },
139
+ });
140
+ ROUTES.set('form/basic', {
141
+ axe: {
142
+ skipFailures: false,
143
+ },
144
+ });
145
+ ROUTES.set('form/error-list', {
146
+ axe: {
147
+ skipFailures: false,
148
+ },
149
+ });
150
+ ROUTES.set('heading/badge', {
151
+ axe: {
152
+ skipFailures: false,
153
+ },
154
+ });
155
+ ROUTES.set('heading/basic', {
156
+ axe: {
157
+ skipFailures: false,
158
+ },
159
+ });
160
+ ROUTES.set('heading/paragraph', {
161
+ axe: {
162
+ skipFailures: false,
163
+ },
164
+ });
165
+ ROUTES.set('icon/basic', {
166
+ axe: {
167
+ skipFailures: false,
168
+ },
169
+ });
170
+ ROUTES.set('image/basic', {
171
+ axe: {
172
+ skipFailures: false,
173
+ },
174
+ });
175
+ ROUTES.set('input-checkbox/basic?noColumns', null);
176
+ ROUTES.set('input-checkbox/button?noColumns', null);
177
+ ROUTES.set('input-checkbox/switch?noColumns', null);
178
+ ROUTES.set('input-color/basic?noColumns', null);
179
+ ROUTES.set('input-date/basic?noColumns', null);
180
+ ROUTES.set('input-email/basic?noColumns', null);
181
+ ROUTES.set('input-file/basic?noColumns', null);
182
+ ROUTES.set('input-number/basic?noColumns', null);
183
+ ROUTES.set('input-password/basic?noColumns', null);
184
+ ROUTES.set('input-password/show-password?noColumns', null);
185
+ ROUTES.set('input-radio/basic?noColumns', null);
186
+ ROUTES.set('input-radio/horizontal?noColumns', null);
187
+ ROUTES.set('input-radio/object?noColumns', null);
188
+ ROUTES.set('input-range/basic?noColumns', null);
189
+ ROUTES.set('input-text/basic?noColumns', null);
190
+ ROUTES.set('kolibri/basic', {
191
+ axe: {
192
+ skipFailures: false,
193
+ },
194
+ });
195
+ ROUTES.set('link-button/basic', {
196
+ axe: {
197
+ skipFailures: false,
198
+ },
199
+ });
200
+ ROUTES.set('link/basic', {
201
+ axe: {
202
+ skipFailures: false,
203
+ },
204
+ });
205
+ ROUTES.set('link/icons', {
206
+ axe: {
207
+ skipFailures: false,
208
+ },
209
+ });
210
+ ROUTES.set('link/image', {
211
+ axe: {
212
+ skipFailures: false,
213
+ },
214
+ });
215
+ ROUTES.set('link/target', {
216
+ axe: {
217
+ skipFailures: false,
218
+ },
219
+ });
220
+ ROUTES.set('modal/basic', {
221
+ axe: {
222
+ skipFailures: false,
223
+ },
224
+ });
118
225
  ROUTES.set('modal/basic?show-modal=true', {
119
- snapshot: {
120
- viewportSize: {
121
- width: 1920,
122
- height: 600,
123
- },
226
+ viewportSize: {
227
+ width: 1920,
228
+ height: 600,
229
+ },
230
+ });
231
+ ROUTES.set('modal/basic?show-modal=true&variant=card', {
232
+ viewportSize: {
233
+ width: 1920,
234
+ height: 600,
235
+ },
236
+ });
237
+ ROUTES.set('nav/aria-current', {
238
+ axe: {
239
+ skipFailures: false,
240
+ },
241
+ });
242
+ ROUTES.set('nav/basic', null);
243
+ ROUTES.set('nav/horizontal', {
244
+ axe: {
245
+ skipFailures: false,
246
+ },
247
+ });
248
+ ROUTES.set('pagination/basic', {
249
+ axe: {
250
+ skipFailures: false,
251
+ },
252
+ });
253
+ ROUTES.set('progress/basic', {
254
+ axe: {
255
+ skipFailures: false,
256
+ },
257
+ });
258
+ ROUTES.set('quote/basic', {
259
+ axe: {
260
+ skipFailures: false,
261
+ },
262
+ });
263
+ ROUTES.set('quote/block', {
264
+ axe: {
265
+ skipFailures: false,
266
+ },
267
+ });
268
+ ROUTES.set('select/basic?noColumns', null);
269
+ ROUTES.set('skip-nav/basic', {
270
+ axe: {
271
+ skipFailures: false,
272
+ },
273
+ });
274
+ ROUTES.set('spin/basic', {
275
+ axe: {
276
+ skipFailures: false,
277
+ },
278
+ });
279
+ ROUTES.set('single-select/basic?noColumns', {
280
+ axe: {
281
+ skipFailures: false,
282
+ },
283
+ });
284
+ ROUTES.set('spin/custom', {
285
+ axe: {
286
+ skipFailures: false,
287
+ },
288
+ });
289
+ ROUTES.set('spin/cycle', {
290
+ axe: {
291
+ skipFailures: false,
292
+ },
293
+ });
294
+ ROUTES.set('split-button/basic', {
295
+ axe: {
296
+ skipFailures: false,
297
+ },
298
+ });
299
+ ROUTES.set('table/column-alignment', {
300
+ axe: {
301
+ skipFailures: false,
302
+ },
303
+ });
304
+ ROUTES.set('table/sort-data', {
305
+ axe: {
306
+ skipFailures: false,
307
+ },
308
+ });
309
+ ROUTES.set('table/with-footer', {
310
+ axe: {
311
+ skipFailures: false,
312
+ },
313
+ });
314
+ ROUTES.set('table/with-pagination', {
315
+ axe: {
316
+ skipFailures: false,
317
+ },
318
+ });
319
+ ROUTES.set('table/pagination-position', {
320
+ axe: {
321
+ skipFailures: false,
322
+ },
323
+ });
324
+ ROUTES.set('table/complex-headers', {
325
+ axe: {
326
+ skipFailures: false,
327
+ },
328
+ });
329
+ ROUTES.set('table/stateful-with-selection', {
330
+ axe: {
331
+ skipFailures: false,
332
+ },
333
+ });
334
+ ROUTES.set('table/stateful-with-single-selection', {
335
+ axe: {
336
+ skipFailures: false,
337
+ },
338
+ });
339
+ ROUTES.set('table/stateless-with-single-selection', {
340
+ axe: {
341
+ skipFailures: false,
342
+ },
343
+ });
344
+ ROUTES.set('table/stateless-with-selection', {
345
+ axe: {
346
+ skipFailures: false,
347
+ },
348
+ });
349
+ ROUTES.set('table/stateless', {
350
+ axe: {
351
+ skipFailures: false,
352
+ },
353
+ });
354
+ ROUTES.set('tabs/basic', {
355
+ axe: {
356
+ skipFailures: false,
357
+ },
358
+ });
359
+ ROUTES.set('tabs/icons-only', {
360
+ axe: {
361
+ skipFailures: false,
362
+ },
363
+ });
364
+ ROUTES.set('textarea/adjust-height', {
365
+ axe: {
366
+ skipFailures: false,
367
+ },
368
+ });
369
+ ROUTES.set('textarea/basic?noColumns', null);
370
+ ROUTES.set('textarea/resize', {
371
+ axe: {
372
+ skipFailures: false,
373
+ },
374
+ });
375
+ ROUTES.set('textarea/rows', {
376
+ axe: {
377
+ skipFailures: false,
378
+ },
379
+ });
380
+ ROUTES.set('textarea/with-counter', {
381
+ axe: {
382
+ skipFailures: false,
383
+ },
384
+ });
385
+ ROUTES.set('toast/basic', {
386
+ axe: {
387
+ skipFailures: false,
124
388
  },
125
389
  });
126
-
127
- ROUTES.set('nav/aria-current');
128
- ROUTES.set('nav/basic');
129
- ROUTES.set('nav/horizontal');
130
- ROUTES.set('pagination/basic');
131
- ROUTES.set('progress/basic');
132
- ROUTES.set('quote/basic');
133
- ROUTES.set('quote/block');
134
- ROUTES.set('select/basic');
135
- ROUTES.set('skip-nav/basic');
136
- ROUTES.set('spin/basic');
137
- ROUTES.set('single-select/basic', {
138
- axe: {
139
- skipFailures: true,
140
- },
141
- });
142
- ROUTES.set('spin/custom');
143
- ROUTES.set('spin/cycle');
144
- ROUTES.set('split-button/basic');
145
- ROUTES.set('table/column-alignment');
146
- ROUTES.set('table/sort-data');
147
- ROUTES.set('table/with-footer');
148
- ROUTES.set('table/with-pagination');
149
- ROUTES.set('table/pagination-position');
150
- ROUTES.set('table/complex-headers');
151
- ROUTES.set('table/stateful-with-selection');
152
- ROUTES.set('table/stateful-with-single-selection');
153
- ROUTES.set('table/stateless-with-single-selection');
154
- ROUTES.set('table/stateless-with-selection');
155
- ROUTES.set('table/stateless');
156
- ROUTES.set('tabs/basic');
157
- ROUTES.set('tabs/icons-only');
158
- ROUTES.set('textarea/adjust-height');
159
- ROUTES.set('textarea/basic');
160
- ROUTES.set('textarea/resize');
161
- ROUTES.set('textarea/rows');
162
- ROUTES.set('textarea/with-counter');
163
- ROUTES.set('toast/basic');
164
390
  ROUTES.set('toast/basic?type=info', {
165
- snapshot: {
166
- viewportSize: {
167
- width: 1920,
168
- height: 600,
169
- },
391
+ viewportSize: {
392
+ width: 1920,
393
+ height: 600,
170
394
  },
171
395
  });
172
396
  ROUTES.set('toast/basic?type=success', {
173
- snapshot: {
174
- viewportSize: {
175
- width: 1920,
176
- height: 600,
177
- },
397
+ viewportSize: {
398
+ width: 1920,
399
+ height: 600,
178
400
  },
179
401
  });
180
402
  ROUTES.set('toast/basic?type=warning', {
181
- snapshot: {
182
- viewportSize: {
183
- width: 1920,
184
- height: 600,
185
- },
403
+ viewportSize: {
404
+ width: 1920,
405
+ height: 600,
186
406
  },
187
407
  });
188
408
  ROUTES.set('toast/basic?type=error', {
189
- snapshot: {
190
- viewportSize: {
191
- width: 1920,
192
- height: 600,
193
- },
409
+ viewportSize: {
410
+ width: 1920,
411
+ height: 600,
194
412
  },
195
413
  });
196
414
  ROUTES.set('toast/basic?variant=msg', {
197
- snapshot: {
198
- viewportSize: {
199
- width: 1920,
200
- height: 600,
201
- },
415
+ viewportSize: {
416
+ width: 1920,
417
+ height: 600,
202
418
  },
203
419
  });
204
420
  ROUTES.set('toast/basic?variant=card', {
205
- snapshot: {
206
- viewportSize: {
207
- width: 1920,
208
- height: 600,
209
- },
421
+ viewportSize: {
422
+ width: 1920,
423
+ height: 600,
210
424
  },
211
425
  });
212
426
 
213
427
  ROUTES.set('toast/basic?type=default&variant=msg', {
214
- snapshot: {
215
- viewportSize: {
216
- width: 1920,
217
- height: 600,
218
- },
428
+ viewportSize: {
429
+ width: 1920,
430
+ height: 600,
219
431
  },
220
432
  });
221
433
  ROUTES.set('toast/basic?type=info&variant=msg', {
222
- snapshot: {
223
- viewportSize: {
224
- width: 1920,
225
- height: 600,
226
- },
434
+ viewportSize: {
435
+ width: 1920,
436
+ height: 600,
227
437
  },
228
438
  });
229
439
  ROUTES.set('toast/basic?type=success&variant=msg', {
230
- snapshot: {
231
- viewportSize: {
232
- width: 1920,
233
- height: 600,
234
- },
440
+ viewportSize: {
441
+ width: 1920,
442
+ height: 600,
235
443
  },
236
444
  });
237
445
  ROUTES.set('toast/basic?type=warning&variant=msg', {
238
- snapshot: {
239
- viewportSize: {
240
- width: 1920,
241
- height: 600,
242
- },
446
+ viewportSize: {
447
+ width: 1920,
448
+ height: 600,
243
449
  },
244
450
  });
245
451
  ROUTES.set('toast/basic?type=error&variant=msg', {
246
- snapshot: {
247
- viewportSize: {
248
- width: 1920,
249
- height: 600,
250
- },
452
+ viewportSize: {
453
+ width: 1920,
454
+ height: 600,
251
455
  },
252
456
  });
253
457
 
254
- ROUTES.set('toolbar/basic');
255
- ROUTES.set('toolbar/disabled');
458
+ ROUTES.set('toolbar/basic', {
459
+ axe: {
460
+ skipFailures: false,
461
+ },
462
+ });
463
+ ROUTES.set('toolbar/disabled', {
464
+ axe: {
465
+ skipFailures: false,
466
+ },
467
+ });
256
468
  ROUTES.set('tree/basic/home', {
257
469
  axe: {
258
- skipFailures: true,
470
+ skipFailures: false,
259
471
  },
260
472
  });
261
- ROUTES.set('version/basic');
262
- ROUTES.set('version/context');
263
- ROUTES.set('scenarios/appointment-form');
264
- ROUTES.set('scenarios/static-form', {
473
+ ROUTES.set('version/basic', {
265
474
  axe: {
266
- skipFailures: true,
475
+ skipFailures: false,
267
476
  },
268
477
  });
269
- ROUTES.set('scenarios/disabled-interactive-scenario');
270
- ROUTES.set('scenarios/same-height-of-all-interactive-elements', {
478
+ ROUTES.set('version/context', {
271
479
  axe: {
272
- skipFailures: true,
480
+ skipFailures: false,
273
481
  },
274
- snapshot: {
275
- viewportSize: {
276
- width: 4000,
277
- height: 0,
278
- },
482
+ });
483
+ ROUTES.set('scenarios/static-form', {
484
+ axe: {
485
+ skipFailures: false,
486
+ },
487
+ });
488
+ ROUTES.set('scenarios/disabled-interactive-scenario', {
489
+ axe: {
490
+ skipFailures: false,
279
491
  },
280
492
  });
281
493
 
@@ -300,9 +512,5 @@ ROUTES.set('scenarios/focus-elements?component=link');
300
512
  ROUTES.set('scenarios/focus-elements?component=linkButton');
301
513
  ROUTES.set('scenarios/focus-elements?component=select');
302
514
  ROUTES.set('scenarios/focus-elements?component=selectMultiple');
303
- ROUTES.set('scenarios/focus-elements?component=singleSelect', {
304
- axe: {
305
- skipFailures: true,
306
- },
307
- });
515
+ ROUTES.set('scenarios/focus-elements?component=singleSelect');
308
516
  ROUTES.set('scenarios/focus-elements?component=textarea');
@@ -18,13 +18,10 @@ const DEFAULT_SNAPSHOT_OPTIONS = {
18
18
  fullPage: true,
19
19
  maxDiffPixelRatio: 0,
20
20
  scale: 'css', // 'css' or 'device'
21
+ timeout: 10000,
21
22
  };
22
23
 
23
24
  ROUTES.forEach((options, route) => {
24
- // Skip unnecessary snapshot tests
25
- if (options?.snapshot?.skip === true && options?.snapshot?.zoom?.skip === true) {
26
- return;
27
- }
28
25
  test(`snapshot for ${route}`, async ({ page }) => {
29
26
  const hideMenusParam = `${route.includes('?') ? '&' : '?'}hideMenus`;
30
27
  await page.goto(`/#${route}${hideMenusParam}`);
@@ -37,11 +34,11 @@ ROUTES.forEach((options, route) => {
37
34
  }
38
35
  `,
39
36
  });
40
- if (options?.snapshot?.viewportSize) {
41
- await page.setViewportSize(options?.snapshot?.viewportSize);
37
+ if (options?.viewportSize) {
38
+ await page.setViewportSize(options.viewportSize);
42
39
  }
43
- if (options?.snapshot?.waitForTimeout) {
44
- await page.waitForTimeout(options?.snapshot?.waitForTimeout);
40
+ if (options?.waitForTimeout) {
41
+ await page.waitForTimeout(options.waitForTimeout);
45
42
  }
46
43
 
47
44
  /**
@@ -49,29 +46,20 @@ ROUTES.forEach((options, route) => {
49
46
  */
50
47
  const snapshotName = `snapshot-for-${route.replace(/(\/|\?|&|=)/g, '-')}`;
51
48
 
52
- const SNAPSHOT_OPTIONS = {
49
+ await expect(page).toHaveScreenshot(`${snapshotName}.png`, {
53
50
  ...DEFAULT_SNAPSHOT_OPTIONS,
54
- ...options?.snapshot?.options,
55
- };
56
-
57
- // Skip unnecessary normal tests
58
- if (options?.snapshot?.skip !== true) {
59
- await expect(page).toHaveScreenshot(`${snapshotName}.png`, SNAPSHOT_OPTIONS);
60
- }
61
-
62
- // Skip unnecessary zoom tests
63
- if (options?.snapshot?.zoom?.skip !== true) {
64
- await page.evaluate(() => {
65
- // eslint-disable-next-line no-undef
66
- document.body.style.zoom = '400%';
67
- // document.body.style.transform = 'scale(4)';
68
- // document.body.style.transformOrigin = 'top left';
69
- // document.body.style.width = '25vw';
70
- });
71
- await expect(page).toHaveScreenshot(`${snapshotName}-zoom.png`, {
72
- ...SNAPSHOT_OPTIONS,
73
- ...options?.snapshot?.zoom?.options,
74
- });
75
- }
51
+ ...options,
52
+ });
53
+ await page.evaluate(() => {
54
+ // eslint-disable-next-line no-undef
55
+ document.body.style.zoom = '400%';
56
+ // document.body.style.transform = 'scale(4)';
57
+ // document.body.style.transformOrigin = 'top left';
58
+ // document.body.style.width = '25vw';
59
+ });
60
+ await expect(page).toHaveScreenshot(`${snapshotName}-zoom.png`, {
61
+ ...DEFAULT_SNAPSHOT_OPTIONS,
62
+ ...options,
63
+ });
76
64
  });
77
65
  });