Skip to content

Instantly share code, notes, and snippets.

@glennpratt
Created August 16, 2011 16:00
Show Gist options
  • Select an option

  • Save glennpratt/1149422 to your computer and use it in GitHub Desktop.

Select an option

Save glennpratt/1149422 to your computer and use it in GitHub Desktop.
<?php
if ($rc != 'local') {
// Need SauceLabs PEAR.
include_once 'PHPUnit/Extensions/SeleniumTestCase/SauceOnDemandTestCase.php';
class SeleniumWrapper extends PHPUnit_Extensions_SeleniumTestCase_SauceOnDemandTestCase {
// @TODO - Allow this list to be configured.
public static $browsers = array(
array(
'name' => 'Firefox 5 on Windows',
'os' => 'Windows 2003',
'browser' => 'firefox',
'browserVersion' => '5.'
),
array(
'name' => 'Internet Explorer 7 on Windows',
'os' => 'Windows 2003',
'browser' => 'iexplore',
'browserVersion' => '7.'
)
);
public function connect($browser) {
$this->setHttpTimeout(90000);
}
}
} else {
// Don't need SauceLabs PEAR, just use PHPUnit.
class SeleniumWrapper extends PHPUnit_Extensions_SeleniumTestCase {
public function connect() {
$this->setBrowser(SELENIUM_BROWSER);
$this->setHost('localhost');
$this->setPort(SELENIUM_BROWSER_PORT);
}
}
}
?>
@christianchristensen
Copy link
Copy Markdown

"class SeleniumWrapper extends PHPUnit_Extensions_SeleniumTestCase_SauceOnDemandTestCase"
"class SeleniumWrapper extends PHPUnit_Extensions_SeleniumTestCase"

this could be

"class SeleniumWrapper extends xyzParent implements iSeleniumWrapper"

@christianchristensen
Copy link
Copy Markdown

Actually b/c this is PHP, I venture that class SeleniumWrapper extends $parentclass implements iSeleniumWrapper might work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment