How to add the chrome binary to run e.g. Karma tests on headless chrome on a CI server

user2520818 picture user2520818 · Aug 25, 2017 · Viewed 14.2k times · Source

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?

Answer

Oleksandr Fediashov picture Oleksandr Fediashov · Aug 30, 2017

You can use Puppeteer (headless Chromium), follow these instructions.