New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Playwright 'failed to launch browsers' error #959
Conversation
package.json
Outdated
@@ -16,7 +16,7 @@ | |||
"storybook": "start-storybook --static-dir ./public -p 6006", | |||
"test": "npm-run-all format:check lint test:jest test:playwright", | |||
"test:jest": "jest tests src --no-cache", | |||
"test:playwright": "npx playwright test", | |||
"test:playwright": "npx playwright install && npx playwright test", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem quite correct to me, you shouldn't need to install playwritght to run the tests. It sounds like there's a mismatch between the playwright version we have installed and the docker image defined here.
It looks like playwright recommends that you keep the version of the docker container in sync with the version of the library you have installed:
microsoft/playwright#10410 (comment)
However, I honestly don't know how to keep the docker container definition in sync with what's in our package.json offhand, since dependabot doesn't send updates for the former.
I'd suggest we do two things here:
- Add the
npx playwright install
step to the circleci configuration above. - Add a small note to the README.md about
npx playwright install
andnpx playwright test
(maybe just below our notes about storybook)
a2940d5
to
cce5a76
Compare
```bash | ||
npx playwright install | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding this step because it's mentioned as part of installation in Playwright docs: https://playwright.dev/docs/intro#installation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thank you @Iinh!
The Playwright CI test failed in my last PR: https://app.circleci.com/pipelines/github/mozilla/glean-dictionary/2768/workflows/727abea5-be8a-46af-b145-63f799b235de/jobs/5342
I updated the script to install Playwright per the recommendation in the error message.
Pull Request checklist
fixes, if applicable)