@public-ui/visual-tests 1.7.0-rc.10 → 1.7.0-rc.11

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
@@ -36,6 +36,12 @@ In the following runs, new screenshots will be compared to this reference.
36
36
 
37
37
  To update the reference screenshots call `npm run test-update`.
38
38
 
39
+ It's recommended to add the `test-results` folder to the `.gitignore` file:
40
+
41
+ ```bash
42
+ /test-results/
43
+ ```
44
+
39
45
  It's also recommended to automatically run the tests before packing/publishing the module:
40
46
 
41
47
  ```json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/visual-tests",
3
- "version": "1.7.0-rc.10",
3
+ "version": "1.7.0-rc.11",
4
4
  "license": "EUPL-1.2",
5
5
  "homepage": "https://public-ui.github.io",
6
6
  "repository": "https://github.com/public-ui/kolibri",
@@ -25,8 +25,8 @@
25
25
  "kolibri-visual-test": "src/index.js"
26
26
  },
27
27
  "dependencies": {
28
- "@playwright/test": "1.37.1",
29
- "@public-ui/sample-react": "1.7.0-rc.10",
28
+ "@playwright/test": "1.38.0",
29
+ "@public-ui/sample-react": "1.7.0-rc.11",
30
30
  "http-server": "14.1.1",
31
31
  "portfinder": "1.0.32"
32
32
  },
@@ -35,7 +35,7 @@
35
35
  "depcheck": "1.4.6",
36
36
  "eslint": "8.49.0",
37
37
  "eslint-plugin-no-loops": "0.3.0",
38
- "knip": "2.24.0",
38
+ "knip": "2.24.1",
39
39
  "prettier": "3.0.3"
40
40
  },
41
41
  "files": [
@@ -20,7 +20,7 @@ export default defineConfig({
20
20
  /* Fail the build on CI if you accidentally left test.only in the source code. */
21
21
  forbidOnly: !!process.env.CI,
22
22
  /* Retry on CI only */
23
- retries: 0, // process.env.CI ? 2 : 0,
23
+ retries: process.env.CI ? 2 : 0,
24
24
  /* Opt out of parallel tests on CI. */
25
25
  workers: process.env.CI ? 1 : undefined,
26
26
  /* Reporter to use. See https://playwright.dev/docs/test-reporters */
@@ -20,7 +20,11 @@ export const configureSnapshotPath =
20
20
  .replace('-windows', '')
21
21
 
22
22
  // Remove test counter from snapshot name
23
- .replace('-1-', '-');
23
+ .replace('-1-', '-')
24
+
25
+ // Make different snapshot folder for different themes
26
+ .replace('theme-snapshots.spec.js', `theme-${process.env.THEME_EXPORT.toLocaleLowerCase()}`)
27
+ .replace('-snapshots', '');
24
28
  return result;
25
29
  };
26
30
  };
@@ -39,9 +43,10 @@ ROUTES.filter((route) => !blocklist.includes(route)).forEach((route) => {
39
43
  width: 1920,
40
44
  height: 1280,
41
45
  });
46
+ // await page.waitForTimeout(250);
42
47
  await expect(page).toHaveScreenshot({
43
48
  // fullPage: true,
44
- maxDiffPixelRatio: 0.03,
49
+ maxDiffPixelRatio: 0.1, // 0.03,
45
50
  });
46
51
  });
47
52
  });