@public-ui/visual-tests 2.2.11 → 2.2.12

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",
3
+ "version": "2.2.12",
4
4
  "license": "EUPL-1.2",
5
5
  "homepage": "https://public-ui.github.io",
6
6
  "repository": {
@@ -25,18 +25,18 @@
25
25
  "kolibri-visual-test": "src/index.js"
26
26
  },
27
27
  "dependencies": {
28
- "@playwright/test": "1.52.0",
28
+ "@playwright/test": "1.53.0",
29
29
  "axe-playwright": "2.1.0",
30
30
  "portfinder": "1.0.37",
31
31
  "serve": "14.2.4",
32
- "@public-ui/sample-react": "2.2.11"
32
+ "@public-ui/sample-react": "2.2.12"
33
33
  },
34
34
  "devDependencies": {
35
- "@babel/eslint-parser": "7.27.1",
35
+ "@babel/eslint-parser": "7.27.5",
36
36
  "@babel/plugin-syntax-import-attributes": "7.27.1",
37
37
  "@babel/preset-env": "7.27.2",
38
38
  "eslint": "8.57.1",
39
- "knip": "5.56.0",
39
+ "knip": "5.61.0",
40
40
  "prettier": "3.5.3"
41
41
  },
42
42
  "files": [
@@ -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
  }
@@ -38,7 +38,7 @@ test.use({
38
38
 
39
39
  ROUTES.forEach((options, route) => {
40
40
  // Skip unnecessary axe tests
41
- if (options?.axe?.skip === true) {
41
+ if (options?.axe?.skip === true || process.argv.includes('--update-snapshots')) {
42
42
  return;
43
43
  }
44
44
  test(`snapshot for ${route}`, async ({ page }, testInfo) => {
@@ -82,7 +82,7 @@ ROUTES.forEach((options, route) => {
82
82
  {
83
83
  outputDirPath: outputPath.replace(/\/[^/]+$/, ''),
84
84
  outputDir: `axe-${themeName}`,
85
- reportFileName: `${route.replace('/', '-')}.html`,
85
+ reportFileName: `${route.replace(/[/?]/g, '-')}.html`,
86
86
  },
87
87
  );
88
88
  });
@@ -89,11 +89,6 @@ ROUTES.set('breadcrumb/basic', {
89
89
  skip: true,
90
90
  },
91
91
  });
92
- ROUTES.set('button-group/basic', {
93
- snapshot: {
94
- skip: true,
95
- },
96
- });
97
92
  ROUTES.set('button-link/basic', {
98
93
  snapshot: {
99
94
  skip: true,
@@ -256,6 +251,7 @@ ROUTES.set('heading/basic', {
256
251
  },
257
252
  },
258
253
  });
254
+ ROUTES.set('heading/secondary');
259
255
  ROUTES.set('heading/paragraph', {
260
256
  snapshot: {
261
257
  skip: true,
@@ -281,7 +277,7 @@ ROUTES.set('image/basic', {
281
277
  zoom: {
282
278
  skip: true,
283
279
  },
284
- },
280
+ },
285
281
  });
286
282
  ROUTES.set('indented-text/basic', {
287
283
  snapshot: {
@@ -471,9 +467,6 @@ ROUTES.set('input-text/basic', {
471
467
  },
472
468
  });
473
469
  ROUTES.set('input-text/focus', {
474
-
475
- });
476
- ROUTES.set('kolibri/basic', {
477
470
  snapshot: {
478
471
  skip: true,
479
472
  zoom: {
@@ -481,17 +474,15 @@ ROUTES.set('kolibri/basic', {
481
474
  },
482
475
  },
483
476
  });
484
- ROUTES.set('link-button/basic', {
477
+ ROUTES.set('kolibri/basic', {
485
478
  snapshot: {
486
479
  skip: true,
480
+ zoom: {
481
+ skip: true,
482
+ },
487
483
  },
488
484
  });
489
- ROUTES.set('link-group/basic', {
490
- snapshot: {
491
- skip: true,
492
- },
493
- });
494
- ROUTES.set('link-group/horizontal', {
485
+ ROUTES.set('link-button/basic', {
495
486
  snapshot: {
496
487
  skip: true,
497
488
  },
@@ -946,7 +937,7 @@ ROUTES.set('toast/basic?type=error&variant=msg', {
946
937
  ROUTES.set('toolbar/basic', {
947
938
  snapshot: {
948
939
  viewportSize: {
949
- width: 300,
940
+ width: 600,
950
941
  height: 100,
951
942
  },
952
943
  zoom: {
@@ -982,7 +973,7 @@ ROUTES.set('tree/basic/home', {
982
973
  ROUTES.set('version/basic', {
983
974
  snapshot: {
984
975
  viewportSize: {
985
- width: 100,
976
+ width: 150,
986
977
  height: 100,
987
978
  },
988
979
  zoom: {
@@ -18,6 +18,7 @@ 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) => {