r64960 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64959‎ | r64960 | r64961 >
Date:11:44, 12 April 2010
Author:bhagya
Status:deferred
Tags:
Comment:
Wiki Tool bar automation test cases - basic functionality
Modified paths:
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/private (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/private/config.properties (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/private/private.properties (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/private/private.xml (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/project.properties (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/project.xml (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiAcaiPreferencesTC.php (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiAcaiSearchTC.php (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiCommonTC.php (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTestSuite.php (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarNTOCTC.php (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOtherTC.php (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarTextFormatTC.php (added) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiWatchUnWatchTC.php (added) (history)

Diff [purge]

Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/project.properties
@@ -0,0 +1,11 @@
 2+include.path=${php.global.include.path}
 3+php.version=PHP_5
 4+phpunit.bootstrap=
 5+phpunit.configuration=
 6+phpunit.suite=testCases/WikiTestSuite.php
 7+selenium.src.dir=testCases
 8+source.encoding=UTF-8
 9+src.dir=.
 10+tags.asp=false
 11+tags.short=true
 12+web.root=.
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/project.xml
@@ -0,0 +1,9 @@
 2+<?xml version="1.0" encoding="UTF-8"?>
 3+<project xmlns="http://www.netbeans.org/ns/project/1">
 4+ <type>org.netbeans.modules.php.project</type>
 5+ <configuration>
 6+ <data xmlns="http://www.netbeans.org/ns/php-project/1">
 7+ <name>WikiFunctions</name>
 8+ </data>
 9+ </configuration>
 10+</project>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/private/config.properties
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/private/private.properties
@@ -0,0 +1,5 @@
 2+copy.src.files=false
 3+copy.src.target=
 4+index.file=index.php
 5+run.as=LOCAL
 6+url=http://localhost/WikiFunctions/
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/nbproject/private/private.xml
@@ -0,0 +1,4 @@
 2+<?xml version="1.0" encoding="UTF-8"?>
 3+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
 4+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
 5+</project-private>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiAcaiPreferencesTC.php
@@ -0,0 +1,15 @@
 2+<?php
 3+require_once 'WikiCommonTC.php';
 4+/**
 5+ * This test case will be handling the user account settings.
 6+ * Date : Apr - 2010
 7+ * @author : BhagyaG - Calcey
 8+ */
 9+class WikiPreferencesTC extends WikiCommonTC {
 10+
 11+ function setup(){
 12+ parent::setUp();
 13+ }
 14+
 15+}
 16+?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarTextFormatTC.php
@@ -0,0 +1,260 @@
 2+<?php
 3+require_once 'WikiCommonTC.php';
 4+/**
 5+ * This test case will be handling the text formatting related functions via tool bar
 6+ * Date : Apr - 2010
 7+ * @author : BhagyaG - Calcey
 8+ */
 9+class WikiToolBarTextFormatTC extends WikiCommonTC {
 10+ // Set up the testing environment
 11+ function setup(){
 12+ parent::setUp();
 13+ }
 14+
 15+ // Mark text Bold and verify output
 16+ function testMakeTextBold(){
 17+ parent::doOpenLink();
 18+ parent::doLogin();
 19+ $this->open("/deployment-en/Main_Page");
 20+ $this->click("link=Random article");
 21+ $this->waitForPageToLoad("30000");
 22+ $this->click("//li[@id='ca-edit']/a/span");
 23+ $this->waitForPageToLoad("30000");
 24+ $this->type("wpTextbox1", "");
 25+ $this->click("link=Bold");
 26+ $this->type("wpTextbox1", "'''Bold''' text");
 27+ $this->click("wpPreview");
 28+ $this->waitForPageToLoad("30000");
 29+ try {
 30+ $this->assertEquals("Bold", $this->getText("//div[@id='wikiPreview']/p/b"));
 31+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 32+ array_push($this->verificationErrors, $e->toString());
 33+ }
 34+
 35+ parent::doLogout();
 36+ }
 37+
 38+ // Mark text Italic and verify output
 39+ function testMakeTextItalic(){
 40+ parent::doOpenLink();
 41+ parent::doLogin();
 42+ $this->click("link=Random article");
 43+ $this->waitForPageToLoad("30000");
 44+ $this->click("//li[@id='ca-edit']/a/span");
 45+ $this->waitForPageToLoad("30000");
 46+ $this->type("wpTextbox1", "");
 47+ $this->click("link=Italic");
 48+ $this->type("wpTextbox1", "''Italian'' text");
 49+ $this->click("wpPreview");
 50+ $this->waitForPageToLoad("30000");
 51+ $this->assertEquals("Italian", $this->getText("//div[@id='wikiPreview']/p/i"));
 52+ parent::doLogout();
 53+ }
 54+
 55+ // Use Bullet Item function and verify output
 56+ function testBulletItem(){
 57+ parent::doOpenLink();
 58+ parent::doLogin();
 59+ $this->open("/deployment-en/Main_Page");
 60+ $this->click("link=Random article");
 61+ $this->waitForPageToLoad("30000");
 62+ $this->click("//li[@id='ca-edit']/a/span");
 63+ $this->waitForPageToLoad("30000");
 64+ $this->type("wpTextbox1", "");
 65+ $this->click("link=Bulleted list");
 66+ $this->click("link=Bulleted list");
 67+ $this->click("link=Bulleted list");
 68+ $this->type("wpTextbox1", "* Bulleted list item\n* Bulleted list item\n* Bulleted list item");
 69+ $this->click("wpPreview");
 70+ $this->waitForPageToLoad("30000");
 71+ try {
 72+ $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[1]"));
 73+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 74+ array_push($this->verificationErrors, $e->toString());
 75+ }
 76+ try {
 77+ $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[2]"));
 78+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 79+ array_push($this->verificationErrors, $e->toString());
 80+ }
 81+ try {
 82+ $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[3]"));
 83+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 84+ array_push($this->verificationErrors, $e->toString());
 85+ }
 86+
 87+ parent::doLogout();
 88+ }
 89+
 90+ // Use Numbered Item function and verify output
 91+ function testNumberedItem(){
 92+ parent::doOpenLink();
 93+ parent::doLogin();
 94+ $this->open("/deployment-en/Main_Page");
 95+ $this->click("link=Random article");
 96+ $this->waitForPageToLoad("30000");
 97+ $this->click("//li[@id='ca-edit']/a/span");
 98+ $this->waitForPageToLoad("30000");
 99+ $this->type("wpTextbox1", "");
 100+ $this->click("link=Numbered list");
 101+ $this->click("link=Numbered list");
 102+ $this->click("link=Numbered list");
 103+ $this->type("wpTextbox1", "# Numbered list item\n# Numbered list item\n# Numbered list item");
 104+ $this->click("wpPreview");
 105+ $this->waitForPageToLoad("30000");
 106+ try {
 107+ $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[1]"));
 108+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 109+ array_push($this->verificationErrors, $e->toString());
 110+ }
 111+ try {
 112+ $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[2]"));
 113+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 114+ array_push($this->verificationErrors, $e->toString());
 115+ }
 116+ try {
 117+ $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[3]"));
 118+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 119+ array_push($this->verificationErrors, $e->toString());
 120+ }
 121+ parent::doLogout();
 122+ }
 123+
 124+ // Mark text as Nowiki and verify output
 125+ function testNoWiki(){
 126+ parent::doOpenLink();
 127+ parent::doLogin();
 128+ $this->open("/deployment-en/Main_Page");
 129+ $this->click("link=Random article");
 130+ $this->waitForPageToLoad("30000");
 131+ $this->click("//li[@id='ca-edit']/a/span");
 132+ $this->waitForPageToLoad("30000");
 133+ $this->type("wpTextbox1", "");
 134+ $this->type("wpTextbox1", "<nowiki>==Heading text==</nowiki>");
 135+ $this->click("wpPreview");
 136+ $this->waitForPageToLoad("30000");
 137+ try {
 138+ $this->assertEquals("==Heading text==", $this->getText("//div[@id='wikiPreview']/p"));
 139+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 140+ array_push($this->verificationErrors, $e->toString());
 141+ }
 142+
 143+
 144+ parent::doLogout();
 145+ }
 146+
 147+ // Create a line break and verify output
 148+ function testLineBreak(){
 149+ parent::doOpenLink();
 150+ parent::doLogin();
 151+ $this->open("/deployment-en/Main_Page");
 152+ $this->click("link=Random article");
 153+ $this->waitForPageToLoad("30000");
 154+ $this->click("//li[@id='ca-edit']/a/span");
 155+ $this->waitForPageToLoad("30000");
 156+ $this->type("wpTextbox1", "");
 157+ $this->type("wpTextbox1", "this is a test text to check the line\n break.");
 158+ $this->click("wpPreview");
 159+ $this->waitForPageToLoad("30000");
 160+ try {
 161+ $this->assertEquals("this is a test text to check the line\n break.", $this->getText("//div[@id='wikiPreview']/p"));
 162+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 163+ array_push($this->verificationErrors, $e->toString());
 164+ }
 165+ parent::doLogout();
 166+ }
 167+
 168+ // Mark text as Big and verify output
 169+ function testTextBig(){
 170+ parent::doOpenLink();
 171+ parent::doLogin();
 172+ $this->open("/deployment-en/Main_Page");
 173+ $this->click("link=Random article");
 174+ $this->waitForPageToLoad("30000");
 175+ $this->click("//li[@id='ca-edit']/a/span");
 176+ $this->waitForPageToLoad("30000");
 177+ $this->type("wpTextbox1", "");
 178+ $this->click("link=Big");
 179+ $this->type("wpTextbox1", "<big>This</big> text");
 180+ $this->click("wpPreview");
 181+ $this->waitForPageToLoad("30000");
 182+ try {
 183+ $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/big"));
 184+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 185+ array_push($this->verificationErrors, $e->toString());
 186+ }
 187+
 188+ parent::doLogout();
 189+ }
 190+
 191+ // Mark text as Small and verify output
 192+ function testTextSmall(){
 193+ parent::doOpenLink();
 194+ parent::doLogin();
 195+ $this->open("/deployment-en/Main_Page");
 196+ $this->click("link=Random article");
 197+ $this->waitForPageToLoad("30000");
 198+ $this->click("//li[@id='ca-edit']/a/span");
 199+ $this->waitForPageToLoad("30000");
 200+ $this->type("wpTextbox1", "");
 201+ $this->click("link=Small");
 202+ $this->type("wpTextbox1", "<small>This</small> text\n");
 203+ $this->click("wpPreview");
 204+ $this->waitForPageToLoad("30000");
 205+ try {
 206+ $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/small"));
 207+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 208+ array_push($this->verificationErrors, $e->toString());
 209+ }
 210+
 211+ parent::doLogout();
 212+ }
 213+
 214+ // Mark text as Super Script and verify output
 215+ function testTextSuperscript(){
 216+ parent::doOpenLink();
 217+ parent::doLogin();
 218+ $this->open("/deployment-en/Main_Page");
 219+ $this->click("link=Random article");
 220+ $this->waitForPageToLoad("30000");
 221+ $this->click("//li[@id='ca-edit']/a/span");
 222+ $this->waitForPageToLoad("30000");
 223+ $this->type("wpTextbox1", "");
 224+ $this->click("link=Superscript");
 225+ $this->type("wpTextbox1", "<sup>This</sup> text\n");
 226+ $this->click("wpPreview");
 227+ $this->waitForPageToLoad("30000");
 228+ try {
 229+ $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sup"));
 230+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 231+ array_push($this->verificationErrors, $e->toString());
 232+ }
 233+
 234+ parent::doLogout();
 235+ }
 236+
 237+ // Mark text as Sub Script and verify output
 238+ function testTextSubscript(){
 239+ parent::doOpenLink();
 240+ parent::doLogin();
 241+ $this->open("/deployment-en/Main_Page");
 242+ $this->click("link=Random article");
 243+ $this->waitForPageToLoad("30000");
 244+ $this->click("//li[@id='ca-edit']/a/span");
 245+ $this->waitForPageToLoad("30000");
 246+ $this->type("wpTextbox1", "");
 247+ $this->click("link=Subscript");
 248+ $this->type("wpTextbox1", "<sub>This</sub> text\n");
 249+ $this->click("wpPreview");
 250+ $this->waitForPageToLoad("30000");
 251+ try {
 252+ $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sub"));
 253+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 254+ array_push($this->verificationErrors, $e->toString());
 255+ }
 256+
 257+ parent::doLogout();
 258+ }
 259+
 260+}
 261+?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiWatchUnWatchTC.php
@@ -0,0 +1,65 @@
 2+<?php
 3+require_once 'WikiCommonTC.php';
 4+/**
 5+ * This test case will be handling the page watch functions.
 6+ * Date : Apr - 2010
 7+ * @author : BhagyaG - Calcey
 8+ */
 9+class WikiWatchUnWatchTC extends WikiCommonTC {
 10+ // Set up the testing environment
 11+ function setup(){
 12+ parent::setUp();
 13+ }
 14+
 15+ // Mark a page as watch and verify the My Watch list
 16+ function testWatch(){
 17+ parent::doOpenLink();
 18+ parent::doLogin();
 19+ $this->click("link=Random article");
 20+ $this->waitForPageToLoad("30000");
 21+ $randompage = $this->getText("firstHeading");
 22+ $this->click("link=Watch");
 23+ $this->click("link=My watchlist");
 24+ $this->waitForPageToLoad("30000");
 25+ $this->click("link=View and edit watchlist");
 26+ $this->waitForPageToLoad("30000");
 27+
 28+ $this->assertTrue($this->isTextPresent($randompage));
 29+ parent::doLogout();
 30+ }
 31+
 32+
 33+ // Mark a page as watch and mark the same page as unwatch and verify the My Watch list
 34+ function testUnWatch(){
 35+ parent::doOpenLink();
 36+ parent::doLogin();
 37+ $this->click("link=Random article");
 38+ $this->waitForPageToLoad("30000");
 39+ $randompage = $this->getText("firstHeading");
 40+ $this->click("link=Watch");
 41+ $this->click("link=My watchlist");
 42+ $this->waitForPageToLoad("30000");
 43+ $this->click("link=View and edit watchlist");
 44+ $this->waitForPageToLoad("30000");
 45+ $this->assertTrue($this->isTextPresent($randompage));
 46+ $this->click("link=" . $randompage);
 47+ $this->waitForPageToLoad("30000");
 48+ $this->click("link=Unwatch");
 49+ $this->click("link=My watchlist");
 50+ $this->waitForPageToLoad("30000");
 51+ $this->click("link=View and edit watchlist");
 52+ $this->waitForPageToLoad("30000");
 53+ try {
 54+ $this->assertFalse($this->isTextPresent($randompage));
 55+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 56+ array_push($this->verificationErrors, $e->toString());
 57+ }
 58+ parent::doLogout();
 59+ }
 60+
 61+ /** function testEditWatch(){
 62+
 63+ }**/
 64+
 65+}
 66+?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTestSuite.php
@@ -0,0 +1,19 @@
 2+<?php
 3+/*
 4+ * To change this template, choose Tools | Templates
 5+ * and open the template in the editor.
 6+ */
 7+
 8+require_once 'WikiWatchUnWatchTC.php';
 9+/**
 10+ * Description of WikiTestSuite
 11+ *
 12+ * @author bhagyag
 13+ */
 14+class WikiTestSuite {
 15+ function suite(){
 16+
 17+
 18+ }
 19+}
 20+?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiAcaiSearchTC.php
@@ -0,0 +1,55 @@
 2+<?php
 3+require_once 'WikiCommonTC.php';
 4+/**
 5+ * This test case will be handling the search function.
 6+ * Date : Apr - 2010
 7+ * @author : BhagyaG - Calcey
 8+ */
 9+class WikiAcaiSearchTC extends WikiCommonTC {
 10+ // Set up the testing environment
 11+ function setup(){
 12+ parent::setUp();
 13+ }
 14+
 15+ // Search for a Wiki Page. Search result should be directed to the page itself
 16+ function testSearchPage(){
 17+ parent::doOpenLink();
 18+ parent::doLogin();
 19+ $this->click("link=Main page");
 20+ $this->type("//*[@id='searchInput']", "Hair (musical)");
 21+ $this->click("//*[@id='searchButton']");
 22+ $this->waitForPageToLoad("30000");
 23+ try {
 24+ $this->assertEquals("Hair (musical)", $this->getText("//*[@id='firstHeading']"));
 25+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 26+ array_push($this->verificationErrors, $e->toString());
 27+ }
 28+ $this->click("link=Main page");
 29+ $this->waitForPageToLoad("30000");
 30+ parent::doLogout();
 31+ }
 32+
 33+ // Search for a text. Search result should display links which contain the search text
 34+ function testSearchText(){
 35+ parent::doOpenLink();
 36+ parent::doLogin();
 37+ $this->click("link=Main page");
 38+ $this->waitForPageToLoad("30000");
 39+ $this->type("//*[@id='searchInput']", "TV");
 40+ $this->click("searchButton");
 41+ $this->waitForPageToLoad("30000");
 42+ try {
 43+ $this->assertEquals("Search results", $this->getText("firstHeading"));
 44+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 45+ array_push($this->verificationErrors, $e->toString());
 46+ }
 47+ try {
 48+ $this->assertEquals("TV - Search results - Wikipedia, the free encyclopedia", $this->getTitle());
 49+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 50+ array_push($this->verificationErrors, $e->toString());
 51+ }
 52+ parent::doLogout();
 53+ }
 54+
 55+}
 56+?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOtherTC.php
@@ -0,0 +1,83 @@
 2+<?php
 3+require_once 'WikiCommonTC.php';
 4+/**
 5+ * This test case will be handling the general tool bar functions
 6+ * Date : Apr - 2010
 7+ * @author : BhagyaG - Calcey
 8+ */
 9+class WikiToolBarOtherTC extends WikiCommonTC {
 10+ // Set up the testing environment
 11+ function setup(){
 12+ parent::setUp();
 13+ }
 14+
 15+ // Click on Embedded file function and verify the output
 16+ function testEmbeddedFile(){
 17+ parent::doOpenLink();
 18+ parent::doLogin();
 19+
 20+ $this->click("link=Random article");
 21+ $this->waitForPageToLoad("30000");
 22+ $this->click("//li[@id='ca-edit']/a/span");
 23+ $this->waitForPageToLoad("30000");
 24+ $this->click("link=Embedded file");
 25+ $this->type("wpTextbox1", "\" \"");
 26+ $this->type("wpTextbox1", "[[File:Example.jpg]]");
 27+ $this->click("wpPreview");
 28+ $this->waitForPageToLoad("30000");
 29+ try {
 30+ $this->assertEquals("", $this->getText("//img[@alt='Example.jpg']"));
 31+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 32+ array_push($this->verificationErrors, $e->toString());
 33+ }
 34+ parent::doLogout();
 35+ }
 36+
 37+ /** Reference link is not directing to the given link.
 38+ * For example if I add www.google.com as the reference link,
 39+ * on preview the link is not directing to google site.
 40+ function testReference(){
 41+ parent::doOpenLink();
 42+ parent::doLogin();
 43+
 44+ $this->open("/deployment-en/Main_Page");
 45+ $this->click("link=Random article");
 46+ $this->waitForPageToLoad("30000");
 47+ $this->click("//li[@id='ca-edit']/a/span");
 48+ $this->waitForPageToLoad("30000");
 49+ $this->type("wpTextbox1", "");
 50+ $this->click("link=Reference");
 51+ $this->type("wpTextbox1", "");
 52+ $this->type("wikieditor-toolbar-reference-text", "www.google.com");
 53+ $this->click("//div[13]/div[11]/button[1]");
 54+ $this->click("wpPreview");
 55+
 56+ parent::doLogout();
 57+ }**/
 58+
 59+ // Click on Picture Gallery function and verify the output
 60+ function testPictureGallery(){
 61+ parent::doOpenLink();
 62+ parent::doLogin();
 63+
 64+ $this->open("/deployment-en/Main_Page");
 65+ $this->click("link=Random article");
 66+ $this->waitForPageToLoad("30000");
 67+ $this->click("//li[@id='ca-edit']/a/span");
 68+ $this->waitForPageToLoad("30000");
 69+ $this->type("wpTextbox1", "");
 70+ $this->click("link=Picture gallery");
 71+ $this->click("wpPreview");
 72+ $this->waitForPageToLoad("30000");
 73+ try {
 74+ $this->assertEquals("", $this->getText("//div[@id='wikiPreview']/table/tbody/tr/td[1]/div/div[1]/div"));
 75+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 76+ array_push($this->verificationErrors, $e->toString());
 77+ }
 78+
 79+ parent::doLogout();
 80+ }
 81+
 82+
 83+}
 84+?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php
@@ -0,0 +1,179 @@
 2+<?php
 3+require_once 'WikiCommonTC.php';
 4+/**
 5+ * This test case will be handling the Wiki Tool bar Dialog functions
 6+ * Date : Apr - 2010
 7+ * @author : BhagyaG - Calcey
 8+ */
 9+class WikiToolBarDialogsTC extends WikiCommonTC {
 10+ // Set up the testing environment
 11+ function setup(){
 12+ parent::setUp();
 13+ }
 14+
 15+ // Add a internal link and verify
 16+ function testInternalLink(){
 17+ parent::doOpenLink();
 18+ parent::doLogin();
 19+ $this->click("link=Random article");
 20+ $this->waitForPageToLoad("30000");
 21+ $this->click("//li[@id='ca-edit']/a/span");
 22+ $this->waitForPageToLoad("30000");
 23+ $this->type("wpTextbox1", "");
 24+ $this->click("link=Link");
 25+ $this->type("wikieditor-toolbar-link-int-target", "Daimler-Chrysler");
 26+ $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists"));
 27+ $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int"));
 28+ $this->click("//div[13]/div[11]/button[1]");
 29+ $this->click("wpPreview");
 30+ $this->waitForPageToLoad("30000");
 31+ $this->assertEquals("Daimler-Chrysler", $this->getText("link=Daimler-Chrysler"));
 32+
 33+ parent::doLogout();
 34+ }
 35+
 36+ // Add external link and verify
 37+ function testExternalLink(){
 38+ parent::doOpenLink();
 39+ parent::doLogin();
 40+ $this->click("link=Random article");
 41+ $this->waitForPageToLoad("30000");
 42+ $this->click("//li[@id='ca-edit']/a/span");
 43+ $this->waitForPageToLoad("30000");
 44+ $this->type("wpTextbox1", "");
 45+ $this->click("link=Link");
 46+ $this->type("wikieditor-toolbar-link-int-target", "www.google.com");
 47+ try {
 48+ $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external"));
 49+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 50+ array_push($this->verificationErrors, $e->toString());
 51+ }
 52+ $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext"));
 53+ $this->click("//div[13]/div[11]/button[1]");
 54+ $this->click("wpPreview");
 55+ $this->waitForPageToLoad("30000");
 56+ $this->assertEquals("www.google.com", $this->getText("link=www.google.com"));
 57+
 58+ parent::doLogout();
 59+ }
 60+
 61+ // Add a table and verify
 62+ function testCreateTable(){
 63+ parent::doOpenLink();
 64+ parent::doLogin();
 65+ $this->open("/deployment-en/Main_Page");
 66+ $this->click("link=Random article");
 67+ $this->waitForPageToLoad("30000");
 68+ $this->click("//li[@id='ca-edit']/a/span");
 69+ $this->waitForPageToLoad("30000");
 70+ $this->type("wpTextbox1", "");
 71+ $this->click("link=Table");
 72+ $this->type("wpTextbox1", "");
 73+ $this->click("wikieditor-toolbar-table-sortable");
 74+ $this->click("//div[3]/button[1]");
 75+ $this->click("wikieditor-toolbar-table-sortable");
 76+ $this->click("wpPreview");
 77+ $this->waitForPageToLoad("30000");
 78+ try {
 79+ $this->assertEquals("Header text", $this->getText("//table[@id='sortable_table_id_0']/tbody/tr[1]/th[3]"));
 80+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 81+ array_push($this->verificationErrors, $e->toString());
 82+ }
 83+
 84+ parent::doLogout();
 85+ }
 86+
 87+ // Verify the replace all function on Search and Replace
 88+ function testTextSearchReplaceAll(){
 89+ parent::doOpenLink();
 90+ parent::doLogin();
 91+ $this->open("/deployment-en/Main_Page");
 92+ $this->click("link=Random article");
 93+ $this->waitForPageToLoad("30000");
 94+ $this->click("//li[@id='ca-edit']/a/span");
 95+ $this->waitForPageToLoad("30000");
 96+ $this->type("wpTextbox1", "");
 97+ $this->click("link=Search and replace");
 98+ $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa");
 99+ $this->type("wikieditor-toolbar-replace-search", "calcey");
 100+ $this->type("wikieditor-toolbar-replace-search", "calcey qa");
 101+ $this->type("wikieditor-toolbar-replace-replace", "test team");
 102+ $this->click("//button[3]");
 103+ $this->click("//button[4]");
 104+ $this->click("wpPreview");
 105+ $this->waitForPageToLoad("30000");
 106+ try {
 107+ $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[1]"));
 108+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 109+ array_push($this->verificationErrors, $e->toString());
 110+ }
 111+ try {
 112+ $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[2]"));
 113+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 114+ array_push($this->verificationErrors, $e->toString());
 115+ }
 116+ try {
 117+ $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[3]"));
 118+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 119+ array_push($this->verificationErrors, $e->toString());
 120+ }
 121+
 122+ parent::doLogout();
 123+ }
 124+
 125+ // Verify the replace next function on Search and Replace
 126+ function testTextSearchReplaceNext(){
 127+ parent::doOpenLink();
 128+ parent::doLogin();
 129+ $this->open("/deployment-en/Main_Page");
 130+ $this->click("link=Random article");
 131+ $this->waitForPageToLoad("30000");
 132+ $this->click("//li[@id='ca-edit']/a/span");
 133+ $this->waitForPageToLoad("30000");
 134+ $this->type("wpTextbox1", "");
 135+ $this->click("link=Search and replace");
 136+ $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa");
 137+ $this->click("link=Search and replace");
 138+ $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa");
 139+ $this->type("wikieditor-toolbar-replace-search", "calcey qa");
 140+ $this->type("wikieditor-toolbar-replace-replace", "test team");
 141+ $this->click("//div[13]/div[11]/button[2]");
 142+ $this->click("//div[13]/div[11]/button[2]");
 143+ $this->click("//button[4]");
 144+ $this->click("wpPreview");
 145+ $this->waitForPageToLoad("30000");
 146+ try {
 147+ $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[1]"));
 148+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 149+ array_push($this->verificationErrors, $e->toString());
 150+ }
 151+ try {
 152+ $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[2]"));
 153+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 154+ array_push($this->verificationErrors, $e->toString());
 155+ }
 156+ try {
 157+ $this->assertEquals("calcey qa", $this->getText("//div[@id='wikiPreview']/p[3]"));
 158+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 159+ array_push($this->verificationErrors, $e->toString());
 160+ }
 161+ parent::doLogout();
 162+ }
 163+
 164+ /** When user click on find, text highlight on back which is not captured in Selenium directly.
 165+ function testTextSearchFindNext(){
 166+ parent::doLogin();
 167+ $this->open("/deployment-en/Main_Page");
 168+ $this->click("link=Random article");
 169+ $this->waitForPageToLoad("30000");
 170+ $this->click("//li[@id='ca-edit']/a/span");
 171+ $this->waitForPageToLoad("30000");
 172+ $this->type("wpTextbox1", "");
 173+ $this->click("link=Search and replace");
 174+
 175+
 176+
 177+ parent::doLogout();
 178+ }**/
 179+}
 180+?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarNTOCTC.php
@@ -0,0 +1,115 @@
 2+<?php
 3+require_once 'WikiCommonTC.php';
 4+/**
 5+ * This test case will be handling the NTOC related functions.
 6+ * Adding different header levels via tool bar and verify the output
 7+ * Date : Apr - 2010
 8+ * @author : BhagyaG - Calcey
 9+ */
 10+class WikiToolBarNTOC extends WikiCommonTC {
 11+ // Set up the testing environment
 12+ function setup(){
 13+ parent::setUp();
 14+ }
 15+
 16+ // Add header level 2 and verify Header output
 17+ function testHeaderLevel2(){
 18+ parent::doOpenLink();
 19+ parent::doLogin();
 20+ $this->open("/deployment-en/Main_Page");
 21+ $this->waitForPageToLoad("30000");
 22+ $this->click("link=Random article");
 23+ $this->waitForPageToLoad("30000");
 24+ $this->click("//li[@id='ca-edit']/a/span");
 25+ $this->waitForPageToLoad("30000");
 26+ $this->click("link=Heading");
 27+ $this->click("link=Heading");
 28+ $this->click("link=Level 2");
 29+ $this->type("wpTextbox1", "==Heading text==");
 30+ $this->click("wpPreview");
 31+ $this->waitForPageToLoad("30000");
 32+ try {
 33+ $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2"));
 34+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 35+ array_push($this->verificationErrors, $e->toString());
 36+ }
 37+
 38+ parent::doLogout();
 39+ }
 40+
 41+ // Add header level 3 and verify Header output
 42+ function testHeaderLevel3(){
 43+ parent::doOpenLink();
 44+ parent::doLogin();
 45+ $this->open("/deployment-en/Main_Page");
 46+ $this->waitForPageToLoad("30000");
 47+ $this->click("link=Random article");
 48+ $this->waitForPageToLoad("30000");
 49+ $this->click("//li[@id='ca-edit']/a/span");
 50+ $this->waitForPageToLoad("30000");
 51+ $this->click("link=Heading");
 52+ $this->click("link=Heading");
 53+ $this->click("link=Level 3");
 54+ $this->type("wpTextbox1", "===Heading text===");
 55+ $this->click("wpPreview");
 56+ $this->waitForPageToLoad("30000");
 57+ try {
 58+ $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3"));
 59+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 60+ array_push($this->verificationErrors, $e->toString());
 61+ }
 62+
 63+ parent::doLogout();
 64+ }
 65+
 66+ // Add header level 4 and verify Header output
 67+ function testHeaderLevel4(){
 68+ parent::doOpenLink();
 69+ parent::doLogin();
 70+ $this->open("/deployment-en/Main_Page");
 71+ $this->waitForPageToLoad("30000");
 72+ $this->click("link=Random article");
 73+ $this->waitForPageToLoad("30000");
 74+ $this->click("//li[@id='ca-edit']/a/span");
 75+ $this->waitForPageToLoad("30000");
 76+ $this->click("link=Heading");
 77+ $this->click("link=Heading");
 78+ $this->click("link=Level 4");
 79+ $this->type("wpTextbox1", "====Heading text====");
 80+ $this->click("wpPreview");
 81+ $this->waitForPageToLoad("30000");
 82+ try {
 83+ $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4"));
 84+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 85+ array_push($this->verificationErrors, $e->toString());
 86+ }
 87+
 88+ parent::doLogout();
 89+ }
 90+
 91+ // Add header level 5 and verify Header output
 92+ function testHeaderLevel5(){
 93+ parent::doOpenLink();
 94+ parent::doLogin();
 95+ $this->open("/deployment-en/Main_Page");
 96+ $this->waitForPageToLoad("30000");
 97+ $this->click("link=Random article");
 98+ $this->waitForPageToLoad("30000");
 99+ $this->click("//li[@id='ca-edit']/a/span");
 100+ $this->waitForPageToLoad("30000");
 101+ $this->click("link=Heading");
 102+ $this->click("link=Heading");
 103+ $this->click("link=Level 5");
 104+ $this->type("wpTextbox1", "=====Heading text=====");
 105+ $this->click("wpPreview");
 106+ $this->waitForPageToLoad("30000");
 107+ try {
 108+ $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h5"));
 109+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 110+ array_push($this->verificationErrors, $e->toString());
 111+ }
 112+
 113+ parent::doLogout();
 114+ }
 115+}
 116+?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiCommonTC.php
@@ -0,0 +1,66 @@
 2+<?php
 3+require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
 4+/**
 5+ * This test case will be handling the common functions on test.
 6+ * Date : Apr - 2010
 7+ * @author : BhagyaG - Calcey
 8+ */
 9+class WikiCommonTC extends PHPUnit_Extensions_SeleniumTestCase {
 10+ /** Wiki server environment details.This array should be commented if the test
 11+ * run on local browsers. **/
 12+
 13+ public static $browsers = array(
 14+ array(
 15+ 'name' => 'Safari',
 16+ 'browser' => '*safari',
 17+ 'host' => 'raskin.usability.wikimedia.org',
 18+ 'port' => 4444,
 19+ 'timeout' => 30000,
 20+ )
 21+ );
 22+
 23+ // Setup the browser URL and local browser
 24+ function setUp() {
 25+ // Setting the local browser. this should be disabled if the test run in Wiki environment.
 26+ // $this->setBrowser("*firefox");
 27+ // Main link to be connected
 28+ $this->setBrowserUrl("http://prototype.wikimedia.org");
 29+ }
 30+
 31+ // Open the page.
 32+ function doOpenLink(){
 33+ $this->open("/deployment-en/Main_Page");
 34+ }
 35+
 36+ // Login to the application
 37+ function doLogin() {
 38+ if (!$this->isTextPresent("Log out")) {
 39+ $this->click("link=Log in / create account");
 40+ $this->waitForPageToLoad("30000");
 41+ $this->type("wpName1", "bhagya_qa");
 42+ $this->type("wpPassword1", "test");
 43+ $this->click("wpLoginAttempt");
 44+ $this->waitForPageToLoad("30000");
 45+ try {
 46+ $this->assertEquals("Bhagya qa", $this->getText("link=Bhagya qa"));
 47+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 48+ array_push($this->verificationErrors, $e->toString());
 49+ }
 50+ }
 51+ }
 52+
 53+ // Log out from the application
 54+ function doLogout() {
 55+ $this->open("/deployment-en/Main_Page");
 56+ if ($this->isTextPresent("Log out")) {
 57+ $this->click("link=Log out");
 58+ $this->waitForPageToLoad("30000");
 59+ try {
 60+ $this->assertEquals("Log in / create account", $this->getText("link=Log in / create account"));
 61+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 62+ array_push($this->verificationErrors, $e->toString());
 63+ }
 64+ }
 65+ }
 66+}
 67+?>
\ No newline at end of file

Status & tagging log