O'Reilly logo

Backbone.js Testing by Ryan Roemer

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

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 ...

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