Cucumber.Discovery (Cucumber v0.9.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) using Gherkin.Parser and annotated with their source file path.

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 \\ [])

@spec discover(keyword()) :: Cucumber.Discovery.DiscoveryResult.t()

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