chapter thirteen
13 Spotlight patterns for automating narrative flow
This chapter covers
- Understanding the execution model of automated BDD scenarios
- Techniques that support idiomatic natural language narrative
- Using the scenario context as a memory
- Exploring how entities are introduced and referenced in a scenario
- Selecting entities programmatically from a collection
The patterns described in this chapter allow the focus of a scenario to be kept on those elements that are of the most importance, just like a spotlight is used to illuminate the star performer at a concert. For this reason, we call this the Spotlight pattern language:
- The Local Scenario Context and Shareable Scenario Context patterns allow information to be shared between steps during scenario execution, eliminating the need for repetition within a scenario.
- The Introduce and Refer pattern utilizes specific natural language phrases to distinguish the introduction of a new entity from a reference to an existing entity, enabling the use of idiomatic business language throughout a scenario.
- The Entity Selector pattern describes an approach that uses domain logic to select an appropriate entity in response to idiomatic business language