Generating JUnit reports
In this recipe, we will demonstrate how to fail builds by generating JUnit reports from tests run via PhantomJS. As in the previous recipe, our demonstration will use Jenkins CI for the sake of example.
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.
We need a continuous integration server set up where we can configure jobs that will use PhantomJS. Our example that follows will use the open source Jenkins CI server.
Note
See the previous recipe (Setting up PhantomJS in a CI environment) for more information on Jenkins CI and recommended plugins.
We need a project under version control with the Git source control management software. See the Setting up PhantomJS in a CI environment recipe, earlier in this chapter, for the Git repository URL of this book's sample code.
This project must also contain components that expect to be run and/or tested in a web browser and the tests...