http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70215

Revision: 70215
Author:   mglaser
Date:     2010-07-31 12:00:10 +0000 (Sat, 31 Jul 2010)

Log Message:
-----------
changed testrunner in order to run suites instead of single tests. Patch 
supplied by Dan Nessett

Modified Paths:
--------------
    trunk/phase3/maintenance/tests/RunSeleniumTests.php

Added Paths:
-----------
    trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestCase.php
    trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php

Removed Paths:
-------------
    trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTest.php

Modified: trunk/phase3/maintenance/tests/RunSeleniumTests.php
===================================================================
--- trunk/phase3/maintenance/tests/RunSeleniumTests.php 2010-07-31 08:03:05 UTC 
(rev 70214)
+++ trunk/phase3/maintenance/tests/RunSeleniumTests.php 2010-07-31 12:00:10 UTC 
(rev 70215)
@@ -46,9 +46,9 @@
 $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 );
 

Deleted: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTest.php
===================================================================
--- trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTest.php      
2010-07-31 08:03:05 UTC (rev 70214)
+++ trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTest.php      
2010-07-31 12:00:10 UTC (rev 70215)
@@ -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( "//d...@id='wikiPreview']/p" );
-               $correct = strstr( $source, "This is a basic test" );
-               $this->assertEquals( $correct, true );
-
-       }
-
-}

Copied: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestCase.php 
(from rev 70213, trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTest.php)
===================================================================
--- trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestCase.php          
                (rev 0)
+++ trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestCase.php  
2010-07-31 12:00:10 UTC (rev 70215)
@@ -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( "//d...@id='wikiPreview']/p" );
+               $correct = strstr( $source, "This is a basic test" );
+               $this->assertEquals( $correct, true );
+
+       }
+
+}

Added: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php
===================================================================
--- trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php         
                (rev 0)
+++ trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php 
2010-07-31 12:00:10 UTC (rev 70215)
@@ -0,0 +1,15 @@
+ <?php
+ 
+require_once(dirname( __FILE__ ) . '/SimpleSeleniumTestCase.php');
+
+class SimpleSeleniumTestSuite extends SeleniumTestSuite
+{
+       public function __construct( $name = 'Basic selenium test suite') {
+               parent::__construct( $name );
+       }
+
+       public function addTests() {
+               $test = new SimpleSeleniumTestCase();
+               parent::addTest( $test );
+       }
+}


Property changes on: 
trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php
___________________________________________________________________
Added: svn:keywords
   + LastChangedDate LastChangedBy Revision Id



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to