Parsing Scenario Examples

Learn how to parse scenario examples using the Gherkin class.

We'll cover the following...

Parsing scenario examples

We are almost ready to start parsing some of the larger Gherkin structures but have just a few smaller structures to take care of first. In this lesson, we are going to work on parsing the Example or Scenario blocks that appear under scenario outlines:

Press + to interact
Scenario Outline: eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |

For now, let’s assume that we are already inside a parser ...