http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65269

Revision: 65269
Author:   bhagya
Date:     2010-04-19 11:41:23 +0000 (Mon, 19 Apr 2010)

Log Message:
-----------
Detailed scenarios of dialogs

Modified Paths:
--------------
    
trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php

Modified: 
trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php
===================================================================
--- 
trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php
      2010-04-19 11:40:50 UTC (rev 65268)
+++ 
trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php
      2010-04-19 11:41:23 UTC (rev 65269)
@@ -11,6 +11,7 @@
         parent::setUp();
     }
 
+    
     // Add a internal link and verify
     function testInternalLink(){
  
@@ -28,12 +29,92 @@
         $this->click("//div[13]/div[11]/button[1]");
         $this->click("wpPreview");
         $this->waitForPageToLoad("30000");
-        $this->assertEquals("Daimler-Chrysler", 
$this->getText("link=Daimler-Chrysler"));
+        try {
+            $this->assertEquals("Daimler-Chrysler", 
$this->getText("link=Daimler-Chrysler"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        $this->click("link=Daimler-Chrysler");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertTrue($this->isTextPresent("Daimler-Chrysler"), 
$this->getText("firstHeading"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        parent::doLogout();
 
+    }
+
+    // Add a internal link with different display text and verify
+    function testInternalLinkWithDisplayText(){
+
+        parent::doOpenLink();
+        parent::doLogin();
+        $this->click("link=Random article");
+        $this->waitForPageToLoad("30000");
+        $this->click("//l...@id='ca-edit']/a/span");
+        $this->waitForPageToLoad("30000");
+        $this->type("wpTextbox1", "");
+        $this->click("link=Link");
+        $this->type("wpTextbox1", "");
+        $this->type("wikieditor-toolbar-link-int-target", "Fashion Island");
+        $this->type("wikieditor-toolbar-link-int-text", "Fashion Island Test");
+        
$this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists"));
+        $this->assertEquals("on", 
$this->getValue("wikieditor-toolbar-link-type-int"));
+        $this->click("//div[13]/div[11]/button[1]");
+        $this->click("wpPreview");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Fashion Island Test", 
$this->getText("link=Fashion Island Test"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        $this->click("link=Fashion Island Test");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertTrue($this->isTextPresent("Fashion Island"), 
$this->getText("firstHeading"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+
         parent::doLogout();
 
     }
 
+    // Add a internal link with blank display text and verify
+    function testInternalLinkWithBlankDisplayText(){
+
+        parent::doOpenLink();
+        parent::doLogin();
+        $this->click("link=Random article");
+        $this->waitForPageToLoad("30000");
+        $this->click("//l...@id='ca-edit']/a/span");
+        $this->waitForPageToLoad("30000");
+        $this->click("link=Link");
+        $this->type("wikieditor-toolbar-link-int-target", "Magical Mystery 
Tour (film)");
+        $this->type("wikieditor-toolbar-link-int-text", "");
+        
$this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists"));
+        $this->assertEquals("on", 
$this->getValue("wikieditor-toolbar-link-type-int"));
+        $this->click("//div[13]/div[11]/button[1]");
+        $this->click("wpPreview");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Magical Mystery Tour (film)", 
$this->getText("link=Magical Mystery Tour (film)"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        $this->click("link=Magical Mystery Tour (film)");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Magical Mystery Tour (film)", 
$this->getText("firstHeading"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        
+        parent::doLogout();
+
+    }
+
     // Add external link and verify
     function testExternalLink(){
 
@@ -55,15 +136,101 @@
         $this->click("//div[13]/div[11]/button[1]");
         $this->click("wpPreview");
         $this->waitForPageToLoad("30000");
-        $this->assertEquals("www.google.com", 
$this->getText("link=www.google.com"));
+         try {
+            $this->assertEquals("www.google.com", 
$this->getText("link=www.google.com"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        $this->click("link=www.google.com");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Google", $this->getTitle());
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        parent::doLogout();
+    }
 
+    // Add external link with different display text and verify
+    function testExternalLinkWithDisplayText(){
+
+        parent::doOpenLink();
+        parent::doLogin();
+        $this->click("link=Random article");
+        $this->waitForPageToLoad("30000");
+        $this->click("//l...@id='ca-edit']/a/span");
+        $this->waitForPageToLoad("30000");
+        $this->type("wpTextbox1", "");
+        $this->click("link=Link");
+        $this->type("wikieditor-toolbar-link-int-target", "www.google.com");
+        $this->type("wikieditor-toolbar-link-int-text", "Google");
+        try {
+            $this->assertEquals("External link", 
$this->getText("wikieditor-toolbar-link-int-target-status-external"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        $this->assertEquals("on", 
$this->getValue("wikieditor-toolbar-link-type-ext"));
+        $this->click("//div[13]/div[11]/button[1]");
+        $this->click("wpPreview");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Google", $this->getText("link=Google"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        $this->click("link=Google");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Google", $this->getTitle());
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        
         parent::doLogout();
 
     }
 
+    // Add external link with Blank display text and verify
+    function testExternalLinkWithBlankDisplayText(){
+
+        parent::doOpenLink();
+        parent::doLogin();
+        $this->click("link=Random article");
+        $this->waitForPageToLoad("30000");
+        $this->click("//l...@id='ca-edit']/a/span");
+        $this->waitForPageToLoad("30000");
+        $this->type("wpTextbox1", "");
+        $this->click("link=Link");
+        $this->type("wikieditor-toolbar-link-int-target", "www.google.com");
+        $this->type("wikieditor-toolbar-link-int-text", "");
+        try {
+            $this->assertEquals("External link", 
$this->getText("wikieditor-toolbar-link-int-target-status-external"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        $this->assertEquals("on", 
$this->getValue("wikieditor-toolbar-link-type-ext"));
+        $this->click("//div[13]/div[11]/button[1]");
+        $this->click("wpPreview");
+        $this->waitForPageToLoad("30000");
+        try {
+        $this->assertEquals("[1]", $this->getText("link=[1]"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        $this->click("link=[1]");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Google", $this->getTitle());
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+
+        parent::doLogout();
+
+    }
+
     // Add a table and verify
     function testCreateTable(){
-
         parent::doOpenLink();
         parent::doLogin();
         $this->open("/deployment-en/Main_Page");
@@ -85,11 +252,124 @@
         } catch (PHPUnit_Framework_AssertionFailedError $e) {
             array_push($this->verificationErrors, $e->toString());
         }
+        parent::doLogout();
+    }
 
+    // Add a table and verify only with head row
+    function testCreateTableWithHeadRow(){
+        parent::doOpenLink();
+        parent::doLogin();
+        $this->open("/deployment-en/Main_Page");
+        $this->click("link=Random article");
+        $this->waitForPageToLoad("30000");
+        $this->click("//l...@id='ca-edit']/a/span");
+        $this->waitForPageToLoad("30000");
+        parent::doExpandAdvanceSection();
+        $this->type("wpTextbox1", "");
+        $this->click("link=Table");
+        $this->click("wikieditor-toolbar-table-wikitable");
+        $this->type("wikieditor-toolbar-table-dimensions-rows", "4");
+        $this->type("wikieditor-toolbar-table-dimensions-columns", "4");
+        $this->click("//div[3]/button[1]");
+        $this->click("wikieditor-toolbar-table-wikitable");
+        $this->click("wpPreview");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Header text", 
$this->getTable("//d...@id='wikiPreview']/table.0.0"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        
         parent::doLogout();
+    }
 
+    // Add a table and verify only with borders
+    function testCreateTableWithBorders(){
+        parent::doOpenLink();
+        parent::doLogin();
+        $this->open("/deployment-en/Main_Page");
+        $this->click("link=Random article");
+        $this->waitForPageToLoad("30000");
+        $this->click("//l...@id='ca-edit']/a/span");
+        $this->waitForPageToLoad("30000");
+        parent::doExpandAdvanceSection();
+        $this->type("wpTextbox1", "");
+        $this->click("link=Table");
+        $this->click("wikieditor-toolbar-table-dimensions-header");
+        $this->type("wikieditor-toolbar-table-dimensions-columns", "5");
+        $this->click("//div[3]/button[1]");
+        $this->click("wikieditor-toolbar-table-dimensions-header");
+        $this->click("wpPreview");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Example", 
$this->getTable("//d...@id='wikiPreview']/table.1.3"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+
+        parent::doLogout();
     }
 
+    // Add a table and verify only with sort row
+    function testCreateTableWithSortRow(){
+        parent::doOpenLink();
+        parent::doLogin();
+        $this->open("/deployment-en/Main_Page");
+        $this->click("link=Random article");
+        $this->waitForPageToLoad("30000");
+        $this->click("//l...@id='ca-edit']/a/span");
+        $this->waitForPageToLoad("30000");
+        parent::doExpandAdvanceSection();
+        $this->type("wpTextbox1", "");
+        $this->click("link=Table");
+        $this->click("wikieditor-toolbar-table-dimensions-header");
+        $this->click("wikieditor-toolbar-table-wikitable");
+        $this->click("wikieditor-toolbar-table-sortable");
+        $this->type("wikieditor-toolbar-table-dimensions-rows", "2");
+        $this->type("wikieditor-toolbar-table-dimensions-columns", "5");
+        $this->click("//div[3]/button[1]");
+        $this->click("wikieditor-toolbar-table-dimensions-header");
+        $this->click("wikieditor-toolbar-table-wikitable");
+        $this->click("wikieditor-toolbar-table-sortable");
+        $this->click("wpPreview");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Example", 
$this->getTable("sortable_table_id_0.0.0"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        parent::doLogout();
+    }
+
+      // Add a table without headers,borders and sort rows
+    function testCreateTableWithNoSpecialEffects(){
+        parent::doOpenLink();
+        parent::doLogin();
+        $this->open("/deployment-en/Main_Page");
+        $this->click("link=Random article");
+        $this->waitForPageToLoad("30000");
+        $this->click("//l...@id='ca-edit']/a/span");
+        $this->waitForPageToLoad("30000");
+        parent::doExpandAdvanceSection();
+        $this->type("wpTextbox1", "");
+        $this->click("link=Table");
+        $this->click("wikieditor-toolbar-table-wikitable");
+        $this->click("wikieditor-toolbar-table-dimensions-header");
+        $this->type("wikieditor-toolbar-table-dimensions-rows", "6");
+        $this->type("wikieditor-toolbar-table-dimensions-columns", "2");
+        $this->click("//div[3]/button[1]");
+        $this->click("wikieditor-toolbar-table-dimensions-header");
+        $this->click("wikieditor-toolbar-table-wikitable");
+        $this->click("wpPreview");
+        $this->waitForPageToLoad("30000");
+        try {
+            $this->assertEquals("Example", 
$this->getTable("//d...@id='wikiPreview']/table.0.0"));
+        } catch (PHPUnit_Framework_AssertionFailedError $e) {
+            array_push($this->verificationErrors, $e->toString());
+        }
+        parent::doLogout();
+    }
+       
     // Verify the replace all function on Search and Replace
      function testTextSearchReplaceAll(){
 
@@ -188,6 +468,6 @@
 
 
         parent::doLogout();
-    }**/
+    }*/
 }
 ?>



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to