Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

allow video upload options for selenium rc in sausage

  • Loading branch information...
commit 49923633c45688afd7d47074c90183088e06a471 1 parent 930faf3
@jlipps authored
View
2  WebDriverDemo.php
@@ -10,7 +10,7 @@ class WebDriverDemo extends Sauce\Sausage\WebDriverTestCase
'browserName' => 'firefox',
'desiredCapabilities' => array(
'version' => '15',
- 'platform' => 'Windows 2012'
+ 'platform' => 'Windows 2012',
)
)//,
// run Chrome on Linux on Sauce
View
26 src/Sauce/Sausage/SeleniumRCDriver.php
@@ -13,6 +13,10 @@ class SeleniumRCDriver extends \PHPUnit_Extensions_SeleniumTestCase_Driver
protected $access_key;
+ protected $record_video;
+
+ protected $video_upload_on_pass;
+
public function start()
{
foreach (array('browserUrl', 'username', 'access_key', 'browser', 'browser_version', 'os') as $data) {
@@ -27,7 +31,9 @@ public function start()
'os' => $this->os,
'browser' => $this->browser,
'browser-version' => $this->browser_version,
- 'name' => $this->name
+ 'name' => $this->name,
+ 'record-video' => $this->record_video,
+ 'video-upload-on-pass' => $this->video_upload_on_pass,
);
$this->sessionId = $this->getString(
@@ -40,6 +46,24 @@ public function start()
return $this->sessionId;
}
+ public function setRecordVideo($record)
+ {
+ if (!is_bool($record)) {
+ throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'bool');
+ }
+
+ $this->record_video = $record;
+ }
+
+ public function setUploadVideoOnPass($record)
+ {
+ if (!is_bool($record)) {
+ throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'bool');
+ }
+
+ $this->video_upload_on_pass = $record;
+ }
+
public function setUsername($username)
{
if (!is_string($username)) {
View
6 src/Sauce/Sausage/SeleniumRCTestCase.php
@@ -35,7 +35,9 @@ protected function getDriver(array $browser)
'httpTimeout' => 45,
'host' => 'ondemand.saucelabs.com',
'port' => 80,
- 'name' => get_called_class().'::'.$this->getName()
+ 'name' => get_called_class().'::'.$this->getName(),
+ 'record-video' => true,
+ 'video-upload-on-pass' => true,
);
$local_defaults = array(
@@ -93,6 +95,8 @@ protected function getDriver(array $browser)
$driver->setBrowser($browser['browser']);
$driver->setTimeout($browser['timeout']);
$driver->setHttpTimeout($browser['httpTimeout']);
+ $driver->setRecordVideo($browser['record-video']);
+ $driver->setUploadVideoOnPass($browser['video-upload-on-pass']);
$driver->setTestCase($this);
$driver->setTestId($this->testId);
Please sign in to comment.
Something went wrong with that request. Please try again.