r75254 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75253‎ | r75254 | r75255 >
Date:15:52, 23 October 2010
Author:mglaser
Status:ok
Tags:
Comment:
added settings to run tests against a selenium grid
Modified paths:
  • /trunk/phase3/maintenance/tests/RunSeleniumTests.php (modified) (history)
  • /trunk/phase3/maintenance/tests/selenium/Selenium.php (modified) (history)
  • /trunk/phase3/maintenance/tests/selenium/SeleniumConfig.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/RunSeleniumTests.php
@@ -51,7 +51,8 @@
5252 $this->addOption( 'verbose', 'Be noisier.' );
5353 $this->addOption( 'startserver', 'Start Selenium Server (on localhost) before the run.' );
5454 $this->addOption( 'stopserver', 'Stop Selenium Server (on localhost) after the run.' );
55 - $this->addOption( 'jUnitLogFile', 'Log results in a specified JUnit log file.', false, true );
 55+ $this->addOption( 'jUnitLogFile', 'Log results in a specified JUnit log file. Default: empty', false, true );
 56+ $this->addOption( 'runAgainstGrid', 'The test will be run against a Selenium Grid. Default: false.', false, true );
5657 $this->deleteOption( 'dbpass' );
5758 $this->deleteOption( 'dbuser' );
5859 $this->deleteOption( 'globals' );
@@ -180,10 +181,12 @@
181182 if ( !isset( $seleniumSettings['userPassword'] ) ) $seleniumSettings['userPassword'] = '';
182183 if ( !isset( $seleniumSettings['testBrowser'] ) ) $seleniumSettings['testBrowser'] = 'firefox';
183184 if ( !isset( $seleniumSettings['jUnitLogFile'] ) ) $seleniumSettings['jUnitLogFile'] = false;
 185+ if ( !isset( $seleniumSettings['runAgainstGrid'] ) ) $seleniumSettings['runAgainstGrid'] = false;
184186
185187 // Setup Selenium class
186188 $this->selenium = new Selenium( );
187189 $this->selenium->setAvailableBrowsers( $seleniumBrowsers );
 190+ $this->selenium->setRunAgainstGrid( $this->getOption( 'runAgainstGrid', $seleniumSettings['runAgainstGrid'] ) );
188191 $this->selenium->setUrl( $this->getOption( 'wikiUrl', $seleniumSettings['wikiUrl'] ) );
189192 $this->selenium->setBrowser( $this->getOption( 'testBrowser', $seleniumSettings['testBrowser'] ) );
190193 $this->selenium->setPort( $this->getOption( 'port', $seleniumSettings['port'] ) );
Index: trunk/phase3/maintenance/tests/selenium/Selenium.php
@@ -22,6 +22,7 @@
2323 protected $timeout = 30000;
2424 protected $verbose;
2525 protected $junitlogfile; //processed by phpUnderControl
 26+ protected $runagainstgrid = false;
2627
2728 /**
2829 * @todo this shouldn't have to be static
@@ -145,7 +146,15 @@
146147 return $this->junitlogfile;
147148 }
148149
 150+ public function setRunAgainstGrid( $runagainstgrid ) {
 151+ $this->runagainstgrid = $runagainstgrid;
 152+ }
 153+
149154 public function setBrowser( $b ) {
 155+ if ($this->runagainstgrid) {
 156+ $this->browser = $b;
 157+ return true;
 158+ }
150159 if ( !isset( $this->browsers[$b] ) ) {
151160 throw new MWException( "Invalid Browser: $b.\n" );
152161 }
Index: trunk/phase3/maintenance/tests/selenium/SeleniumConfig.php
@@ -49,6 +49,7 @@
5050 $seleniumSettings['stopserver'] = $configArray['SeleniumSettings']['stopserver'];
5151 $seleniumSettings['seleniumserverexecpath'] = $configArray['SeleniumSettings']['seleniumserverexecpath'];
5252 $seleniumSettings['jUnitLogFile'] = $configArray['SeleniumSettings']['jUnitLogFile'];
 53+ $seleniumSettings['runAgainstGrid'] = $configArray['SeleniumSettings']['runAgainstGrid'];
5354
5455 wfRestoreWarnings();
5556 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r75556r74753, r74755, r75254 added new settings, but didn't update SeleniumConfigur...platonides15:51, 27 October 2010

Status & tagging log