Cucumber.Discovery (Cucumber v1.0.0)

View Source

Discovers and loads feature files, step definitions, and hook modules.

The discovery algorithm proceeds in this order:

  1. Support files are loaded first (default: test/features/support/**/*.exs), following the same convention as Ruby Cucumber. These typically define hooks.
  2. Step definitions are loaded next (default: test/features/step_definitions/**/*.exs). Each module using Cucumber.StepDefinition is registered.
  3. A step registry is built from all loaded step modules, mapping patterns to their implementing module and metadata. Duplicate patterns raise immediately.
  4. Feature files are parsed (default: test/features/**/*.feature plus test/features/**/*.feature.md) using Gherkin.Parser and annotated with their source file path. .feature.md files parse as Markdown with Gherkin (see Gherkin.Markdown).

All default paths can be overridden via application config or opts passed to discover/1.

Summary

Functions

Discovers all features and steps based on configuration. Returns a struct containing parsed features and a registry of steps.

Functions

discover(opts \\ [])

Discovers all features and steps based on configuration. Returns a struct containing parsed features and a registry of steps.