4

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" }

Jack Vicky
  • 81
  • 1
  • 5

2 Answers2

2

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

Jack Vicky
  • 81
  • 1
  • 5
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 or jest installed, @playwright/test is enough. After these changes it should work!

Max Schmitt
  • 2,529
  • 1
  • 12
  • 26