Search⌘ K
AI Features

Parsing Scenario Examples

Explore how to parse Example and Scenario blocks in Gherkin scenario outlines using Laravel. Learn to handle nested lines and implement parsing methods that process indentation and table structures, building a foundation for complex parsing tasks in your PHP projects.

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:

C++
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 method that handles the scenario outline and already have access to ...