Skip to content
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

How to specify Chromium path #426

Open
alexbjorlig opened this issue Jan 22, 2024 · 5 comments
Open

How to specify Chromium path #426

alexbjorlig opened this issue Jan 22, 2024 · 5 comments

Comments

@alexbjorlig
Copy link

How can I specify a chromium path when running test-storybook in CI on Github actions?
It works locally 🙃

Describe the bug
When I try to run my tests in Github Action CI with test-storybook I get this error:

Test Suites: 0 of 6 total
Tests:       0 total
Snapshots:   0 total
Time:        0.449 s
Ran all test suites.
Error: Executable doesn't exist at /home/runner/.cache/ms-playwright/chromium-1091/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝ Failed to launch browser.
    at executablePathOrDie (/home/runner/work/eddystone/eddystone/node_modules/playwright-core/lib/server/registry/index.js:362:[15](https://github.com/21RISK/eddystone/actions/runs/7612750703/job/20731226666?pr=4680#step:14:16))
    at Object.executablePathOrDie (/home/runner/work/eddystone/eddystone/node_modules/playwright-core/lib/server/registry/index.js:375:43)
    at Chromium._launchProcess (/home/runner/work/eddystone/eddystone/node_modules/playwright-core/lib/server/browserType.js:[16](https://github.com/21RISK/eddystone/actions/runs/7612750703/job/20731226666?pr=4680#step:14:17)6:39)
    at async Chromium._innerLaunch (/home/runner/work/eddystone/eddystone/node_modules/playwright-core/lib/server/browserType.js:103:9)
    at async Chromium._innerLaunchWithRetries (/home/runner/work/eddystone/eddystone/node_modules/playwright-core/lib/server/browserType.js:84:14)
    at async ProgressController.run (/home/runner/work/eddystone/eddystone/node_modules/playwright-core/lib/server/progress.js:91:22)
    at async Chromium.launch (/home/runner/work/eddystone/eddystone/node_modules/playwright-core/lib/server/browserType.js:61:[21](https://github.com/21RISK/eddystone/actions/runs/7612750703/job/20731226666?pr=4680#step:14:22))
    at async BrowserServerLauncherImpl.launchServer (/home/runner/work/eddystone/eddystone/node_modules/playwright-core/lib/browserServerImpl.js:48:21)
    at async PlaywrightRunner.launchServer (/home/runner/work/eddystone/eddystone/node_modules/jest-playwright-preset/lib/PlaywrightRunner.js:69:44)
    at async PlaywrightRunner.getTests (/home/runner/work/eddystone/eddystone/node_modules/jest-playwright-preset/lib/PlaywrightRunner.js:90:[36](https://github.com/21RISK/eddystone/actions/runs/7612750703/job/20731226666?pr=4680#step:14:37)) 

However I did actually run npx playwright install, and when running this line:

ls -a ~/.cache/ms-playwright

I get:

chromium-1071
ffmpeg-1009
firefox-1419
webkit-[18](https://github.com/21RISK/eddystone/actions/runs/7612750703/job/20731226666?pr=4680#step:9:19)69
@tamarasaurus
Copy link

Hey @alexbjorlig we also faced this issue but for a different reason. Did you already try configuring PLAYWRIGHT_BROWSERS_PATH to $HOME/.cache/ms-playwright in your CI workflow in the step where you execute the test step?

@nerdyman
Copy link

nerdyman commented Apr 5, 2024

I'm also running into this, it used to work but now it looks like the version the test runner is looking for doesn't match the version installed by the Playwright install command. Setting the env var didn't work for me unfortunately.

Playwright install command:
Chromium 124.0.6367.29 (playwright build v1112) downloaded to /home/runner/.cache/ms-playwright/chromium-1112

Storybook test job:
[test] [sb] Error: Executable doesn't exist at /home/runner/.cache/ms-playwright/chromium-1097/chrome-linux/chrome

This is the CI job https://github.com/nerdyman/react-compare-slider/actions/runs/8573359817/job/23497910013?pr=139

@nerdyman
Copy link

nerdyman commented Apr 5, 2024

I was able to resolve this by setting a fixed version for Playwright, matching the version installed by the test runner.

E.g. pnpm dlx playwright@1.41.1 install --with-deps

This is defs a workaround though, is there a way to get the test runner to play nice with the latest Playwright npx commands?

@lucarestagno
Copy link

I have the same issue.
Also, it's hard to understand which version of chromium is included in the playwright versions.
The release page doesn't help.

I expect the installation of test-runner to install the browsers as well, but this doesn't seem to happen.

Error: Executable doesn't exist at /Users/user/Library/Caches/ms-playwright/chromium-1117/chrome-mac/Chromium.app/Contents/MacOS/Chromium

I can't get chromium-1117 with any pnpm dlx playwright@<version> install --with-deps commands.

If I could configure the chromium version to be used via an env variable for test-storybook, that would help.

@lucarestagno
Copy link

I fixed it with

pnpm dlx playwright@latest install --with-deps

It looks like test-runner looks for the latest playwright build by default.
Yesterday it was looking for chromium-1115, while today chromium-1117.
The version of test-runner didn't change in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants