CucumberGherkin (CucumberGherkin v32.1.1)
CucumberGherkin
allows you to parse Gherkin files to pickles (or tokens). These pickles can be used in a cucumber implementation.
The CucumberMessages library is used in almost every step of building the pickles and envelopes.
Testdata is used from the Cucumber repository.
Summary
Functions
Parse a single feature file and return a list of envelopes. You can provide the following opts in a list
Returns a list of envelopes. See parse_path/2
for more information.
Rely on CucumberMessages printer to print the envelopes to the specified format. Currently only :ndjson
is supported.
Tokenizes a feature file. Normally you should not need this.
Functions
Parse a single feature file and return a list of envelopes. You can provide the following opts in a list:
- :no_source
- :no_ast
- :no_pickles
Examples
iex> CucumberGherkin.parse_path("testdata/good/background.feature", [:no_ast, :no_pickles])
[
%CucumberMessages.Envelope{
__uf__: [],
message: {:source,
%CucumberMessages.Source{
# ...
}}
}
]
Returns a list of envelopes. See parse_path/2
for more information.
Rely on CucumberMessages printer to print the envelopes to the specified format. Currently only :ndjson
is supported.
It is likely that Elixir projects won't directly use this as they can use the unformatted protobuf message version in Cucumber as well.
Examples
iex> CucumberGherkin.parse_path("testdata/good/background.feature", []) |> CucumberGherkin.print_messages(:ndjson) |> IO.puts
{"source":{"data": .......... }}
{"gherkinDocument":{"feature": ........... }}
{"pickle":{ .......... }}
{"pickle":{ .......... }}
Tokenizes a feature file. Normally you should not need this.