From fe38545fd5c4d2c465a2efc465d6ff1fefbe8cde Mon Sep 17 00:00:00 2001 From: Markus Glaser Date: Sat, 31 Jul 2010 12:00:10 +0000 Subject: [PATCH] changed testrunner in order to run suites instead of single tests. Patch supplied by Dan Nessett --- maintenance/tests/RunSeleniumTests.php | 8 ++++---- ...eleniumTest.php => SimpleSeleniumTestCase.php} | 9 ++++++--- .../tests/selenium/SimpleSeleniumTestSuite.php | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 7 deletions(-) rename maintenance/tests/selenium/{SimpleSeleniumTest.php => SimpleSeleniumTestCase.php} (59%) create mode 100644 maintenance/tests/selenium/SimpleSeleniumTestSuite.php diff --git a/maintenance/tests/RunSeleniumTests.php b/maintenance/tests/RunSeleniumTests.php index f70f279f9e..e872219c8b 100644 --- a/maintenance/tests/RunSeleniumTests.php +++ b/maintenance/tests/RunSeleniumTests.php @@ -46,9 +46,9 @@ $result = new PHPUnit_Framework_TestResult; $logger = new SeleniumTestConsoleLogger; $result->addListener( new SeleniumTestListener( $logger ) ); -$suite = new SeleniumTestSuite; -foreach ( $wgSeleniumTests as $testClass ) { - $suite->addTest( new $testClass ); +foreach ( $wgSeleniumTestSuites as $testSuiteName ) { + $suite = new $testSuiteName; + $suite->addTests(); + $suite->run( $result ); } -$suite->run( $result ); diff --git a/maintenance/tests/selenium/SimpleSeleniumTest.php b/maintenance/tests/selenium/SimpleSeleniumTestCase.php similarity index 59% rename from maintenance/tests/selenium/SimpleSeleniumTest.php rename to maintenance/tests/selenium/SimpleSeleniumTestCase.php index 5ee32cd0ea..848cba82f8 100644 --- a/maintenance/tests/selenium/SimpleSeleniumTest.php +++ b/maintenance/tests/selenium/SimpleSeleniumTestCase.php @@ -1,12 +1,15 @@ open( Selenium::getBaseUrl() . '/index.php?title=Selenium&action=edit' ); + $this->open( Selenium::getBaseUrl() . + '/index.php?title=Selenium&action=edit' ); $this->type( "wpTextbox1", "This is a basic test" ); $this->click( "wpPreview" ); $this->waitForPageToLoad( 10000 ); diff --git a/maintenance/tests/selenium/SimpleSeleniumTestSuite.php b/maintenance/tests/selenium/SimpleSeleniumTestSuite.php new file mode 100644 index 0000000000..4efd8b344d --- /dev/null +++ b/maintenance/tests/selenium/SimpleSeleniumTestSuite.php @@ -0,0 +1,15 @@ +