How to add chrome binary code to run, for example. Karma tests on headless chrome on the CI server

I like to run modular karma tests on headless chrome. Using the karma-chrome launcher and setting the browser to "ChromeHeadless" works on my machine. But on the CI server, it does not work with the message "There is no binary file for the ChromeHeadless browser on your platform." Chrome cannot be installed on the CI machine. Is there any other way to download chrome binaries? for example, the google puppeteer module seems to load it at startup. from the docs: "The Puppeteer downloads and uses a specific version of Chromium." How can I achieve the same?

+5
source share
2 answers

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

+2
source

If you are afraid that downloading from the Internet may be slow, you can tell the puppeteer where to download chrome and use a local address.

Use PUPPETEER_DOWNLOAD_HOST to indicate where to download Chrome, and PUPPETEER_SKIP_CHROMIUM_DOWNLOAD to not download Chrome at all.

You can learn more about this in the documentation .

+1
source

Source: https://habr.com/ru/post/1271228/


All Articles