如何添加chrome二进制文件以运行例如在CI服务器上的无头Chrome上进行Karma测试 [英] How to add the chrome binary to run e.g. Karma tests on headless chrome on a CI server
问题描述
我喜欢在无头铬上运行我的业力单元测试.使用karma-chrome-launcher并将浏览器设置为"ChromeHeadless"可在我的计算机上使用.但是在CI服务器上,它失败并显示消息您的平台上没有适用于ChromeHeadless浏览器的二进制文件". 无法在CI机器上安装Chrome.还有另一种加载Chrome二进制文件的方法吗? 例如,google puppeteer模块在运行时似乎已加载该模块.来自文档:"Puppeteer下载并使用特定版本的Chromium".我怎样才能做到这一点?
I like to run my karma unit tests on a headless chrome. Using karma-chrome-launcher and setting the browser to "ChromeHeadless" works on my machine. But on the CI server it fails with the message "No binary for ChromeHeadless browser on your platform." Installing chrome on the CI machine is not possible. Is there another way to load the chrome binaries? for example the google puppeteer module seems to load that when run. from the docs: "Puppeteer downloads and uses a specific version of Chromium". How can i achieve the same?
You can use Puppeteer (headless Chromium), follow these instructions.
这篇关于如何添加chrome二进制文件以运行例如在CI服务器上的无头Chrome上进行Karma测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!