MDL-73883 behat: Display actual step during testing

Because of the way in which we check for exceptions, we always show the
following string during behat pretty output:

    behat_hooks::i_look_for_exceptions()

We can easily modify this to only show this value when the
i_look_for_exceptions() test itself fails, but otherwise to show the
actual step that is run.
This commit is contained in:
Andrew Nicols 2022-02-15 14:56:59 +08:00
parent 6652ec135b
commit 0491ccb6c8

View File

@ -125,7 +125,13 @@ class ChainedStepTester implements StepTester {
// Extra step, looking for a moodle exception, a debugging() message or a PHP debug message.
$checkingStep = new StepNode('Given', self::EXCEPTIONS_STEP_TEXT, array(), $step->getLine());
$afterExceptionCheckingEvent = $this->singlesteptester->test($env, $feature, $checkingStep, $skip);
return $this->checkSkipResult($afterExceptionCheckingEvent);
$exceptionCheckResult = $this->checkSkipResult($afterExceptionCheckingEvent);
if (!$exceptionCheckResult->isPassed()) {
return $exceptionCheckResult;
}
return $result;
}
return $this->runChainedSteps($env, $feature, $result, $skip);