Moved tests to a dub directory. Added a stub smoke test that we're going to start...
authorPriyanka Dhanda <pdhanda@users.mediawiki.org>
Sun, 24 Oct 2010 15:09:13 +0000 (15:09 +0000)
committerPriyanka Dhanda <pdhanda@users.mediawiki.org>
Sun, 24 Oct 2010 15:09:13 +0000 (15:09 +0000)
maintenance/tests/selenium/selenium_settings.ini.php52.sample
maintenance/tests/selenium/selenium_settings.ini.sample
maintenance/tests/selenium/suites/MediawikiCoreSmokeTestCase.php [new file with mode: 0644]
maintenance/tests/selenium/suites/MediawikiCoreSmokeTestSuite.php [new file with mode: 0644]
maintenance/tests/selenium/suites/SimpleSeleniumConfig.php [new file with mode: 0644]
maintenance/tests/selenium/suites/SimpleSeleniumTestCase.php [new file with mode: 0644]
maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php [new file with mode: 0644]

index 53b5299..ad21037 100644 (file)
@@ -19,5 +19,5 @@ runAgainstGrid        = false
 
 [testSuite]
 
-SimpleSeleniumTestSuite        = "maintenance/tests/selenium/SimpleSeleniumTestSuite.php"
-PagedTiffHandlerSeleniumTestSuite = "extensions/PagedTiffHandler/selenium/PagedTiffHandlerTestSuite.php"
+SimpleSeleniumTestSuite        = "maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php"
+WikiEditorTestSuite = "extensions/WikiEditor/selenium/WikiEditorTestSuite.php"
index c33960d..bacc0a9 100644 (file)
@@ -27,6 +27,6 @@ seleniumserverexecpath = "/opt/local/selenium-remote-control-1.0.3/selenium-serv
 
 [SeleniumTests]
 
-testSuite[SimpleSeleniumTestSuite] = "maintenance/tests/selenium/SimpleSeleniumTestSuite.php"
-testSuite[PagedTiffHandlerSeleniumTestSuite] = "extensions/PagedTiffHandler/selenium/PagedTiffHandlerTestSuite.php"
+testSuite[SimpleSeleniumTestSuite] = "maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php"
+testSuite[WikiEditorTestSuite] = "extensions/WikiEditor/selenium/WikiEditorTestSuite.php"
 
diff --git a/maintenance/tests/selenium/suites/MediawikiCoreSmokeTestCase.php b/maintenance/tests/selenium/suites/MediawikiCoreSmokeTestCase.php
new file mode 100644 (file)
index 0000000..73052a5
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/* 
+ * Stub of tests be need as part of the hack-a-ton
+ */
+class MediawikiCoreSmokeTestCase extends SeleniumTestCase {
+       public function testUserLogin() {
+               
+       }
+       
+       public function testChangeUserPreference() {
+               
+       }
+       
+       /*
+        * TODO: generalize this test to be reusable for different skins
+        */
+       public function testCreateNewPageVector() {
+               
+       }
+       
+       /*
+        * TODO: generalize this test to be reusable for different skins
+        */
+       public function testEditExistingPageVector() {
+               
+       }
+       
+       /*
+        * TODO: generalize this test to be reusable for different skins
+        */
+       public function testCreateNewPageMonobook() {
+               
+       }
+       
+       /*
+        * TODO: generalize this test to be reusable for different skins
+        */
+       public function testEditExistingPageMonobook() {
+               
+       }
+       
+       public function testImageUpload() {
+               
+       }
+       
+
+}
diff --git a/maintenance/tests/selenium/suites/MediawikiCoreSmokeTestSuite.php b/maintenance/tests/selenium/suites/MediawikiCoreSmokeTestSuite.php
new file mode 100644 (file)
index 0000000..76287b2
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+/*
+ * Stubs for now. We're going to start populating this test.
+ */
+class MediawikiCoreSmokeTestSuite extends SeleniumTestSuite
+{
+       public function setUp() {
+               $this->setLoginBeforeTests( false );
+               parent::setUp();
+       } 
+       public function addTests() {
+               $testFiles = array(
+                       'maintenance/tests/selenium/suites/MediawikiCoreSmokeTestCase.php'
+               );
+               parent::addTestFiles( $testFiles );
+       }
+
+
+}
diff --git a/maintenance/tests/selenium/suites/SimpleSeleniumConfig.php b/maintenance/tests/selenium/suites/SimpleSeleniumConfig.php
new file mode 100644 (file)
index 0000000..cffa83c
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+class SimpleSeleniumConfig {
+       
+       public static function getSettings(&$includeFiles, &$globalConfigs) {
+               $includes = array(
+                       //files that needed to be included would go here
+               );
+               $configs = array(
+                       'wgDefaultSkin' => 'chick'
+               );
+               $includeFiles = array_merge( $includeFiles, $includes );
+               $globalConfigs = array_merge( $globalConfigs, $configs);
+               return true; 
+       }
+}
\ No newline at end of file
diff --git a/maintenance/tests/selenium/suites/SimpleSeleniumTestCase.php b/maintenance/tests/selenium/suites/SimpleSeleniumTestCase.php
new file mode 100644 (file)
index 0000000..8f01b43
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+/* 
+ * This test case is part of the SimpleSeleniumTestSuite.
+ * Configuration for these tests are dosumented as part of SimpleSeleniumTestSuite.php
+ */
+class SimpleSeleniumTestCase extends SeleniumTestCase {
+       public function testBasic() {
+               $this->open( $this->getUrl() . 
+                       '/index.php?title=Selenium&action=edit' );
+               $this->type( "wpTextbox1", "This is a basic test" );
+               $this->click( "wpPreview" );
+               $this->waitForPageToLoad( 10000 );
+
+               // check result
+               $source = $this->getText( "//div[@id='wikiPreview']/p" );
+               $correct = strstr( $source, "This is a basic test" );
+               $this->assertEquals( $correct, true );
+       }
+       
+       /*
+        * All this test really does is verify that a global var was set.
+        * It depends on $wgDefaultSkin = 'chick'; being set
+        */
+       public function testGlobalVariableForDefaultSkin() {
+               $this->open( $this->getUrl() . '/index.php?&action=purge' );
+               $bodyClass = $this->getAttribute( "//body/@class" );
+               $this-> assertContains('skin-chick', $bodyClass, 'Chick skin not set');
+       }
+
+}
diff --git a/maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php b/maintenance/tests/selenium/suites/SimpleSeleniumTestSuite.php
new file mode 100644 (file)
index 0000000..a04f33e
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/*
+ * Sample test suite. 
+ * Two ways to configure MW for these tests
+ * 1) If you are running multiple test suites, add the following in LocalSettings.php
+ * require_once("maintenance/tests/selenium/SimpleSeleniumConfig.php");
+ * $wgSeleniumTestConfigs['SimpleSeleniumTestSuite'] = 'SimpleSeleniumConfig::getSettings';
+ * OR
+ * 2) Add the following to your Localsettings.php
+ * $wgDefaultSkin = 'chick';
+ */
+class SimpleSeleniumTestSuite extends SeleniumTestSuite
+{
+       public function setUp() {
+               $this->setLoginBeforeTests( false );
+               parent::setUp();
+       } 
+       public function addTests() {
+               $testFiles = array(
+                       'maintenance/tests/selenium/suites/SimpleSeleniumTestCase.php'
+               );
+               parent::addTestFiles( $testFiles );
+       }
+
+
+}