public function afterStep(AfterStepTested $event)
{
$testResult = $event->getTestResult();
if (!$testResult instanceof ExecutedStepResult) {
return;
}
$httpCallResult = new HttpCallResult($testResult->getCallResult()->getReturn());
if ($this->contextSupportedVoter->vote($httpCallResult)) {
$this->httpCallResultPool->store($httpCallResult);
return true;
}
// For now to avoid modification on MinkContext
// We add fallback on Mink
try {
$this->httpCallResultPool->store(new HttpCallResult($this->mink->getSession()->getPage()->getContent()));
} catch (\LogicException $e) {
// Mink has no response
} catch (\Behat\Mink\Exception\DriverException $e) {
// No Mink
}
}