Improve state management of StoryRunner

Description

We need to improve the state management of the StoryRunner.

Currently after every set of steps run the state is reset and the scenario @Before/@After steps are run separately from the normal steps, causing wierd behaviours when there are failure in the @Before steps but not in the normal steps. Examples of such a behaviour are the trader failing_before_after.story and failing_before_stories.story.

A better and more intuitive state management should be in place, keeping state in the run context. The state should be reset by default before each scenario (to ensure backward compat) but will be shared between the @Before/@After steps and the normal steps.

We should also have the option to not reset it before each scenario to allow for failures in the @BeforeStory/Stories steps to propagate to the scenario steps in the same run context.

Once a failing state in a given run context, the steps that follow will not be performed, as customary with normal steps.

Assignee

Mauro Talevi

Reporter

Mauro Talevi

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure