CucumberGherkin (CucumberGherkin v18.1.0)

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.

Link to this section 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.

Link to this section Functions

Link to this function

parse_path(path, opts)

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{
        # ...
    }}
  }
]
Link to this function

parse_paths(paths, opts)

Returns a list of envelopes. See parse_path/2 for more information.

Link to this function

tokenize(feature_file)

Tokenizes a feature file. Normally you should not need this.