Cucumber.Runtime (Cucumber v0.9.0)

View Source

Runtime execution of cucumber steps.

This module handles the step execution lifecycle within a running test:

  1. Each step's text is matched against the step registry to find a definition
  2. Cucumber Expressions are used to extract typed parameters from step text
  3. The step function is invoked with context containing extracted args, optional datatable, and optional docstring
  4. Step return values are processed to update the shared context:
    • :ok keeps context unchanged
    • A map is merged into context
    • A keyword list is converted to a map and merged
    • {:ok, data} unwraps and merges
    • {:error, reason} fails the step
  5. On failure, enhanced error messages are generated with step history, file locations, and formatted assertion details

Summary

Functions

Executes a step with the given context and step registry.

Functions

execute_step(context, step, step_registry)

@spec execute_step(map(), Gherkin.Step.t(), map()) :: map()

Executes a step with the given context and step registry.