Index: trunk/phase3/maintenance/tests/RunSeleniumTests.php |
— | — | @@ -46,9 +46,9 @@ |
47 | 47 | $logger = new SeleniumTestConsoleLogger; |
48 | 48 | $result->addListener( new SeleniumTestListener( $logger ) ); |
49 | 49 | |
50 | | -$suite = new SeleniumTestSuite; |
51 | | -foreach ( $wgSeleniumTests as $testClass ) { |
52 | | - $suite->addTest( new $testClass ); |
| 50 | +foreach ( $wgSeleniumTestSuites as $testSuiteName ) { |
| 51 | + $suite = new $testSuiteName; |
| 52 | + $suite->addTests(); |
| 53 | + $suite->run( $result ); |
53 | 54 | } |
54 | | -$suite->run( $result ); |
55 | 55 | |
Index: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTest.php |
— | — | @@ -1,21 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -class SimpleSeleniumTest extends SeleniumTestCase |
5 | | -{ |
6 | | - public $name = "Basic selenium test"; |
7 | | - |
8 | | - public function runTest() |
9 | | - { |
10 | | - $this->open( Selenium::getBaseUrl() . '/index.php?title=Selenium&action=edit' ); |
11 | | - $this->type( "wpTextbox1", "This is a basic test" ); |
12 | | - $this->click( "wpPreview" ); |
13 | | - $this->waitForPageToLoad( 10000 ); |
14 | | - |
15 | | - // check result |
16 | | - $source = $this->getText( "//div[@id='wikiPreview']/p" ); |
17 | | - $correct = strstr( $source, "This is a basic test" ); |
18 | | - $this->assertEquals( $correct, true ); |
19 | | - |
20 | | - } |
21 | | - |
22 | | -} |
Index: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php |
— | — | @@ -0,0 +1,15 @@ |
| 2 | + <?php
|
| 3 | +
|
| 4 | +require_once(dirname( __FILE__ ) . '/SimpleSeleniumTestCase.php');
|
| 5 | +
|
| 6 | +class SimpleSeleniumTestSuite extends SeleniumTestSuite
|
| 7 | +{
|
| 8 | + public function __construct( $name = 'Basic selenium test suite') {
|
| 9 | + parent::__construct( $name );
|
| 10 | + }
|
| 11 | +
|
| 12 | + public function addTests() {
|
| 13 | + $test = new SimpleSeleniumTestCase();
|
| 14 | + parent::addTest( $test );
|
| 15 | + }
|
| 16 | +}
|
Property changes on: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php |
___________________________________________________________________ |
Added: svn:keywords |
1 | 17 | + LastChangedDate LastChangedBy Revision Id |
Index: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestCase.php |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class SimpleSeleniumTestCase extends SeleniumTestCase |
| 5 | +{ |
| 6 | + public function __construct( $name = 'Basic selenium test') { |
| 7 | + parent::__construct( $name ); |
| 8 | + } |
| 9 | + |
| 10 | + public function runTest() |
| 11 | + { |
| 12 | + $this->open( Selenium::getBaseUrl() . |
| 13 | + '/index.php?title=Selenium&action=edit' ); |
| 14 | + $this->type( "wpTextbox1", "This is a basic test" ); |
| 15 | + $this->click( "wpPreview" ); |
| 16 | + $this->waitForPageToLoad( 10000 ); |
| 17 | + |
| 18 | + // check result |
| 19 | + $source = $this->getText( "//div[@id='wikiPreview']/p" ); |
| 20 | + $correct = strstr( $source, "This is a basic test" ); |
| 21 | + $this->assertEquals( $correct, true ); |
| 22 | + |
| 23 | + } |
| 24 | + |
| 25 | +} |
Property changes on: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestCase.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 26 | + native |
Added: svn:keywords |
2 | 27 | + LastChangedDate LastChangedBy Revision Id |