Chrome Headless is fantastic!!!
But is there a way I can install Chrome Headless using NPM so that can I use it for my unit tests in automated test environments?
Is there an alternative way of doing this?
Many thanks in advance!!!
Note: Headless mode has been available on Mac and Linux since Chrome 59. Windows support came in Chrome 60.
Starting with version 60, the Chrome browser introduced the ability to run in headless mode. We now have the ability to launch the browser without creating a visual browser window.
Headless mode is a functionality that allows the execution of a full version of the latest Chrome browser while controlling it programmatically. It can be used on servers without dedicated graphics or display, meaning that it runs without its “head”, the Graphical User Interface (GUI).
chrome is bundled with the puppeteer package on npm by default. Puppeteer provides a nice API for using chrome headless for automated tests or even regular chrome (headless turned off).
https://www.npmjs.com/package/puppeteer
https://github.com/GoogleChrome/puppeteer
npm install puppeteer
https://www.npmjs.com/package/chromium
npm install chromium
For windows:
\node_modules\chromium\lib\chromium\chrome-win\chrome.exe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With