changed testrunner in order to run suites instead of single tests. Patch supplied...
authorMarkus Glaser <mglaser@users.mediawiki.org>
Sat, 31 Jul 2010 12:00:10 +0000 (12:00 +0000)
committerMarkus Glaser <mglaser@users.mediawiki.org>
Sat, 31 Jul 2010 12:00:10 +0000 (12:00 +0000)
maintenance/tests/RunSeleniumTests.php
maintenance/tests/selenium/SimpleSeleniumTest.php [deleted file]
maintenance/tests/selenium/SimpleSeleniumTestCase.php [new file with mode: 0644]
maintenance/tests/selenium/SimpleSeleniumTestSuite.php [new file with mode: 0644]

index f70f279..e872219 100644 (file)
@@ -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/SimpleSeleniumTest.php
deleted file mode 100644 (file)
index 5ee32cd..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-class SimpleSeleniumTest extends SeleniumTestCase
-{
-       public $name = "Basic selenium test";
-
-       public function runTest()
-       {
-               $this->open( Selenium::getBaseUrl() . '/index.php?title=Selenium&action=edit' );
-               $this->type( "wpTextbox1", "This is a basic test" );
-               $this->click( "wpPreview" );
-               $this->waitForPageToLoad( 10000 );
-
-               // check result
-               $source = $this->getText( "//div[@id='wikiPreview']/p" );
-               $correct = strstr( $source, "This is a basic test" );
-               $this->assertEquals( $correct, true );
-
-       }
-
-}
diff --git a/maintenance/tests/selenium/SimpleSeleniumTestCase.php b/maintenance/tests/selenium/SimpleSeleniumTestCase.php
new file mode 100644 (file)
index 0000000..848cba8
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+class SimpleSeleniumTestCase extends SeleniumTestCase
+{
+       public function __construct( $name = 'Basic selenium test') {
+               parent::__construct( $name );
+       }
+
+       public function runTest()
+       {
+               $this->open( Selenium::getBaseUrl() . 
+                       '/index.php?title=Selenium&action=edit' );
+               $this->type( "wpTextbox1", "This is a basic test" );
+               $this->click( "wpPreview" );
+               $this->waitForPageToLoad( 10000 );
+
+               // check result
+               $source = $this->getText( "//div[@id='wikiPreview']/p" );
+               $correct = strstr( $source, "This is a basic test" );
+               $this->assertEquals( $correct, true );
+
+       }
+
+}
diff --git a/maintenance/tests/selenium/SimpleSeleniumTestSuite.php b/maintenance/tests/selenium/SimpleSeleniumTestSuite.php
new file mode 100644 (file)
index 0000000..4efd8b3
--- /dev/null
@@ -0,0 +1,15 @@
+ <?php\r
\r
+require_once(dirname( __FILE__ ) . '/SimpleSeleniumTestCase.php');\r
+\r
+class SimpleSeleniumTestSuite extends SeleniumTestSuite\r
+{\r
+       public function __construct( $name = 'Basic selenium test suite') {\r
+               parent::__construct( $name );\r
+       }\r
+\r
+       public function addTests() {\r
+               $test = new SimpleSeleniumTestCase();\r
+               parent::addTest( $test );\r
+       }\r
+}\r