@public-ui/visual-tests 3.0.0-rc.8 → 3.0.0-rc.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/visual-tests",
3
- "version": "3.0.0-rc.8",
3
+ "version": "3.0.0-rc.9",
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": "3.0.0-rc.8"
32
+ "@public-ui/sample-react": "3.0.0-rc.9"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@babel/eslint-parser": "7.26.10",
@@ -36,21 +36,31 @@ test.use({
36
36
  },
37
37
  });
38
38
 
39
- const blocklist = [];
40
-
41
39
  ROUTES.forEach((options, route) => {
42
- if (blocklist.includes(route)) {
40
+ // Skip unnecessary axe tests
41
+ if (options?.axe?.skip === true) {
43
42
  return;
44
43
  }
45
44
  test(`snapshot for ${route}`, async ({ page }, testInfo) => {
46
45
  const outputPath = rename(testInfo.outputDir);
47
- await page.goto(`/#${route}?hideMenus`, { waitUntil: 'networkidle' });
48
- if (options?.viewportSize) {
49
- await page.setViewportSize(options.viewportSize);
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);
50
59
  }
51
- if (options?.waitForTimeout) {
52
- await page.waitForTimeout(options.waitForTimeout);
60
+ if (options?.snapshot?.waitForTimeout) {
61
+ await page.waitForTimeout(options?.snapshot?.waitForTimeout);
53
62
  }
63
+
54
64
  await injectAxe(page);
55
65
  await checkA11y(
56
66
  page,
@@ -67,7 +77,7 @@ ROUTES.forEach((options, route) => {
67
77
  html: true,
68
78
  },
69
79
  },
70
- options?.axe?.skipFailures ?? true,
80
+ options?.axe?.skipFailures ?? false,
71
81
  'html',
72
82
  {
73
83
  outputDirPath: outputPath.replace(/\/[^/]+$/, ''),