O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PhantomJS

A popular headless browser is PhantomJS (http://phantomjs.org/). Since it is pretty popular and easy to set up, I want to discuss it here, but I should mention upfront that it does not work well with Protractor. The Protractor team actually recommends that you do not use PhantomJS with Protractor. I concur, I never got it to work together either. However, it works fine for Karma, so let's set that up.

Installation of PhantomJS is easy, it is just a regular npm installation. Of course, you will also need to install the appropriate Karma launcher:

npm install phantomjs --save-dev
npm install karma-phantomjs-launcher --save-dev

You can now use PhantomJS as a browser in your Karma configuration:

browsers: ['PhantomJS'],

If you now start ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required