Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PlayWright Azure Pipeline Error: browsertype.launch: executable doesn't exist at /home/vsts/.cache/ms-playwright/chromium-965416/chrome-linux/chrome

When I try to execute playwright scripts in Azure pipeline using YML file, I am getting the below error:

browserType.launch: Executable doesn't exist at /home/vsts/.cache/ms-playwright/chromium-965416/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 ║ ╚═════════════════════════════════════════════════════════════════════════╝

Context Used in YML file:

pool: vmImage: 'ubuntu-20.04'

container: mcr.microsoft.com/playwright:focal

steps:

  • task: NodeTool@0 inputs: versionSpec: '16.x' displayName: 'Install Node.js'

  • script: | npm install --registry https://registry.npmjs.org --no-fund playwright npx playwright install npm test displayName: 'npm install and test'

Dependencies Used:

"devDependencies": { "@playwright/test": "^1.18.1", "jest": "27.5.1", "mocha": "^9.2.1", "playwright": "^1.18.1" }

like image 594
Jack Vicky Avatar asked Oct 15 '25 16:10

Jack Vicky


2 Answers

After changing the pool: vmImage from 'ubuntu-20.04' to 'windows-2019' and

Node js versionSpec from '16.x' to '17.x' the pipeline error gone

like image 112
Jack Vicky Avatar answered Oct 18 '25 05:10

Jack Vicky


I'd recommend to pin your Docker image to a specific Playwright version:

docker pull mcr.microsoft.com/playwright:v1.20.0-focal

Also you don't need to have playwright or jest installed, @playwright/test is enough. After these changes it should work!

like image 24
Max Schmitt Avatar answered Oct 18 '25 06:10

Max Schmitt