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" }
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
orjest
installed,@playwright/test
is enough. After these changes it should work!