@public-ui/visual-tests 3.0.0-rc.8 → 3.0.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/visual-tests",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.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": "3.0.0
|
|
32
|
+
"@public-ui/sample-react": "3.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/eslint-parser": "7.26.10",
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"format": "prettier --check src",
|
|
49
49
|
"lint": "pnpm lint:eslint",
|
|
50
50
|
"lint:eslint": "eslint src",
|
|
51
|
-
"unused": "knip"
|
|
52
|
-
"postinstall": "pnpm exec playwright install"
|
|
51
|
+
"unused": "knip"
|
|
53
52
|
}
|
|
54
53
|
}
|
|
@@ -36,21 +36,31 @@ test.use({
|
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
const blocklist = [];
|
|
40
|
-
|
|
41
39
|
ROUTES.forEach((options, route) => {
|
|
42
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
|
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 ??
|
|
80
|
+
options?.axe?.skipFailures ?? false,
|
|
71
81
|
'html',
|
|
72
82
|
{
|
|
73
83
|
outputDirPath: outputPath.replace(/\/[^/]+$/, ''),
|