[英]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:当我尝试使用 YML 文件在 Azure 管道中执行编剧脚本时,出现以下错误:
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. browserType.launch:可执行文件不存在于/home/vsts/.cache/ms-playwright/chromium-965416/chrome-linux/chrome╔══════════════════ ══════════════════════════════════════════════════ ═════╗║ 看起来 Playwright Test 或 Playwright 刚刚安装或更新。 ║ ║ Please run the following command to download new browsers: ║ ║ ║ ║ npx playwright install ║ ║ ║ ║ <3 Playwright Team ║ ╚═════════════════════════════════════════════════════════════════════════╝
║ ║ 请运行以下命令下载新的浏览器: ║ ║ ║ ║ npx playwright install ║ ║ ║ ║ <3 Playwright Team ║ ╚════════════════════ ══════════════════════════════════════════════════ ══╝
Context Used in YML file: YML 文件中使用的上下文:
pool: vmImage: 'ubuntu-20.04'池:vmImage:'ubuntu-20.04'
container: mcr.microsoft.com/playwright:focal容器:mcr.microsoft.com/playwright:focal
steps:脚步:
task: NodeTool@0 inputs: versionSpec: '16.x' displayName: 'Install Node.js'任务:NodeTool@0 输入: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'
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" } "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更改池后:vmImage 从 'ubuntu-20.04' 到 'windows-2019' 和
Node.js versionSpec from '16.x' to '17.x' the pipeline error gone Node.js versionSpec 从“16.x”到“17.x”管道错误消失
I'd recommend to pin your Docker image to a specific Playwright version:我建议将您的 Docker 图像固定到特定的 Playwright 版本:
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.您也不需要安装
playwright
或jest
, @playwright/test
就足够了。 After these changes it should work!经过这些更改后,它应该可以工作!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.