Revert "fix: not taking screenshots for errored tests. needs to be better"
This reverts commit 208bedc7ff
.
This commit is contained in:
parent
208bedc7ff
commit
d515b270f6
@ -11,7 +11,7 @@ abstract class BrowserTest extends \PHPUnit_Extensions_Selenium2TestCase{
|
|||||||
public function setUp(){
|
public function setUp(){
|
||||||
$this->setHost('localhost');
|
$this->setHost('localhost');
|
||||||
$this->setPort(4444);
|
$this->setPort(4444);
|
||||||
$args=explode(' ',getenv('SeleniumBrowserArgs'));
|
$args=explode(',',getenv('SeleniumBrowserArgs'));
|
||||||
$args[]='screenshot';
|
$args[]='screenshot';
|
||||||
$this->setDesiredCapabilities(['moz:firefoxOptions'=>['args'=>$args]]);
|
$this->setDesiredCapabilities(['moz:firefoxOptions'=>['args'=>$args]]);
|
||||||
$this->setBrowserUrl(getenv('SeleniumBrowserUrl'));
|
$this->setBrowserUrl(getenv('SeleniumBrowserUrl'));
|
||||||
@ -19,13 +19,12 @@ abstract class BrowserTest extends \PHPUnit_Extensions_Selenium2TestCase{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function tearDown(){
|
public function tearDown(){
|
||||||
//echo "STAT:".$this->getStatus()."\n";
|
if ($this->hasFailed()) {
|
||||||
// if ($this->hasFailed()) {
|
|
||||||
if($path=getenv('SeleniumScreenshotPath')){
|
if($path=getenv('SeleniumScreenshotPath')){
|
||||||
$filedata = $this->currentScreenshot();
|
$filedata = $this->currentScreenshot();
|
||||||
file_put_contents($path.get_class($this).'::'.$this->getName().'.png', $filedata);
|
file_put_contents($path.get_class($this).'::'.$this->getName().'.png', $filedata);
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
$this->stop();
|
$this->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user