Skip to content

Commit

Permalink
feature #33 Supporting all drivers that can make screenshots (4c0n)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.3-dev branch.

Discussion
----------



Commits
-------

87cbaf7 Supporting all drivers that can make screenshots
  • Loading branch information
pamil authored Sep 16, 2020
2 parents cf80d77 + 87cbaf7 commit 9c3ecc0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Listener/FailedStepListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@

use Behat\Behat\EventDispatcher\Event\AfterStepTested;
use Behat\Behat\EventDispatcher\Event\StepTested;
use Behat\Mink\Driver\PantherDriver;
use Behat\Mink\Driver\Selenium2Driver;
use Behat\Mink\Exception\Exception as MinkException;
use Behat\Mink\Exception\UnsupportedDriverActionException;
use Behat\Mink\Mink;
use Behat\Mink\Session;
use Behat\Testwork\Tester\Result\TestResult;
Expand Down Expand Up @@ -105,14 +104,10 @@ private function logPageContent(): void
private function logScreenshot(): void
{
$session = $this->getSession();
$driver = $session->getDriver();

if (!$driver instanceof Selenium2Driver && !$driver instanceof PantherDriver) {
return;
}

try {
$this->saveLog($session->getScreenshot(), 'png');
} catch (UnsupportedDriverActionException $unsupportedDriverActionException) {
} catch (WebDriverException $exception) {}
}

Expand Down

0 comments on commit 9c3ecc0

Please sign in to comment.