Headless testing with PhantomJS

As a concrete automation example, we will adapt our existing Backbone.js test infrastructure to use PhantomJS. PhantomJS offers an amenable set of features and capabilities for Backbone.js testing—it is fast, relatively easy to set up, and provides a real (headless) browser. As a practical matter, larger Backbone.js applications often require a real browser engine to function properly, particularly applications that exercise the murkier and more complicated parts of the browser environment.

Installing PhantomJS and the supporting tools

To get up and running with PhantomJS, let's start by installing the toolkit as per the instructions at http://phantomjs.org/download.html. Note that the installation procedures are ...

Get Backbone.js Testing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.