1yraaq
Last Updated: February 25, 2016
·
1.206K
· descentintomael
C8326f8f8ec51f2a1e5eb5d5fa6e4f33

Cucumber & Repetitive Scenarios

If you have multiple scenarios where you are basically changing one or two words in each, try a Scenario Outline. It allows you to define a scenario where some of the words used can be replaced using an example table.

Scenario Outline: Eat only what is edible
  Given I have a <Item>
  When I try to <Action>
  Then I should <Succeed or Fail>

  Examples:
    | Item          | Action | Succeed or Fail |
    | shoe          | eat    | fail            |
    | banana        | eat    | succeed         |
    | glass of milk | eat    | fail            |
    | glass of milk | eat    | succeed         |
Say Thanks
Respond