Test file deleted from Calcey
authornadeesha <nadeesha@users.mediawiki.org>
Thu, 2 Dec 2010 04:21:29 +0000 (04:21 +0000)
committernadeesha <nadeesha@users.mediawiki.org>
Thu, 2 Dec 2010 04:21:29 +0000 (04:21 +0000)
maintenance/tests/selenium/suites/AddContentToNewPageTestCase.php [new file with mode: 0644]
maintenance/tests/selenium/suites/AddNewPageTestCase.php [new file with mode: 0644]
maintenance/tests/selenium/suites/DeletePageAdminTestCase.php [new file with mode: 0644]
maintenance/tests/selenium/suites/MediaWikiCommonFunc.php [new file with mode: 0644]
maintenance/tests/selenium/suites/MediaWikiEditorConfig.php [new file with mode: 0644]
maintenance/tests/selenium/suites/MediaWikiEditorTestSuite.php [new file with mode: 0644]
maintenance/tests/selenium/suites/PageSearchTestCase.php [new file with mode: 0644]
maintenance/tests/selenium/suites/calcey.txt [deleted file]

diff --git a/maintenance/tests/selenium/suites/AddContentToNewPageTestCase.php b/maintenance/tests/selenium/suites/AddContentToNewPageTestCase.php
new file mode 100644 (file)
index 0000000..be9253a
--- /dev/null
@@ -0,0 +1,258 @@
+<?php\r
+/* \r
+ * This test case is part of the SimpleSeleniumTestSuite.\r
+ * Configuration for these tests are dosumented as part of SimpleSeleniumTestSuite.php\r
+ */\r
+class AddContentToNewPageTestCase extends SeleniumTestCase{\r
+\r
+        // Add bold text and verify output\r
+        public function testAddBoldText(){\r
+                $blnElementPresent = False;\r
+                $blnTextPresent = False;\r
+                $this->getExistingPage();\r
+                $this->clickEditLink();\r
+                $this->loadWikiEditor();\r
+                $this->clearWikiEditor();\r
+                $this->click( "//*[@id='mw-editbutton-bold']" );\r
+                $this->clickShowPreviewBtn();\r
+                $this->waitForPageToLoad( "600000" );\r
+                \r
+                try{\r
+                    $this->assertTrue($this->isElementPresent("//div[@id='wikiPreview']/p/b"));\r
+                    $blnElementPresent = True;\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    $blnElementPresent = False;\r
+                }\r
+\r
+                try{\r
+                    $this->assertTrue($this->isTextPresent( "Bold text" ));\r
+                    $blnTextPresent = True;\r
+\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    $blnTextPresent = False;\r
+                }\r
+\r
+                 // Verify bold text displayed on mediawiki preview\r
+                if (( $blnElementPresent = True ) && ( $blnTextPresent = True )){\r
+                    echo "\n Pass : Bold text displayed in the preview \n";\r
+                }\r
+                else{\r
+                     echo "\n Fail : Bold text displayed in the preview \n";\r
+                }\r
+        }\r
+        \r
+        // Add italic text and verify output\r
+        public function testAddItalicText(){\r
+                $this->getExistingPage();\r
+                $this->clickEditLink();\r
+                $this->loadWikiEditor();\r
+                $this->clearWikiEditor();\r
+                $this->click( "//*[@id='mw-editbutton-italic']" );\r
+                $this->clickShowPreviewBtn();\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                // Verify italic text displayed on mediawiki preview\r
+                try{\r
+                    $this->assertTrue($this->isElementPresent("//div[@id='wikiPreview']/p/i"));\r
+                    $blnElementPresent = True;\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    $blnElementPresent = False;\r
+                }\r
+\r
+                try{\r
+                    $this->assertTrue($this->isTextPresent( "Italic text" ));\r
+                    $blnTextPresent = True;\r
+\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    $blnTextPresent = False;\r
+                }\r
+\r
+                 // Verify italic text displayed on mediawiki preview\r
+                if (( $blnElementPresent = True ) && ( $blnTextPresent = True )){\r
+                    echo "\n Pass : Italic text displayed in the preview \n";\r
+                }\r
+                else{\r
+                     echo "\n Fail : Italic text displayed in the preview \n";\r
+                }\r
+\r
+        }\r
+\r
+        // Add internal link for a new page and verify output in the preview\r
+        public function testAddInternalLinkNewPage(){\r
+                $this->getExistingPage();\r
+                $this->clickEditLink();\r
+                $this->loadWikiEditor();\r
+                $this->clearWikiEditor();\r
+                $this->click( "//*[@id='mw-editbutton-link']" );\r
+                $this->clickShowPreviewBtn();\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                // Verify internal link displayed on mediawiki preview\r
+                $source = $this->getText( "//*[@id='wikiPreview']/p/a" );\r
+                $correct = strstr( $source, "Link title" );\r
+                try{\r
+                    $this->assertEquals( $correct, true );\r
+                    echo "\n Pass : Internal link displayed in the preview \n";\r
+\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    echo "\n Pass : Internal link displayed in the preview \n";\r
+                }\r
+\r
+                $this->click( "link=Link title" );\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                // Verify internal link open as a new page - editing mode\r
+                $source = $this->getText( "firstHeading" );\r
+                $correct = strstr( $source, "Editing Link title" );\r
+                try{\r
+                    $this->assertEquals( $correct, true );\r
+                     echo "\n Pass : Internal link opened as a new page in the editing mode \n";\r
+\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    echo "\n Fail : Internal link opened as a new page in the editing mode \n";\r
+                }\r
+          }\r
+\r
+        // Add external link and verify output in the preview\r
+        public function testAddExternalLink(){\r
+                $this->getExistingPage();\r
+                $this->clickEditLink();\r
+                $this->loadWikiEditor();\r
+                $this->clearWikiEditor();\r
+                $this->click( "//*[@id='mw-editbutton-extlink']" );\r
+                $this->type( "wpTextbox1", "[http://www.google.com Google]" );\r
+                $this->clickShowPreviewBtn();\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                // Verify external links displayed on mediawiki preview\r
+                $source = $this->getText( "//*[@id='wikiPreview']/p/a" );\r
+                $correct = strstr( $source, "Google" );\r
+\r
+                try{\r
+                    $this->assertEquals( $correct, true );\r
+                    echo "\n Pass : External link displayed in the preview \n";\r
+\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    echo "\n Fail : External link displayed in thw preview \n";\r
+                }\r
+\r
+                $this->click( "link=Google" );\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                // Verify external link opens\r
+                $source = $this->getTitle();\r
+                $correct = strstr( $source, "Google" );\r
+                try{\r
+                    $this->assertEquals( $correct, true);\r
+                    echo "\n Pass : External link opened \n";\r
+\r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Fail : External link opened \n";\r
+                }\r
+\r
+        }\r
+\r
+        // Add level 2 headline and verify output in the preview\r
+        public function testAddLevel2HeadLine(){\r
+                $blnElementPresent = False;\r
+                $blnTextPresent = False;\r
+                $this->getExistingPage();\r
+                $this->clickEditLink();\r
+                $this->loadWikiEditor();\r
+                $this->clearWikiEditor();\r
+                $this->click( "mw-editbutton-headline" );\r
+                $this->clickShowPreviewBtn();\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                try {\r
+                    $this->assertTrue($this->isElementPresent("//div[@id='wikiPreview']/h2"));\r
+                    $blnElementPresent = True;\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                     $blnElementPresent = False;\r
+                }\r
+\r
+                try{\r
+                    $source = $this->getText( "//*[@id='Headline_text']" );\r
+                    $correct = strstr( $source, "Headline text" );\r
+                    $this->assertEquals( $correct, true );\r
+                    $blnTextPresent = True;\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    $blnTextPresent = False;\r
+                }\r
+\r
+                if(($blnElementPresent = True) && ($blnTextPresent = True)){\r
+                     echo "\n Pass : Headline text displayed in the preview \n";\r
+                }\r
+                else{\r
+                    echo "\n Fail : Headline text displayed in the preview \n";\r
+                }\r
+         }\r
+\r
+        // Add text with ignore wiki format and verify output the preview\r
+        public function testAddNoWikiFormat(){\r
+                $this->getExistingPage();\r
+                $this->clickEditLink();\r
+                $this->loadWikiEditor();\r
+                $this->clearWikiEditor();\r
+                $this->click( "//*[@id='mw-editbutton-nowiki']" );\r
+                $this->clickShowPreviewBtn();\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                // Verify ignore wiki format text displayed on mediawiki preview\r
+                $source = $this->getText( "//div[@id='wikiPreview']/p" );\r
+                $correct = strstr( $source, "Insert non-formatted text here" );\r
+                try{\r
+                    $this->assertEquals( $correct, true );\r
+                    echo "\n Pass : Text available without wiki formats in the preview \n ";\r
+\r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Fail : Text available without wiki formats in the preview\n ";\r
+                }               \r
+        }\r
+\r
+        // Add signature and verify output in the preview\r
+        public function testAddUserSignature(){\r
+                $this->getExistingPage();\r
+                $this->clickEditLink();\r
+                $this->loadWikiEditor();\r
+                $this->clearWikiEditor();\r
+                $this->click( "mw-editbutton-signature" );\r
+                $this->clickShowPreviewBtn();\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                // Verify signature displayed on mediawiki preview\r
+                $source = $this->getText( "//*[@id='wikiPreview']/p/a" );\r
+                $username = $this->getText( "//*[@id='pt-userpage']/a" );\r
+                $correct = strstr( $source, $username );\r
+\r
+                try{\r
+                    $this->assertEquals( $correct, true);\r
+                    echo "\n Pass : Correct name displayed in the preview \n ";\r
+\r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Fail : Correct name displayed in the preview \n ";\r
+                }\r
+        }\r
+\r
+        // Add horizontal line and verify output in the preview\r
+        public function testHorizontalLine(){\r
+                $this->getExistingPage();\r
+                $this->clickEditLink();\r
+                $this->loadWikiEditor();\r
+                $this->clearWikiEditor();\r
+                $this->click( "mw-editbutton-hr" );\r
+\r
+                $this->clickShowPreviewBtn();\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                // Verify horizontal line displayed on mediawiki preview\r
+                try{\r
+                     $this->assertTrue( $this->isElementPresent( "//div[@id='wikiPreview']/hr" ));\r
+                     echo "\n Pass: Horizontal line displayed in the preview \n";\r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Fail : Horizontal line displayed in the preview \n ";\r
+                }\r
+        }\r
+\r
\r
+ }\r
diff --git a/maintenance/tests/selenium/suites/AddNewPageTestCase.php b/maintenance/tests/selenium/suites/AddNewPageTestCase.php
new file mode 100644 (file)
index 0000000..6b03c45
--- /dev/null
@@ -0,0 +1,61 @@
+<?php\r
+/* \r
+ * This test case is part of the SimpleSeleniumTestSuite.\r
+ * Configuration for these tests are dosumented as part of SimpleSeleniumTestSuite.php\r
+ */\r
+class AddNewPageTestCase extends SeleniumTestCase{\r
+    \r
+        // Verify adding a new page\r
+        public function testAddNewPage() {\r
+                $this->open( $this->getUrl() .\r
+                       '/index.php?title=Main_Page&action=edit' );   \r
+                $this->type("searchInput", "new");  \r
+                $this->click("searchGoButton");  \r
+                $this->waitForPageToLoad("600000");\r
+\r
+                // Verify 'Search results' text available\r
+                $source = $this->gettext( "firstHeading" );\r
+                $correct = strstr( $source, "Search results");\r
+                try{\r
+                    $this->assertEquals( $correct, true);\r
+                    echo "\n Pass : Text'Search results' displayed \n";\r
+                    \r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Fail : Text' Search results' displayed  \n" ;\r
+                }\r
+\r
+                // Verify  'Create the page "<page name>" on this wiki' text available\r
+                $source = $this->gettext( "//div[@id='bodyContent']/div[4]/p/b" );\r
+                $correct = strstr ( $source, "Create the page \"New\" on this wiki!" );\r
+                try{\r
+                    $this->assertEquals( $correct, true );\r
+                    echo "\n Pass : Text 'Create the page \"New\" on this wiki!' displayed \n";\r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Fail : Text 'Create the page \"New\" on this wiki!' displayed \n";\r
+                }\r
\r
+               $this->click("link=New");\r
+               $this->waitForPageToLoad("600000");\r
+\r
+               // Verify 'Create' tab available\r
+               try{\r
+                   $this->assertTrue($this->isElementPresent("link=Create"));\r
+                   echo "\n Pass : 'Create' tab displayed \n";\r
+               } catch (PHPUnit_Framework_AssertionFailedError $e) {\r
+                   echo "\n Fail : 'Create' tab displayed \n";\r
+               }\r
+\r
+               $this->type("wpTextbox1", "add new test page");\r
+               $this->click("wpSave");\r
+\r
+                // Verify new page added\r
+                $source = $this->gettext( "firstHeading" );\r
+                $correct = strstr ( $source, "New" );\r
+                try{\r
+                    $this->assertEquals( $correct, true);\r
+                    echo "\n Pass : New page added \n";\r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Fail : New page added \n";\r
+                }\r
+       } \r
+}\r
diff --git a/maintenance/tests/selenium/suites/DeletePageAdminTestCase.php b/maintenance/tests/selenium/suites/DeletePageAdminTestCase.php
new file mode 100644 (file)
index 0000000..c701db9
--- /dev/null
@@ -0,0 +1,68 @@
+<?php\r
+/* \r
+ * This test case is part of the SimpleSeleniumTestSuite.\r
+ * Configuration for these tests are dosumented as part of SimpleSeleniumTestSuite.php\r
+ */\r
+class DeletePageAdminTestCase extends SeleniumTestCase{\r
+    \r
+        // Verify adding a new page\r
+        public function testDeletePage() {\r
+                $this->open( $this->getUrl() .\r
+                       '/index.php?title=Main_Page&action=edit' );   \r
+                $this->click("link=Log out");\r
+                $this->waitForPageToLoad( "30000" );\r
+                $this->click( "link=Log in / create account" );\r
+                $this->waitForPageToLoad( "30000" );\r
+                $this->type( "wpName1", "nadeesha" );\r
+                $this->type( "wpPassword1", "12345" );\r
+                $this->click( "wpLoginAttempt" );\r
+                $this->waitForPageToLoad( "30000" );\r
+                $this->type( "searchInput", "new" );\r
+                $this->click( "searchGoButton");\r
+                $this->waitForPageToLoad( "30000" );\r
+  \r
+                // Verify  'Delete' link displayed\r
+                $source = $this->gettext( "link=Delete" );\r
+                $correct = strstr ( $source, "Delete" );\r
+                try{\r
+                    $this->assertEquals( $correct, true);\r
+                    echo "\n Pass : 'Delete' link displayed \n";\r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Fail : 'Delete' link displayed \n";\r
+                }\r
+                $this->click( "link=Delete" );\r
+                $this->waitForPageToLoad( "30000" );\r
+\r
+                // Verify 'Delete' button available\r
+                $this->assertTrue($this->isElementPresent( "wpConfirmB" ));\r
+\r
+                try{\r
+                    $this->assertTrue($this->isElementPresent( "wpConfirmB" ));\r
+                    echo "\n Pass : 'Delete' button available \n";\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    echo "\n Fail : 'Delete' button available \n";\r
+                }\r
+                $this->click( "wpConfirmB" );\r
+                $this->waitForPageToLoad( "30000" );\r
+                \r
+                 // Verify  'Action complete' text displayed\r
+                $source = $this->gettext( "firstHeading" );\r
+                $correct = strstr ( $source, "Action complete" );\r
+                try{\r
+                    $this->assertEquals( $correct, true );\r
+                    echo "\n Pass : 'Action complete' text displayed \n";\r
+                }catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    echo "\n Fail : 'Action complete' text displayed \n";\r
+                }\r
+\r
+                // Verify  '<Page Name> has been deleted. See deletion log for a record of recent deletions.' text displayed\r
+                $source = $this->gettext( "//div[@id='bodyContent']/p[1]" );\r
+                $correct = strstr ( $source, "\"New\" has been deleted. See deletion log for a record of recent deletions." );\r
+                try{\r
+                    $this->assertEquals( $correct, true );\r
+                    echo "\n Pass : Page deleted successfully \n";\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                    echo "\n Fail : Page deleted successfully \n";\r
+                }\r
+       }  \r
+}\r
diff --git a/maintenance/tests/selenium/suites/MediaWikiCommonFunc.php b/maintenance/tests/selenium/suites/MediaWikiCommonFunc.php
new file mode 100644 (file)
index 0000000..0dee22e
--- /dev/null
@@ -0,0 +1,77 @@
+<?php\r
+\r
+\r
+class MediaWikiCommonFunc{\r
+\r
+        // Getting existing page\r
+        public function getExistingPage(){\r
+                $this->open( $this->getUrl() .\r
+                       '/index.php?title=Main_Page&action=edit' );\r
+                $this->type("searchInput", "new" );\r
+                $this->click("searchGoButton");\r
+                $this->waitForPageToLoad("30000");\r
+        }\r
+\r
+        // Creating new page\r
+        public function getNewPage($pageName){\r
+\r
+                $this->open( $this->getUrl() .\r
+                       '/index.php?title=Main_Page&action=edit' );\r
+                $this->type("searchInput", $pageName );\r
+                $this->click("searchGoButton");\r
+                $this->waitForPageToLoad("30000");\r
+                $this->click("link=".$pageName);\r
+                $this->waitForPageToLoad("600000");\r
+        }\r
+\r
+        // Deleting the given page\r
+        public function deletePage($pageName){\r
+                $this->open( $this->getUrl() .\r
+                       '/index.php?title=Main_Page&action=edit' );\r
+                $this->click("link=Log out");\r
+                $this->waitForPageToLoad( "30000" );\r
+                $this->click( "link=Log in / create account" );\r
+                $this->waitForPageToLoad( "30000" );\r
+                $this->type( "wpName1", "nadeesha" );\r
+                $this->type( "wpPassword1", "12345" );\r
+                $this->click( "wpLoginAttempt" );\r
+                $this->waitForPageToLoad( "30000" );\r
+                $this->type( "searchInput", $pageName );\r
+                $this->click( "searchGoButton");\r
+                $this->waitForPageToLoad( "30000" );\r
+                $this->click( "link=Delete" );\r
+                $this->waitForPageToLoad( "30000" );\r
+                $this->click( "wpConfirmB" );\r
+                $this->waitForPageToLoad( "30000" );\r
+        }\r
+\r
+       // Loading the mediawiki editor\r
+        public function loadWikiEditor(){\r
+                $this->open( $this->getUrl() .\r
+                       '/index.php?title=Main_Page&action=edit' );\r
+        }\r
+\r
+        // Clear the content of the mediawiki editor\r
+        public function clearWikiEditor(){\r
+                $this->type("wpTextbox1", "");\r
+        }\r
+\r
+        // Click on the 'Show preview' button of the mediawiki editor\r
+        public function clickShowPreviewBtn(){\r
+                $this->click("wpPreview");\r
+        }\r
+\r
+        // Click on the 'Save Page' button of the mediawiki editor\r
+        public function clickSavePageBtn(){\r
+                $this->click("wpSave");\r
+        }\r
+\r
+        // Click on the 'Edit' link\r
+        public function clickEditLink(){\r
+                $this->click("link=Edit");\r
+                $this->waitForPageToLoad("30000");\r
+        }\r
+\r
+\r
+        \r
+}\r
diff --git a/maintenance/tests/selenium/suites/MediaWikiEditorConfig.php b/maintenance/tests/selenium/suites/MediaWikiEditorConfig.php
new file mode 100644 (file)
index 0000000..a2b53f4
--- /dev/null
@@ -0,0 +1,16 @@
+<?php\r
+class MediaWikiEditorConfig {\r
+       \r
+       public static function getSettings(&$includeFiles, &$globalConfigs) {\r
+               $includes = array(\r
+                       //files that needed to be included would go here\r
+                        'maintenance/tests/selenium/suites/MediaWikiCommonFunc.php'\r
+               );\r
+               $configs = array(\r
+                       'wgDefaultSkin' => 'chick'\r
+               );\r
+               $includeFiles = array_merge( $includeFiles, $includes );\r
+               $globalConfigs = array_merge( $globalConfigs, $configs);\r
+               return true; \r
+       }\r
+}
\ No newline at end of file
diff --git a/maintenance/tests/selenium/suites/MediaWikiEditorTestSuite.php b/maintenance/tests/selenium/suites/MediaWikiEditorTestSuite.php
new file mode 100644 (file)
index 0000000..0e5caf3
--- /dev/null
@@ -0,0 +1,30 @@
+<?php\r
+/*\r
+ * Sample test suite. \r
+ * Two ways to configure MW for these tests\r
+ * 1) If you are running multiple test suites, add the following in LocalSettings.php\r
+ * require_once("maintenance/tests/selenium/SimpleSeleniumConfig.php");\r
+ * $wgSeleniumTestConfigs['SimpleSeleniumTestSuite'] = 'SimpleSeleniumConfig::getSettings';\r
+ * OR\r
+ * 2) Add the following to your Localsettings.php\r
+ * $wgDefaultSkin = 'chick';\r
+ */\r
+class MediaWikiEditorTestSuite extends SeleniumTestSuite\r
+{\r
+       public function setUp() {\r
+               $this->setLoginBeforeTests( True );\r
+               parent::setUp();\r
+       } \r
+       public function addTests() {\r
+               $testFiles = array(\r
+                    'maintenance/tests/selenium/suites/AddNewPageTestCase.php',\r
+                    'maintenance/tests/selenium/suites/AddContentToNewPageTestCase.php',\r
+                    'maintenance/tests/selenium/suites/DeletePageAdminTestCase.php',\r
+                    'maintenance/tests/selenium/suites/PageSearchTestCase.php'\r
+\r
+               );\r
+               parent::addTestFiles( $testFiles );\r
+       }\r
+\r
+\r
+}\r
diff --git a/maintenance/tests/selenium/suites/PageSearchTestCase.php b/maintenance/tests/selenium/suites/PageSearchTestCase.php
new file mode 100644 (file)
index 0000000..46ccce1
--- /dev/null
@@ -0,0 +1,123 @@
+<?php\r
+/* \r
+ * This test case is part of the SimpleSeleniumTestSuite.\r
+ * Configuration for these tests are dosumented as part of SimpleSeleniumTestSuite.php\r
+ */\r
+class PageSearchTestCase extends SeleniumTestCase{\r
+\r
+             // Verify the functionality of the 'Go' button\r
+             public function testPageSearchBtnGo(){\r
+\r
+                $this->open( $this->getUrl() .\r
+                       '/index.php?title=Main_Page&action=edit' );\r
+                $this->type( "searchInput", "calcey qa" );\r
+                $this->click( "searchGoButton" );\r
+                $this->waitForPageToLoad( "600000" );\r
+\r
+                // Verify  no page matched with the entered search text\r
+                $source = $this->gettext( "//div[@id='bodyContent']/div[4]/p/b" );\r
+                $correct = strstr ( $source, "Create the page \"Calcey qa\" on this wiki!" );\r
+\r
+                try{\r
+                    $this->assertEquals( $correct, true );\r
+                    echo "\n Pass : No page matched with the entered search text using the 'Go' button \n";\r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Pass : No page matched with the entered search text using the 'Go' button \n";\r
+                }\r
+\r
+               $this->click( "link=Calcey qa" );\r
+               $this->waitForPageToLoad( "600000" );\r
+\r
+               $this->type( "wpTextbox1", "Calcey QA team" );\r
+               $this->click( "wpSave" );\r
+               $this->waitForPageToLoad( "600000" );\r
+\r
+            }\r
+\r
+            // Verify the functionality of the 'Search' button\r
+            public function testPageSearchBtnSearch(){\r
+\r
+                $this->open( $this->getUrl() .\r
+                       '/index.php?title=Main_Page&action=edit' );\r
+                $this->type( "searchInput", "Calcey web" );\r
+                $this->click( "mw-searchButton" );\r
+                $this->waitForPageToLoad( "30000" );\r
+\r
+                 // Verify  no page is available as the search text\r
+                $source = $this->gettext( "//div[@id='bodyContent']/div[4]/p[2]/b" );\r
+                $correct = strstr ( $source, "Create the page \"Calcey web\" on this wiki!" );\r
+\r
+                try{\r
+                    $this->assertEquals( $correct, true );\r
+                    echo "\n Pass : No page matched with the entered search text using the 'Search' button \n";\r
+                } catch (PHPUnit_Framework_AssertionFailedError $e){\r
+                    echo "\n Pass : No page matched with the entered search text using the 'Search' button \n";\r
+                }\r
+\r
+               $this->click( "link=Calcey web" );\r
+               $this->waitForPageToLoad( "600000" );\r
+\r
+               $this->type( "wpTextbox1", "Calcey web team" );\r
+               $this->click( "wpSave" );\r
+               $this->waitForPageToLoad( "600000" );\r
+\r
+\r
+               // Verify saved page is opened  when the exact page name is given\r
+               $this->type( "searchInput", "Calcey web" );\r
+               $this->click( "mw-searchButton" );\r
+               $this->waitForPageToLoad( "30000" );\r
+\r
+               $source = $this->getText( "//*[@id='bodyContent']/div[4]/p/b" );\r
+               $correct = strstr( $source, "There is a page named \"Calcey web\" on this wiki." );\r
+\r
+               try{\r
+                   $this->assertEquals( $correct, true );\r
+                   echo "\n Pass : Exact page matched with the entered search text using 'Search' button \n";\r
+               } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                   echo "\n Fail : Exact page matched with the entered search text using 'Search' button \n";\r
+               }\r
+\r
+\r
+               // Verify resutls available when partial page name is entered as the search text\r
+\r
+               $this->type( "searchInput", "Calcey" );\r
+               $this->click( "mw-searchButton" );\r
+               $this->waitForPageToLoad( "30000" );\r
+\r
+               //  Verify text avaialble in the search result under the page titles\r
+               if($this->isElementPresent( "Page_title_matches" )){\r
+                   try{\r
+                       $textPageTitle = $this->getText( "//*[@id='bodyContent']/div[4]/ul[1]/li[1]/div[1]/a" );\r
+                       $this->assertContains( 'Calcey', $textPageTitle );\r
+                       echo "\n Pass : Results displayed under 'Page title matches' heading for the partial title match match using the 'Search' button\n";\r
+                } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                       echo "\n Fail : Results displayed under 'Page title matches' heading for the partial title match match using the 'Search' button \n";\r
+                }\r
+               }\r
+               else{\r
+                    echo "\n Pass : No results avaialble for the 'Page title matches' heading for the partial title match using the 'Search' button \n";\r
+               }\r
+\r
+                //  Verify text avaialble in the search result under the page text\r
+                if($this->isElementPresent( "Page_text_matches" )){\r
+                    try{\r
+                        $textPageText = $this->getText( "//*[@id='bodyContent']/div[4]/ul[2]/li[2]/div[2]/span" );\r
+                        $this->assertContains( 'Calcey', $textPageText );\r
+                        \r
+                        echo "\n Pass : Results displayed under 'Page text matches' heading for the partial text match using the 'Search' button \n";\r
+\r
+                    } catch ( PHPUnit_Framework_AssertionFailedError $e ){\r
+                        echo "\n Fail : Results displayed under 'Page text matches' heading for the partial text match using the 'Search' button \n";\r
+                    }\r
+                }\r
+                else{\r
+                    echo "\n Pass : No results avaialble for the 'Page text matches' heading for the partial title match using the 'Search' button\n";\r
+                }\r
+               $this->deletePage("Calcey QA");\r
+               $this->deletePage("Calcey web");\r
+               \r
+         }\r
+\r
+\r
+        \r
+}\r
diff --git a/maintenance/tests/selenium/suites/calcey.txt b/maintenance/tests/selenium/suites/calcey.txt
deleted file mode 100644 (file)
index e69de29..0000000