Scenarios overview
Within the context of Behavior Testing Framework, a scenario is a description of a user or system behavior that can be tested. Scenarios typically have three sections:
- A Given section, which describes conditions that exist before the behavior is executed.
- A When section, which describes the behavior to be executed.
- A Then section, which describes the outcome expected from the behavior.
Scenarios are written in the Gherkin language. Gherkin is designed to enhance collaboration between business experts and technical experts by allowing scenarios to be written in natural language. Scenarios can be written collaboratively by a group of business analysts, technical consultants, and QA developers. After they have been written, the technical consultants can create Gosu methods and implementation code to execute the scenarios.
The following is a scenario written in Gherkin. The structure of Gherkin scenarios is discussed in detail later in this topic.
Scenario: Set a user's email address
Given I am the supervisor of "Chris Jones"
When I set the user's email address to "cjones@customer.com"
Then the user's primary email address should be "cjones@customer.com"
Guidewire recommends that each scenario focus on the behavior of a single persona. You may also want to test behaviors that are executed by the system, such as the execution and outcome of a batch process. For these tests, you may want to use a persona of "system".
Scenarios are grouped together in feature files. Behavior Testing Framework comes with a set of base configuration feature files. You can view the scenarios in them from Studio by navigating to configuration/res/cucumber. If you do not have access to Studio, you can open them using a text editor. The files are located in subdirectories of modules/configuration/res/cucumber.
