Do not show page if exception's not from Mink

This commit is contained in:
Konstantin Kudryashov
2012-12-19 11:37:38 +01:00
parent 1b68c7343f
commit f98a3092ac

View File

@@ -7,6 +7,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Behat\Behat\Event\StepEvent;
use Behat\Mink\Mink;
use Behat\Mink\Exception\Exception as MinkException;
/*
* This file is part of the Behat\MinkExtension.
@@ -80,6 +81,10 @@ class FailureShowListener implements EventSubscriberInterface
return;
}
if (!$event->getException() instanceof MinkException) {
return;
}
if (null === $this->parameters['show_cmd']) {
throw new \RuntimeException('Set "show_cmd" parameter in behat.yml to be able to open page in browser (ex.: "show_cmd: open %s")');
}