question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] `failed to launch chromium` error while running `npx jest` within Dockerfile.bionic

See original GitHub issue

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:

docker run -it --name playwright  -v "C:\myProject\web":/home mcr.microsoft.com/playwright bash

Command used to install project dependencies:

npm install 

Command to run tests:

npx jest 

Error:

root@f542143afa64:/home/e2e_tests# npm run test

catalogue-testing-framework-with-playwright@1.0.0 test /home/e2e_tests npx jest

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)

Any idea to what is going wrong here? thx

my package.json

{
  "name": "catalogue-testing-framework-with-playwright",
  "version": "1.0.0",
  "description": " E2E testing framework",
  "main": "index.js",
  "scripts": {
    "lint": "eslint test/**/*.{js,ts,tsx} --quiet --fix",
    "pretty": "npx prettier --no-config test/**/*.{js,ts,tsx} --write",
    "test": "npx jest"
  },
  "dependencies": {
    "chromedriver": "85.0.1",
    "jest": "26.6.3",
    "jest-playwright": "0.0.1",
    "jest-playwright-preset": "^1.4.0",
    "playwright": "^1.5.2",
    "ts-jest": "26.4.4",
    "typescript": "4.0.5"
  },
  "devDependencies": {
    "@types/jest": "26.0.15",
    "@types/node": "13.13.30",
    "eslint": "^6.6.0",
    "expect-playwright": "^0.2.6",
    "jest-circus": "^26.6.3",
    "jest-html-reporters": "^2.1.0",
    "playwright-core": "^1.5.2",
    "prettier": "2.1.2"
  },
  "license": "MIT",
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nboisteaultcommented, Apr 15, 2022

@aslushnikov on a different note where would it be a good place to start a conversation around playwright and openlayers (https://openlayers.org/) testing? My team is building apps that are using openlayers as base for maps and build the application on top of that (layers). We would like to use some playwright APIs to interact with openlayers (e.g zoom in , draws polygons , select points etc.) I was able to do some very basic interaction using puppeteer using but not totally satisfied … however it seems harder with playwright… Do you guys have any suggestion/recommendation to tests map with playwright?

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?

1reaction
aslushnikovcommented, Feb 12, 2021

@fasatrix but actually let me try fixing our docker image…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't launch Chromium as executable doesn't exists if ...
I believe your problem lies with using alpine. ... The chromium executable should be in your Docker image under /usr/bin/chromium-browser.
Read more >
qawolf/community - Gitter
I'm having some issues running test on Jenkins and I think it might be a problem of mixing versions of the same dependencies....for...
Read more >
page.goto: navigation failed because page crashed - You.com
The problem occurs when running tests using @web/test-runner-playwright with Playwright 1.10.0. Here is the error message: Error: page.goto: Navigation ...
Read more >
How To Write End-to-End Tests in Node.js Using Puppeteer ...
In this tutorial, you will write an e2e test that validates that the account creation and login features of a sample webpage work...
Read more >
Playwright changelog - Awesome Node.js - LibHunt
Run npx playwright-cli codegen --target=csharp to try! ... #3122 - [QUESTION] Chromium versions are mismatched in docker, leading to launch failures
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found