Cucumber.Messages.Emitter (Cucumber v1.0.0)

View Source

Drives Cucumber Messages emission through the Cucumber.RunCoordinator sink.

Two roles:

  • Configurationconfigure/6 builds the run's static envelopes (meta, sources, gherkin documents, pickles, step definitions, hooks, parameter types) plus the id maps run-time messages reference, and hands them to the coordinator. Called by Cucumber.Compiler.compile_features!/1 when config :cucumber, messages: path is set.
  • Run-time sessions — the scenario runner opens a session per scenario (open_test_case/2 emits the testCase envelope), starts one attempt at a time (start_attempt/2 emits testCaseStarted), brackets steps and scenario hooks with started/finished events, and closes each attempt (close_test_case/2).

Every session function is nil-safe: when the sink is disabled the session is nil and all of this is a no-op, so the runner carries no conditionals.

Summary

Functions

Builds the run's static envelopes and id maps and configures the coordinator's message sink.

Functions

configure(path, features_with_compilations, step_registry, hooks, parameter_types, next_id)

@spec configure(
  String.t(),
  [{map(), Gherkin.Pickles.Compilation.t()}],
  map(),
  [tuple()],
  map(),
  non_neg_integer()
) :: :ok

Builds the run's static envelopes and id maps and configures the coordinator's message sink.

features_with_compilations pairs each discovered feature with its Gherkin.Pickles.Compilation; next_id continues the compilation id sequence so every id in the stream is run-unique.