Parsing Gherkin Tables

Learn how to parse Gherkin tables using the Gherkin class.

We'll cover the following...

Parsing Gherkin data tables

We will now work to parse Gherkin data tables, which will be the most substantial structure we’ve parsed. It’s, in some ways, the most difficult to parse out of all of the different Gherkin elements. A Gherkin data table looks similar to a Markdown table, and each line starts and ends with a vertical pipe character, with each column also separated by a pipe character:

Press + to interact
Feature: Feature Name
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 |

Like with doc strings and free-form descriptions, we will want to gather all of the lines that should be part of our ...