Index: trunk/phase3/includes/specials/SpecialSelenium.php |
— | — | @@ -42,21 +42,24 @@ |
43 | 43 | } |
44 | 44 | |
45 | 45 | function runTests() { |
46 | | - global $wgSeleniumTests, $wgOut; |
| 46 | + global $wgSeleniumTestSuites, $wgOut, $wgSeleniumLogger; |
47 | 47 | SeleniumLoader::load(); |
48 | 48 | |
49 | 49 | $result = new PHPUnit_Framework_TestResult; |
50 | | - $logger = new SeleniumTestHTMLLogger; |
51 | | - $result->addListener( new SeleniumTestListener( $logger ) ); |
52 | | - $logger->setHeaders(); |
| 50 | + $wgSeleniumLogger = new SeleniumTestHTMLLogger; |
| 51 | + $result->addListener( new SeleniumTestListener( $wgSeleniumLogger ) ); |
| 52 | + //$wgSeleniumLogger->setHeaders(); |
53 | 53 | |
54 | 54 | // run tests |
55 | | - $suite = new SeleniumTestSuite; |
56 | | - foreach ( $wgSeleniumTests as $testClass ) { |
57 | | - $suite->addTest( new $testClass ); |
| 55 | + $wgOut->addHTML( '<div class="selenium">' ); |
| 56 | + |
| 57 | + // for some really strange reason, foreach doesn't work here. It produces an infinite loop, |
| 58 | + // executing only the first test suite. |
| 59 | + for ( $i = 0; $i < count( $wgSeleniumTestSuites ); $i++ ) { |
| 60 | + $suite = new $wgSeleniumTestSuites[$i]; |
| 61 | + $suite->addTests(); |
| 62 | + $suite->run( $result ); |
58 | 63 | } |
59 | | - $wgOut->addHTML( '<div class="selenium">' ); |
60 | | - $suite->run( $result ); |
61 | 64 | $wgOut->addHTML( '</div>' ); |
62 | 65 | } |
63 | 66 | } |