$this->addOption( 'verbose', 'Be noisier.' );
$this->addOption( 'startserver', 'Start Selenium Server (on localhost) before the run.' );
$this->addOption( 'stopserver', 'Stop Selenium Server (on localhost) after the run.' );
- $this->addOption( 'jUnitLogFile', 'Log results in a specified JUnit log file.', false, true );
+ $this->addOption( 'jUnitLogFile', 'Log results in a specified JUnit log file. Default: empty', false, true );
+ $this->addOption( 'runAgainstGrid', 'The test will be run against a Selenium Grid. Default: false.', false, true );
$this->deleteOption( 'dbpass' );
$this->deleteOption( 'dbuser' );
$this->deleteOption( 'globals' );
if ( !isset( $seleniumSettings['userPassword'] ) ) $seleniumSettings['userPassword'] = '';
if ( !isset( $seleniumSettings['testBrowser'] ) ) $seleniumSettings['testBrowser'] = 'firefox';
if ( !isset( $seleniumSettings['jUnitLogFile'] ) ) $seleniumSettings['jUnitLogFile'] = false;
+ if ( !isset( $seleniumSettings['runAgainstGrid'] ) ) $seleniumSettings['runAgainstGrid'] = false;
// Setup Selenium class
$this->selenium = new Selenium( );
$this->selenium->setAvailableBrowsers( $seleniumBrowsers );
+ $this->selenium->setRunAgainstGrid( $this->getOption( 'runAgainstGrid', $seleniumSettings['runAgainstGrid'] ) );
$this->selenium->setUrl( $this->getOption( 'wikiUrl', $seleniumSettings['wikiUrl'] ) );
$this->selenium->setBrowser( $this->getOption( 'testBrowser', $seleniumSettings['testBrowser'] ) );
$this->selenium->setPort( $this->getOption( 'port', $seleniumSettings['port'] ) );
protected $timeout = 30000;
protected $verbose;
protected $junitlogfile; //processed by phpUnderControl
+ protected $runagainstgrid = false;
/**
* @todo this shouldn't have to be static
return $this->junitlogfile;
}
+ public function setRunAgainstGrid( $runagainstgrid ) {
+ $this->runagainstgrid = $runagainstgrid;
+ }
+
public function setBrowser( $b ) {
+ if ($this->runagainstgrid) {
+ $this->browser = $b;
+ return true;
+ }
if ( !isset( $this->browsers[$b] ) ) {
throw new MWException( "Invalid Browser: $b.\n" );
}