Setting up a fully covered project in CI with PhantomJS
This recipe puts together many of the preceding lessons and illustrates how to set up a build that will use PhantomJS for automated unit, end-to-end, and performance tests, ultimately failing the build if any test fails. Our demonstration will use Jenkins CI.
Getting ready
We must have the PhantomJS binary exposed to the CI server, which may not necessarily share the same permissions or PATH
as our user.
Similarly, we need CasperJS installed and exposed to the continuous integration server.
Note
We covered how to install CasperJS in the Installing CasperJS recipe in Chapter 5, Functional and End-to-end Testing with PhantomJS. As with the PhantomJS binary, we must take care to ensure that CasperJS is on PATH
for the continuous integration server's system user; this follows the same principles that we applied in the Setting up PhantomJS in a CI environment recipe (earlier in this chapter).
We need a continuous integration server set up...