Search code examples
junitcucumber-jvm

Why Cucumber JVM does not fail step or step definition when an exception is thrown?


I am writing cucumber jvm test code using junit as runner. Some how i notice that even though the test code is throwing a lot of runtime exceptions. The step/step definitions still show as 'PASSED' in report.

If i remembered correctly, i've use cucumber jvm before and it always fail the steps whenever there is an exception. But now, i can only fail the step when assertion fail.

What am i missing here? Could anyone give an advice/hint?


Solution

  • Are you using try catch statements? if so then you see the catch block logs. If you want to let the scenario fail then use how possible more asserts and Boolean functions. Can't help you out with the info you shared.