Cucumber.Discovery (Cucumber v0.9.0)
View SourceDiscovers and loads feature files, step definitions, and hook modules.
The discovery algorithm proceeds in this order:
- Support files are loaded first (default:
test/features/support/**/*.exs), following the same convention as Ruby Cucumber. These typically define hooks. - Step definitions are loaded next (default:
test/features/step_definitions/**/*.exs). Each module usingCucumber.StepDefinitionis registered. - A step registry is built from all loaded step modules, mapping patterns to their implementing module and metadata. Duplicate patterns raise immediately.
- Feature files are parsed (default:
test/features/**/*.feature) usingGherkin.Parserand 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
@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.