Search⌘ K
AI Features

Parsing Steps

Explore the process of parsing Gherkin test steps within Laravel by learning how to iterate through lines, recognize step keywords, and extract detailed information such as text, parameters, and data tables using dedicated parsing methods. This lesson builds on earlier parsing techniques to assemble complete step constructs for effective Gherkin parser implementation.

We'll cover the following...

Parsing steps

Steps are what provide the individual action items when defining a Gherkin test. The example below offers a quick overview of what these look like in context:

C++
Scenario: eat 5 out of 12
Given there are 12 cucumbers
When I eat 5 cucumbers
Then I should have 7 cucumbers

Like with most things we’ve done so far, we will iterate each line we are interested in and check to see if they start with any step keywords. If so, we will parse that line into an ...