r75311 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75310‎ | r75311 | r75312 >
Date:15:09, 24 October 2010
Author:pdhanda
Status:ok (Comments)
Tags:
Comment:
Moved tests to a dub directory. Added a stub smoke test that we're going to start populating
Modified paths:
  • /trunk/phase3/maintenance/tests/selenium/selenium_settings.ini.php52.sample (modified) (history)
  • /trunk/phase3/maintenance/tests/selenium/selenium_settings.ini.sample (modified) (history)
  • /trunk/phase3/maintenance/tests/selenium/suites (added) (history)
  • /trunk/phase3/maintenance/tests/selenium/suites/MediawikiCoreSmokeTestCase.php (added) (history)
  • /trunk/phase3/maintenance/tests/selenium/suites/MediawikiCoreSmokeTestSuite.php (added) (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/selenium_settings.ini.sample
@@ -27,6 +27,6 @@
2828
2929 [SeleniumTests]
3030
31 -testSuite[SimpleSeleniumTestSuite] = "maintenance/tests/selenium/SimpleSeleniumTestSuite.php"
32 -testSuite[PagedTiffHandlerSeleniumTestSuite] = "extensions/PagedTiffHandler/selenium/PagedTiffHandlerTestSuite.php"
 31+testSuite[SimpleSeleniumTestSuite] = "maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php"
 32+testSuite[WikiEditorTestSuite] = "extensions/WikiEditor/selenium/WikiEditorTestSuite.php"
3333
Index: trunk/phase3/maintenance/tests/selenium/selenium_settings.ini.php52.sample
@@ -19,5 +19,5 @@
2020
2121 [testSuite]
2222
23 -SimpleSeleniumTestSuite = "maintenance/tests/selenium/SimpleSeleniumTestSuite.php"
24 -PagedTiffHandlerSeleniumTestSuite = "extensions/PagedTiffHandler/selenium/PagedTiffHandlerTestSuite.php"
 23+SimpleSeleniumTestSuite = "maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php"
 24+WikiEditorTestSuite = "extensions/WikiEditor/selenium/WikiEditorTestSuite.php"
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/MediawikiCoreSmokeTestSuite.php
@@ -0,0 +1,19 @@
 2+<?php
 3+/*
 4+ * Stubs for now. We're going to start populating this test.
 5+ */
 6+class MediawikiCoreSmokeTestSuite extends SeleniumTestSuite
 7+{
 8+ public function setUp() {
 9+ $this->setLoginBeforeTests( false );
 10+ parent::setUp();
 11+ }
 12+ public function addTests() {
 13+ $testFiles = array(
 14+ 'maintenance/tests/selenium/suites/MediawikiCoreSmokeTestCase.php'
 15+ );
 16+ parent::addTestFiles( $testFiles );
 17+ }
 18+
 19+
 20+}
Property changes on: trunk/phase3/maintenance/tests/selenium/suites/MediawikiCoreSmokeTestSuite.php
___________________________________________________________________
Added: svn:eol-style
121 + 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/suites/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
Index: trunk/phase3/maintenance/tests/selenium/suites/MediawikiCoreSmokeTestCase.php
@@ -0,0 +1,47 @@
 2+<?php
 3+/*
 4+ * Stub of tests be need as part of the hack-a-ton
 5+ */
 6+class MediawikiCoreSmokeTestCase extends SeleniumTestCase {
 7+ public function testUserLogin() {
 8+
 9+ }
 10+
 11+ public function testChangeUserPreference() {
 12+
 13+ }
 14+
 15+ /*
 16+ * TODO: generalize this test to be reusable for different skins
 17+ */
 18+ public function testCreateNewPageVector() {
 19+
 20+ }
 21+
 22+ /*
 23+ * TODO: generalize this test to be reusable for different skins
 24+ */
 25+ public function testEditExistingPageVector() {
 26+
 27+ }
 28+
 29+ /*
 30+ * TODO: generalize this test to be reusable for different skins
 31+ */
 32+ public function testCreateNewPageMonobook() {
 33+
 34+ }
 35+
 36+ /*
 37+ * TODO: generalize this test to be reusable for different skins
 38+ */
 39+ public function testEditExistingPageMonobook() {
 40+
 41+ }
 42+
 43+ public function testImageUpload() {
 44+
 45+ }
 46+
 47+
 48+}
Property changes on: trunk/phase3/maintenance/tests/selenium/suites/MediawikiCoreSmokeTestCase.php
___________________________________________________________________
Added: svn:eol-style
149 + native
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

Follow-up revisions

RevisionCommit summaryAuthorDate
r75800Removing these files so that I can move them with history :P r75311pdhanda16:28, 1 November 2010
r75801Moving the SimpleSelenium tests into the suites sub dir r75311pdhanda16:29, 1 November 2010

Comments

#Comment by Hashar (talk | contribs)   15:23, 24 October 2010

I love how subversion make us loose history  :-b

#Comment by Platonides (talk | contribs)   17:46, 25 October 2010

That was pdhanda not using svn mv / svn cp. Now it would need to be done manually. Although since this move kept the previous files, looks easier to revert and redo correctly.

Status & tagging log