Skip to content

Commit

Permalink
fix: install correct browser versions for playwright tests (#298)
Browse files Browse the repository at this point in the history
by running pnpm exec playwright install from the playwright dir, pnpm
knows to use the version of playwright that we depend on rather than the
latest version.

without this change we end up installing the latest browesers and then
the tests fail as they can't find the older versions that they assume
will have been installed.

...and it turns out `pnpx` is deprecated, and we should be using `pnpm
exec` anyway.

fixes: #297

see: https://pnpm.io/6.x/cli/exec

License: MIT
Signed-off-by: Oli Evans <[email protected]>
  • Loading branch information
olizilla authored Jan 27, 2023
1 parent b02f6e0 commit 32c61fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- run: pnpm build:examples
- run: pnpx playwright install --with-deps # install browsers
- run: pnpm playwright:install --with-deps # install browsers
- run: pnpm test:examples

# save test report
Expand Down
2 changes: 1 addition & 1 deletion examples/test/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install the deps and the browsers from the root of the monorepo
$ pnpm i

# fetch test browsers
$ pnpx playwright install
$ pnpm playwright:install
```

Build the examples to their many dist folders
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"typecheck": "tsc -b",
"test:examples": "pnpm run --filter './examples/**' test",
"build:examples": "pnpm run --filter './examples/**' --no-bail build || true",
"serve:examples": "serve examples"
"serve:examples": "serve examples",
"playwright:install": "pnpm --filter './examples/test/playwright' exec playwright install"
},
"devDependencies": {
"@babel/core": "^7.20.12",
Expand Down

0 comments on commit 32c61fa

Please sign in to comment.