JBehave how to fail all stories

1.2k views Asked by At

I dont know why, but JBehave does not take in consideration failures in the given stories. If there is a failure in a givenstory, it will not perform the rest of the steps of that story, but it will execute the rest of the given stories. Here is a example:

GivenStories: stories/web/pmv/Story1.story,
stories/web/pmv/Story2.story,
stories/web/pmv/Story3.story,
stories/web/pmv/Story4.story,
stories/web/pmv/Story5.story

When the user do something
Then something happens

For instance, if the Story2.story fails, I was expecting that the rest of the given stories and the last 2 steps were not executed. But they are.

Anyone knows why is that? How can I fail all stories if one single step or story fails?

I noticed as well that the reports statistics just reflect the last given story and the following steps. Is this correct? Why?

I have the following configuration:

configuredEmbedder().embedderControls()
.doGenerateViewAfterStories(true)
.doIgnoreFailureInStories(false)
.doIgnoreFailureInView(false)
.useThreads(2)
.useStoryTimeoutInSecs(60);

MostUsefulConfiguration:

 .useStoryControls(
     new StoryControls()
     .doDryRun(false)
     .doSkipScenariosAfterFailure(true)
     .doResetStateBeforeScenario(false))

When i added the config doResetStateBeforeScenario(false), the following steps after the failure, even the ones inside the givestories were not performed. But in yet, the statistics show no error, because it was not last given story or the steps on the main story. In the end the maven build had no errors, in yet there failures in the test.

Any thoughts?

1

There are 1 answers

0
Vijay Venkatesh On BEST ANSWER

OK. After some searching around I managed to find that this issue was fixed in JBehave 3.8.

JIRA link: http://jira.codehaus.org/browse/JBEHAVE-841

I updated to latest jbehave version and this works fine.