r70215 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70214‎ | r70215 | r70216 >
Date:12:00, 31 July 2010
Author:mglaser
Status:ok (Comments)
Tags:
Comment:
changed testrunner in order to run suites instead of single tests. Patch supplied by Dan Nessett
Modified paths:
  • /trunk/phase3/maintenance/tests/RunSeleniumTests.php (modified) (history)
  • /trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTest.php (deleted) (history)
  • /trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestCase.php (added) (history)
  • /trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php (added) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/RunSeleniumTests.php
@@ -46,9 +46,9 @@
4747 $logger = new SeleniumTestConsoleLogger;
4848 $result->addListener( new SeleniumTestListener( $logger ) );
4949
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 );
5354 }
54 -$suite->run( $result );
5555
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
117 + 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
126 + native
Added: svn:keywords
227 + LastChangedDate LastChangedBy Revision Id

Follow-up revisions

RevisionCommit summaryAuthorDate
r70323* modified runTests to run suites instead of single tests. this fixes r70215mglaser08:09, 2 August 2010

Comments

#Comment by Platonides (talk | contribs)   23:22, 31 July 2010
  • SimpleSeleniumTestSuite.php needs native eol-style
  • $wgSeleniumTests (removed in r70217) is still used by includes/specials/SpecialSelenium.php
#Comment by Mglaser (talk | contribs)   08:13, 2 August 2010
  • native eol-style is set in r70265
  • $wgSeleniumTests is replaced in r70323

Status & tagging log