简体   繁体   中英

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

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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM