From d515b270f6853a5f5d0f53355ba3bc551fa25895 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 1 Feb 2020 14:56:05 +0000 Subject: [PATCH] Revert "fix: not taking screenshots for errored tests. needs to be better" This reverts commit 208bedc7ff3b2a1d0625a4f10572fafa265a755e. --- src/BrowserTest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/BrowserTest.php b/src/BrowserTest.php index 3c0e8cd..78abbb3 100644 --- a/src/BrowserTest.php +++ b/src/BrowserTest.php @@ -11,7 +11,7 @@ abstract class BrowserTest extends \PHPUnit_Extensions_Selenium2TestCase{ public function setUp(){ $this->setHost('localhost'); $this->setPort(4444); - $args=explode(' ',getenv('SeleniumBrowserArgs')); + $args=explode(',',getenv('SeleniumBrowserArgs')); $args[]='screenshot'; $this->setDesiredCapabilities(['moz:firefoxOptions'=>['args'=>$args]]); $this->setBrowserUrl(getenv('SeleniumBrowserUrl')); @@ -19,13 +19,12 @@ abstract class BrowserTest extends \PHPUnit_Extensions_Selenium2TestCase{ } public function tearDown(){ -//echo "STAT:".$this->getStatus()."\n"; -// if ($this->hasFailed()) { + if ($this->hasFailed()) { if($path=getenv('SeleniumScreenshotPath')){ $filedata = $this->currentScreenshot(); file_put_contents($path.get_class($this).'::'.$this->getName().'.png', $filedata); } -// } + } $this->stop(); }