Index: trunk/phase3/maintenance/tests/selenium/selenium_settings.ini.sample |
— | — | @@ -27,6 +27,6 @@ |
28 | 28 | |
29 | 29 | [SeleniumTests] |
30 | 30 | |
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" |
33 | 33 | |
Index: trunk/phase3/maintenance/tests/selenium/selenium_settings.ini.php52.sample |
— | — | @@ -19,5 +19,5 @@ |
20 | 20 | |
21 | 21 | [testSuite] |
22 | 22 | |
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 |
1 | 17 | + 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 |
1 | 21 | + 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 |
1 | 28 | + 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 |
1 | 49 | + 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 |
1 | 32 | + native |