Trait cucumber::Runner

source ·
pub trait Runner<World> {
    type Cli: Args;
    type EventStream: Stream<Item = Result<Event<Cucumber<World>>>>;

    fn run<S>(self, features: S, cli: Self::Cli) -> Self::EventStream
        S: Stream<Item = Result<Feature>> + 'static
; }
Expand description

Executor of Parser output producing Cucumber events for Writer.

Order guarantees

Implementors are expected to source events in a happened-before order. For example event::Scenario::Started for a single Scenario should predate any other events of this Scenario, while event::Scenario::Finished should be the last one. Step events of this Scenario should be emitted in order of declaration in .feature file. But as Scenarios can be executed concurrently, events from one Scenario can be interrupted by events of a different one (which are also following the happened-before order). Those rules are applied also to Rules and Features. If you want to avoid those interruptions for some Scenario, it should be resolved as ScenarioType::Serial by the Runner.

Because of that, Writer, accepting events produced by a Runner has to be Normalized.

All those rules are considered in a Basic reference Runner implementation.

Required Associated Types§

CLI options of this Runner. In case no options should be introduced, just use cli::Empty.

All CLI options from Parser, Runner and Writer will be merged together, so overlapping arguments will cause a runtime panic.

Output events [Stream].

Required Methods§

Executes the given [Stream] of Features transforming it into a [Stream] of executed Cucumber events.