Playwright not finding the browsers binaries
Hello team, currently we are running backstopjs with playwright.
We are running into a situation where the backstopjs is looking for some browsers binaries with a specific version. Meanwhile the playwright install is installing a different set of binaries.
Is there a way to sync them?
This is almost how it looks in the pipeline:
$ npx playwright install --with-deps
Chromium 109.0.5414.46 (playwright build v1041) downloaded to /builds/<Project-Path>/node_modules/playwright-core/.local-browsers/chromium-1041 FFMPEG playwright build v1008 downloaded to /builds/<Project-Path>/node_modules/playwright-core/.local-browsers/ffmpeg-1008 Firefox 107.0 (playwright build v1369) downloaded to /builds/<Project-Path>/node_modules/playwright-core/.local-browsers/firefox-1369 Webkit 16.4 (playwright build v1751) downloaded to /builds/<Project-Path>/node_modules/playwright-core/.local-browsers/webkit-1751
$ backstop test --config backstop.config.js
BackstopJS v6.1.0 Loading config: /builds/<Project-Path>/backstop.config.js COMMAND | Executing core for "test" createBitmaps | Selected 51 of 51 scenarios. Creating Browser No Playwright browser specified, assuming Chromium. COMMAND | Command "test" ended with an error after [0.072s] COMMAND | browserType.launch: Executable doesn't exist at /builds/<Project-Path>/node_modules/backstopjs/node_modules/playwright-core/.local-browsers/chromium-1005/chrome-linux/chrome
Any idea how we can tell Playwright and BackstopJs which versions to use?
I think you can specify the executablePath inside engineOptions. This is what I have:
"engineOptions": {
"executablePath": ".\\node_modules\\chromium-binaries\\src\\binaries\\chrome-win\\chrome.exe",
"args": ["--ignore-certificate-errors", "--no-sandbox"]
}
This was happening for me as well and I used this command to fix it:
npx playwright install chromium or npx playwright install firefox - then backstop test worked