gherkin v1.6.0 Gherkin View Source

See Gherkin.parse/1 for primary usage.

Link to this section Summary

Functions

Given a Gherkin.Element.Feature, changes all Gherkin.Elements.ScenarioOutlines into Gherkin.ElementScenario as a flattened list of scenarios

Primary helper function for parsing files or streams through Gherkin. To use simply call this function passing in the full text of the file or a file stream

Changes a Gherkin.Elements.ScenarioOutline into multiple Gherkin.Elements.Scenarios so that they may be executed in the same manner

Link to this section Functions

Given a Gherkin.Element.Feature, changes all Gherkin.Elements.ScenarioOutlines into Gherkin.ElementScenario as a flattened list of scenarios.

Primary helper function for parsing files or streams through Gherkin. To use simply call this function passing in the full text of the file or a file stream.

Example:

%Gherkin.Elements.Feature{scenarios: scenarios} = File.read!("test/features/coffee.feature") |> Gherkin.parse()
# Do something with `scenarios`

# Also supports file streams for larger files (must read by lines, bytes not supported)
%Gherkin.Elements.Feature{scenarios: scenarios} = File.stream!("test/features/coffee.feature") |> Gherkin.parse()
Link to this function scenarios_for(scenario_outline) View Source

Changes a Gherkin.Elements.ScenarioOutline into multiple Gherkin.Elements.Scenarios so that they may be executed in the same manner.

Given an outline, its easy to run all scenarios:

outline = %Gherkin.Elements.ScenarioOutline{}
Gherkin.scenarios_for(outline) |> Enum.each(&run_scenario/1)