r75801 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75800‎ | r75801 | r75802 >
Date:16:29, 1 November 2010
Author:pdhanda
Status:ok (Comments)
Tags:
Comment:
Moving the SimpleSelenium tests into the suites sub dir r75311
Modified paths:
  • /trunk/phase3/maintenance/tests/selenium/SimpleSeleniumConfig.php (deleted) (history)
  • /trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestCase.php (deleted) (history)
  • /trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php (deleted) (history)
  • /trunk/phase3/maintenance/tests/selenium/suites/SimpleSeleniumConfig.php (added) (history)
  • /trunk/phase3/maintenance/tests/selenium/suites/SimpleSeleniumTestCase.php (added) (history)
  • /trunk/phase3/maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php (added) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumConfig.php
@@ -1,15 +0,0 @@
2 -<?php
3 -class SimpleSeleniumConfig {
4 -
5 - public static function getSettings(&$includeFiles, &$globalConfigs) {
6 - $includes = array(
7 - //files that needed to be included would go here
8 - );
9 - $configs = array(
10 - 'wgDefaultSkin' => 'chick'
11 - );
12 - $includeFiles = array_merge( $includeFiles, $includes );
13 - $globalConfigs = array_merge( $globalConfigs, $configs);
14 - return true;
15 - }
16 -}
\ No newline at end of file
Index: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestSuite.php
@@ -1,26 +0,0 @@
2 -<?php
3 -/*
4 - * Sample test suite.
5 - * Two ways to configure MW for these tests
6 - * 1) If you are running multiple test suites, add the following in LocalSettings.php
7 - * require_once("maintenance/tests/selenium/SimpleSeleniumConfig.php");
8 - * $wgSeleniumTestConfigs['SimpleSeleniumTestSuite'] = 'SimpleSeleniumConfig::getSettings';
9 - * OR
10 - * 2) Add the following to your Localsettings.php
11 - * $wgDefaultSkin = 'chick';
12 - */
13 -class SimpleSeleniumTestSuite extends SeleniumTestSuite
14 -{
15 - public function setUp() {
16 - $this->setLoginBeforeTests( false );
17 - parent::setUp();
18 - }
19 - public function addTests() {
20 - $testFiles = array(
21 - 'maintenance/tests/selenium/SimpleSeleniumTestCase.php'
22 - );
23 - parent::addTestFiles( $testFiles );
24 - }
25 -
26 -
27 -}
Index: trunk/phase3/maintenance/tests/selenium/SimpleSeleniumTestCase.php
@@ -1,30 +0,0 @@
2 -<?php
3 -/*
4 - * This test case is part of the SimpleSeleniumTestSuite.
5 - * Configuration for these tests are dosumented as part of SimpleSeleniumTestSuite.php
6 - */
7 -class SimpleSeleniumTestCase extends SeleniumTestCase {
8 - public function testBasic() {
9 - $this->open( $this->getUrl() .
10 - '/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 - * All this test really does is verify that a global var was set.
23 - * It depends on $wgDefaultSkin = 'chick'; being set
24 - */
25 - public function testGlobalVariableForDefaultSkin() {
26 - $this->open( $this->getUrl() . '/index.php?&action=purge' );
27 - $bodyClass = $this->getAttribute( "//body/@class" );
28 - $this-> assertContains('skin-chick', $bodyClass, 'Chick skin not set');
29 - }
30 -
31 -}
Index: trunk/phase3/maintenance/tests/selenium/suites/SimpleSeleniumConfig.php
@@ -0,0 +1,15 @@
 2+<?php
 3+class SimpleSeleniumConfig {
 4+
 5+ public static function getSettings(&$includeFiles, &$globalConfigs) {
 6+ $includes = array(
 7+ //files that needed to be included would go here
 8+ );
 9+ $configs = array(
 10+ 'wgDefaultSkin' => 'chick'
 11+ );
 12+ $includeFiles = array_merge( $includeFiles, $includes );
 13+ $globalConfigs = array_merge( $globalConfigs, $configs);
 14+ return true;
 15+ }
 16+}
\ No newline at end of file
Property changes on: trunk/phase3/maintenance/tests/selenium/suites/SimpleSeleniumConfig.php
___________________________________________________________________
Added: svn:eol-style
117 + native
Index: trunk/phase3/maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php
@@ -0,0 +1,26 @@
 2+<?php
 3+/*
 4+ * Sample test suite.
 5+ * Two ways to configure MW for these tests
 6+ * 1) If you are running multiple test suites, add the following in LocalSettings.php
 7+ * require_once("maintenance/tests/selenium/SimpleSeleniumConfig.php");
 8+ * $wgSeleniumTestConfigs['SimpleSeleniumTestSuite'] = 'SimpleSeleniumConfig::getSettings';
 9+ * OR
 10+ * 2) Add the following to your Localsettings.php
 11+ * $wgDefaultSkin = 'chick';
 12+ */
 13+class SimpleSeleniumTestSuite extends SeleniumTestSuite
 14+{
 15+ public function setUp() {
 16+ $this->setLoginBeforeTests( false );
 17+ parent::setUp();
 18+ }
 19+ public function addTests() {
 20+ $testFiles = array(
 21+ 'maintenance/tests/selenium/SimpleSeleniumTestCase.php'
 22+ );
 23+ parent::addTestFiles( $testFiles );
 24+ }
 25+
 26+
 27+}
Property changes on: trunk/phase3/maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php
___________________________________________________________________
Added: svn:eol-style
128 + native
Added: svn:keywords
229 + LastChangedDate LastChangedBy Revision Id
Index: trunk/phase3/maintenance/tests/selenium/suites/SimpleSeleniumTestCase.php
@@ -0,0 +1,30 @@
 2+<?php
 3+/*
 4+ * This test case is part of the SimpleSeleniumTestSuite.
 5+ * Configuration for these tests are dosumented as part of SimpleSeleniumTestSuite.php
 6+ */
 7+class SimpleSeleniumTestCase extends SeleniumTestCase {
 8+ public function testBasic() {
 9+ $this->open( $this->getUrl() .
 10+ '/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+ * All this test really does is verify that a global var was set.
 23+ * It depends on $wgDefaultSkin = 'chick'; being set
 24+ */
 25+ public function testGlobalVariableForDefaultSkin() {
 26+ $this->open( $this->getUrl() . '/index.php?&action=purge' );
 27+ $bodyClass = $this->getAttribute( "//body/@class" );
 28+ $this-> assertContains('skin-chick', $bodyClass, 'Chick skin not set');
 29+ }
 30+
 31+}
Property changes on: trunk/phase3/maintenance/tests/selenium/suites/SimpleSeleniumTestCase.php
___________________________________________________________________
Added: svn:eol-style
132 + native
Added: svn:keywords
233 + LastChangedDate LastChangedBy Revision Id

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75311Moved tests to a dub directory. Added a stub smoke test that we're going to s...pdhanda15:09, 24 October 2010

Comments

#Comment by Hashar (talk | contribs)   19:22, 1 November 2010

Well done :)

Status & tagging log