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?

有帮助吗?

解决方案

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

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top