A Scenario describes a series of events, run in a particular context, and for which certain outcomes are expected.
This class allows a scenario to be implemented with instances of particular givens, events and outcomes. Each {@link Given}, {@link Event} or {@link Outcome} should be represented by a different class, which can be reused in different scenarios.
A scenario's elements can be used to describe it thus:
eg:
Sometimes a scenario may only finish after several events and the outcomes that result from them. Also, you may want to carry out checks on the way through using Outcomes that are not related to the outcome of the scenario. For instance, you may login to a web app and then ensure you are at the "welcome" page before continuing with the scenario. Each Given, Event and Outcome is considered a {@link Step}, and Steps can be chained together in any arbitrary sequence to accomplish this.
Each scenario runs as follows:
The annotation methods {@link #given(Given)}, {@link #when(Event)} and{@link #then(Outcome)} are used to make the Scenario code easier to read.
ScenarioUsingSteps also gives you easy access to JBehave's MiniMock framework. This allows you to mock out the bits of the system that you haven't written yet. The Scenario will report the use of mocks, but will not consider them a failure.
@author Dan North @author Elizabeth Keogh
|
|