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