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
where
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 Scenario
s 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
Rule
s and Feature
s. 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§
sourcetype Cli: Args
type Cli: Args
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.
sourcetype EventStream: Stream<Item = Result<Event<Cucumber<World>>>>
type EventStream: Stream<Item = Result<Event<Cucumber<World>>>>
Output events [Stream
].