Failing Scenarios are Reported as Successfull

Description

We noticed that methods annotated with @AfterScenario(uponOutcome=FAILURE) were not being triggered properly after a scenario failed. Upon further inspection, we see that the Failure is reported by the failing step. It is then ignored by the "After" methods, which report success. The following scenario is run (although it should be skipped). The report at the bottom correctly states that the story failed.

Sample Output from one of the Trader Examples:

Running story org/jbehave/examples/trader/stories/skip_scenarios_after_failure.story

(org/jbehave/examples/trader/stories/skip_scenarios_after_failure.story)
Before Story ...
Scenario: A scenario with failed step
Before Scenario ...
Given I do nothing
Then I fail (FAILED)
(junit.framework.AssertionFailedError: I failed!)
After Any Scenario ...
After Successful Scenario ...

Scenario: A scenario that is not executed because if followed a failed scenario
Before Scenario ...
Given I do nothing
After Any Scenario ...
After Successful Scenario ...

... Browser has been put to rest

After Story ...

Failed to run story org/jbehave/examples/trader/stories/skip_scenarios_after_failure.story
junit.framework.AssertionFailedError: I failed!

Assignee

Mauro Talevi

Reporter

Patrick McFadden

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure