Skip to content

Commit

Permalink
minor fixes/improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Sep 28, 2012
1 parent 2f7ed56 commit 399e4be
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
14 changes: 7 additions & 7 deletions WebDriverDemo.php
Expand Up @@ -12,14 +12,14 @@ class WebDriverDemo extends Sauce\Sausage\WebDriverTestCase
'version' => '15',
'platform' => 'VISTA'
)
),
// run Chrome on Linux on Sauce
array(
'browserName' => 'chrome',
'desiredCapabilities' => array(
'platform' => 'Linux'
)
)//,
// run Chrome on Linux on Sauce
//array(
//'browserName' => 'chrome',
//'desiredCapabilities' => array(
//'platform' => 'Linux'
//)
//),
// run Chrome locally
//array(
//'browserName' => 'chrome',
Expand Down
1 change: 0 additions & 1 deletion src/Sauce/Sausage/SeleniumRCTestCase.php
Expand Up @@ -99,7 +99,6 @@ protected function getDriver(array $browser)
protected function prepareTestSession()
{
$this->job_id = parent::prepareTestSession();
//$this->setContext("sauce:job-name=".get_called_class().'::'.$this->getName());
$this->postSessionSetUp();
return $this->job_id;
}
Expand Down
13 changes: 9 additions & 4 deletions src/Sauce/Sausage/WebDriverTestCase.php
Expand Up @@ -5,6 +5,7 @@ abstract class WebDriverTestCase extends \PHPUnit_Extensions_Selenium2TestCase
{

protected $start_url = '';
protected $is_local_test = false;

public function setUp()
{
Expand All @@ -18,7 +19,12 @@ public function setUp()

public function setupSpecificBrowser($params)
{
SauceTestCommon::RequireSauceConfig();
// Setting 'local' gives us nice defaults of localhost:4444
$local = (isset($params['local']) && $params['local']);
$this->is_local_test = $local;

if (!$local)
SauceTestCommon::RequireSauceConfig();

// Give some nice defaults
if (!isset($params['seleniumServerRequestsTimeout']))
Expand All @@ -32,8 +38,6 @@ public function setupSpecificBrowser($params)
);
}

// Setting 'local' gives us nice defaults of localhost:4444
$local = (isset($params['local']) && $params['local']);

// Set up host
$sauce_host = SAUCE_USERNAME.':'.SAUCE_API_KEY.'@ondemand.saucelabs.com';
Expand Down Expand Up @@ -100,7 +104,8 @@ public function sendKeys(\PHPUnit_Extensions_Selenium2TestCase_Element $element,

public function tearDown()
{
SauceTestCommon::ReportStatus($this->getSessionId(), !$this->hasFailed());
if (!$this->is_local_test)
SauceTestCommon::ReportStatus($this->getSessionId(), !$this->hasFailed());
}

public function spinAssert($msg, $test, $args=array(), $timeout=10)
Expand Down

0 comments on commit 399e4be

Please sign in to comment.