-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[QUESTION] failed to launch chromium
error while running npx jest
within Dockerfile.bionic
#4485
Comments
failed to launch chromium
error while running npx jest
within Dockerfile.bionicfailed to launch chromium
error while running npx jest
within Dockerfile.bionic
I got the same issue when I used the docker with the new Playwright version |
My understanding is that |
Thanks for your answer but still did not make much difference: root@2af26501fb5b:/home/e2e_tests# **node_modules/jest/bin/jest.js test/**
Error: Failed to launch chromium because executable doesn't exist at /root/.cache/ms-playwright/chromium-827102/chrome-linux/chrome
Try re-installing playwright with "npm install playwright"
Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.
at Chromium._launchProcess (/home/e2e_tests/node_modules/playwright/lib/server/browserType.js:128:19)
at async Chromium._innerLaunch (/home/e2e_tests/node_modules/playwright/lib/server/browserType.js:70:62)
at async ProgressController.run (/home/e2e_tests/node_modules/playwright/lib/server/progress.js:85:28)
at async Chromium.launch (/home/e2e_tests/node_modules/playwright/lib/server/browserType.js:53:25)
at async BrowserServerLauncherImpl.launchServer (/home/e2e_tests/node_modules/playwright/lib/browserServerImpl.js:35:25)
at async PlaywrightRunner.launchServer (/home/e2e_tests/node_modules/jest-playwright-preset/lib/PlaywrightRunner.js:61:48)
at async PlaywrightRunner.getTests (/home/e2e_tests/node_modules/jest-playwright-preset/lib/PlaywrightRunner.js:96:40)
at async PlaywrightRunner.runTests (/home/e2e_tests/node_modules/jest-playwright-preset/lib/PlaywrightRunner.js:123:30)
at async TestScheduler.scheduleTests (/home/e2e_tests/node_modules/@jest/core/build/TestScheduler.js:321:13)
at async runJest (/home/e2e_tests/node_modules/@jest/core/build/runJest.js:376:19) Test Suites: 0 of 4 total |
I have installed all packages with -g and getting the same error what I found as difference is that this time I have something under /root but chromium still missing root@18d0b4236493:/home/e2e_tests # cd ~ |
hey I found the workaround but would be good to have it sorted for root too. Entry point should be pwuser. then install all modules under that user (npm i) and voila' pwuser@d35208e019fa:~/e2e_tests$ npm i
/tmp/85.0.4183.87/chromedriver is not writable: EACCES: permission denied, open '/tmp/85.0.4183.87/chromedriver/1605810948234.tmp'
Downloading chromium v827102 - 119.8 Mb [====================] 100% 0.0s chromium v827102 downloaded to /home/pwuser/.cache/ms-playwright/chromium-827102 added 751 packages from 472 contributors and audited 756 packages in 299.17s 31 packages are looking for funding found 0 vulnerabilities pwuser@d35208e019fa: |
Same problem here. Seems like the image wasn't updated, but chrome was. |
TLDR Workaround: |
Having the same issue. Running playwright with jest-playwright in Azure Pipelines inside a docker container. Tried suggested workarounds - did not help. In my case, the Even if I set the browser path with
it still looks for the The logs that I'm getting with
|
(sorry for the long reply - we have a huge stream of incoming requests)
@fasatrix did you just build it yourself and then use it? How would I reproduce this error locally? |
@alstas your case seems to be different. Can you please file a separate issue? Also, details that would help us reproduce this locally are greatly appreciated! |
@aslushnikov No worries I know you guys are very busy.. I am using the following repo only as example but the behavior is exactly the same as for mine Platform windows 10Steps:
Error Outputted on screen
Where as if I do this:
I get this(basically chromium is found and test runs):`$ npm i
Downloading chromium v844399 - 122 Mb [====================] 100% 0.0s chromium v844399 downloaded to /home/pwuser/.cache/ms-playwright/chromium-844399
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/) npm notice created a lockfile as package-lock.json. You should commit this file. added 1958 packages from 805 contributors and audited 1961 packages in 442.996s 129 packages are looking for funding found 0 vulnerabilities pwuser@1ef095526b87:
FAIL browser: chromium src/tests/App.js (29.881 s)` |
@aslushnikov |
@fasatrix awesome, thank you for the repro. I can repro now.
The reason this doesn't work is because you're overwriting the One easy fix would be to mount your project to some root location inside docker. For example, the following worked for me: $ docker run -it --name playwright --user pwuser -v c:\temp\msw-ssl:/mswssl mcr.microsoft.com/playwright bash
$ cd /mswssl
$ npm ci && npm run test On a related note, I'd recommend using a docker image version that matches the playwright version you use. This way Since you use playwright v1.6.2, you can use a matching docker image; $ docker run -it --rm -v c:\temp\msw-ssl:/mswssl mcr.microsoft.com/playwright:v1.6.2 bash
$ cd /mswssl
$ npm ci && npm run test
I'd suggest opening a new issue and sharing your problems. It should all just work! |
Instead of symlinking pwuser's registry to root's registry, we now use the `PLAYWRIGHT_BROWSERS_PATH` variable to define a single browser registry across the docker image, accessible for all users. Fixes microsoft#4485
@fasatrix but actually let me try fixing our docker image.. |
Instead of symlinking pwuser's registry to root's registry, we now use the `PLAYWRIGHT_BROWSERS_PATH` variable to define a single browser registry across the docker image, accessible for all users. Fixes #4485
That's what I thought it'd be the best anti error prone solution. Thanks allot @aslushnikov you are the best 😉 |
Hi @fasatrix I'm also interested in testing OpenLayers with Playwright. Did you achieve to draw a point and move it on the map with Playwright? |
Context:
I am using this container
https://github.com/microsoft/playwright/blob/master/docs/docker/Dockerfile.bionic
After running the container, install all dependencies successfully, I have the following error:
Command used to run the container:
Command used to install project dependencies:
Command to run tests:
Error:
Any idea to what is going wrong here? thx
my package.json
The text was updated successfully, but these errors were encountered: