Skip to content

Commit

Permalink
Introduce new environment variable KOLIBRI_VISUAL_TESTS_EXPECT_TIMEOUT (
Browse files Browse the repository at this point in the history
  • Loading branch information
laske185 authored Jan 17, 2025
2 parents 6d32161 + 7138e4c commit 65a16a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/tools/visual-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ Add the following npm scripts to the theme's `package.json`:
}
```

- `THEME_MODULE` defines the relative path to the TypeScript module containing the the theme definitions. Without file extension.
- `THEME_EXPERT` defines the name of the export within the the module. (e.g., `export const THEME_NAME = {/**/};`) Defaults to `default`.
### Environment variables

- `THEME_MODULE`: Define the relative path to the TypeScript module containing the theme definitions. Without file extension.
- `THEME_EXPERT`: Define the name of the export within the module. (e.g., `export const THEME_NAME = {/**/};`) Defaults to `default`.
- `KOLIBRI_VISUAL_TESTS_TIMEOUT`: Define the Playwright [test timeout](https://playwright.dev/docs/test-timeouts).
- `KOLIBRI_VISUAL_TESTS_EXPECT_TIMEOUT`: Define the Playwright [expect timeout](https://playwright.dev/docs/test-timeouts).

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.
In the following runs, new screenshots will be compared to this reference.
Expand Down
4 changes: 4 additions & 0 deletions packages/tools/visual-tests/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export default defineConfig({
trace: 'on-first-retry',
},

expect: {
timeout: process.env.KOLIBRI_VISUAL_TESTS_EXPECT_TIMEOUT ? Number(process.env.KOLIBRI_VISUAL_TESTS_EXPECT_TIMEOUT) : undefined,
},

/* Configure projects for major browsers */
projects: [
// {
Expand Down

0 comments on commit 65a16a0

Please sign in to comment.