trait StepHelper (View source)

Helpers for working with steps

Note: Add @retry to any feature / scenario to make it retryable

Methods

protected
ScenarioInterface
getStepScenario(FeatureNode $feature, NodeInterface $step)

Get scenario from step in a feature node See https://github.com/Behat/Behat/issues/653

protected
mixed
retryThrowable(callable $callback, int $timeout = 3)

Retry until no exceptions are thrown, or until $timeout seconds are reached.

protected
bool
stepHasTag(StepScope|ScenarioScope $event, string $tag)

Check if a step has a given tag

Details

protected ScenarioInterface getStepScenario(FeatureNode $feature, NodeInterface $step)

Get scenario from step in a feature node See https://github.com/Behat/Behat/issues/653

Parameters

FeatureNode $feature
NodeInterface $step

Return Value

ScenarioInterface

protected mixed retryThrowable(callable $callback, int $timeout = 3)

Retry until no exceptions are thrown, or until $timeout seconds are reached.

If timeout reached, re-throws the first exception.

Parameters

callable $callback
int $timeout

Return Value

mixed

Exceptions

Exception

protected bool stepHasTag(StepScope|ScenarioScope $event, string $tag)

Check if a step has a given tag

Parameters

StepScope|ScenarioScope $event
string $tag

Return Value

bool