Question

Specifically I am interested for Jenkins to mark build as failed (or has bugs) when there are any undefined steps in any scenario. Integration of Behat with Jenkins is done through JUnit formatted reports.

So,

Question 1: Can Behat write JUnit report for scenario with undefined step as failed?

Question 2: I have noticed that return code of Behat = 0 if all tests are succeeded, but some of them have undefined steps. Are there any flags to change this behavior and have Behat return code other than 0 for such cases?

Was it helpful?

Solution

If you use the --strict option, it should treat Undefined and Pending steps as failures (and exit with exit status of 1)

Source: http://docs.behat.org/en/latest/guides/2.definitions.html#undefined-steps

OTHER TIPS

You can use Text-finder plugin to search console log for a RegEx matching your "undefined steps", and change the build status if found.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top