Skip to content

Commit

Permalink
added background color param to screenshot, no more black background …
Browse files Browse the repository at this point in the history
…on screenshots
  • Loading branch information
conejoninja committed Jun 26, 2014
1 parent a54d922 commit 07e50f7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion PHPUnit/Extensions/SeleniumTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ abstract class PHPUnit_Extensions_SeleniumTestCase extends PHPUnit_Framework_Tes
*/
protected $screenshotUrl = '';

/**
* @var string
*/
protected $screenshotBgColor = '';

/**
* @var integer the number of seconds to wait before declaring
* the Selenium server not reachable
Expand Down Expand Up @@ -1187,8 +1192,12 @@ protected function takeScreenshot()
if (!empty($this->screenshotPath) &&
!empty($this->screenshotUrl)) {
$filename = $this->getScreenshotPath() . $this->testId . '.png';
$kargs = '';
if ($this->screenshotBgColor!='') {
$kargs = 'background=' . $this->screenshotBgColor;
}

$this->drivers[0]->captureEntirePageScreenshot($filename);
$this->drivers[0]->captureEntirePageScreenshot($filename, $kargs);

return 'Screenshot: ' . $this->screenshotUrl . '/' .
$this->testId . ".png\n";
Expand Down

0 comments on commit 07e50f7

Please sign in to comment.