Scenario steps overview

Scenarios are written as a series of steps. A step is a description of either a pre-condition that is true before the behavior is executed, the behavior to execute, or the outcome that is expected from the behavior.

Steps are intended to be reusable. You can use the exact same step in multiple scenarios when those scenarios require the same pre-condition, execute the same action, or expect the same outcome. For example, consider the following step:

Given an activity
And the activity's priority is "Urgent"

These steps can be used in any scenario in which one of the pre-conditions is that there is an urgent activity.

Steps with parameters

Some steps use parameters, which appear as text between quotation marks. These steps have increased usability because they combine multiple descriptions that differ only by a single value. For example:

Given an Personal Auto submission
And the job status is "Quoted"

In this example, "the job status is status" is a step that uses a parameter of status.

There are also steps that do not use parameters. These steps provide a single description that does not vary. For example:

Given a Personal Auto submission
And the submission is bound

Step methods

Every step maps to a step method. A step method is a method written in Gosu that identifies the implementation code that corresponds to the step. Step methods are part of the second layer of Behavior Testing Framework, the mapping layer. (Step methods are also referred to as the "glue code" because they glue the behavior descriptions to the implementation code.)