Using Cucumber in a Continuous Integration (CI) environment is relatively straightforward.
cucumber executable will exit with an exit status
0 if one or more scenarios are failing. This is all your CI
server needs to know.
First, you have to make sure your CI server executes Cucumber. Most CI setups invoke some kind of build tool. Common build tools are:
We recommend executing Cucumber from one of these on a CI server.
If your CI server is using Rake, make sure that Rake executes your Cucumber task.
Many CI servers can interpret XML files produced by the Ant JUnit task and display them as HTML. Some can even create reports over time.
If you’re using such a CI server, we recommend you use Cucumber with the
To get started using Cucumber in Jenkins, add a build step running
cucumber -f junit --out WORKSPACEand then check the ‘Publish JUnit test result report’, and enter
\*.xmlin the ‘Test report XMLs’ field. Save and run. (Later improve by using a Rake task and placing your output in a subfolder).
A Jenkins plugin is available that produces beautiful Cucumber reports.
Follow the install instructions for Cucumber Reports plugin.