r68445 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68444‎ | r68445 | r68446 >
Date:07:44, 23 June 2010
Author:bhagya
Status:deferred
Tags:
Comment:
Latest update with the test suite , capture screen over error and common config file
Modified paths:
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/Config.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikSearch_TC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiCommonFunction_TC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_ExsistingPage.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_NewPage.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_TC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiNTOC_TC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTestSuite.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTextFormat_TC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_ExistingPage.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_NewPage.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_TC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiWatchUnWatch_TC.php (modified) (history)

Diff [purge]

Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_TC.php
@@ -1,7 +1,6 @@
22 <?php
3 -session_start();
43 require_once 'WikiCommonFunction_TC.php';
5 -require_once 'Config.php';
 4+include 'Config.php';
65 /**
76 * This test case will be handling the Wiki Tool bar Dialog functions
87 * Date : Apr - 2010
@@ -11,24 +10,24 @@
1211
1312 // Add a internal link and verify
1413 function verifyInternalLink(){
15 - $this->type("wpTextbox1", "");
16 - $this->click("link=Link");
17 - $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_INTERNAL_LINK"]);
18 - $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists"));
19 - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int"));
20 - $this->click("//div[13]/div[11]/button[1]");
21 - $this->click("wpPreview");
22 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 14+ $this->type(TEXT_EDITOR, "");
 15+ $this->click(LINK_ADDLINK);
 16+ $this->type(TEXT_LINKNAME, (WIKI_INTERNAL_LINK));
 17+ $this->assertTrue($this->isElementPresent(ICON_PAGEEXISTS));
 18+ $this->assertEquals("on", $this->getValue(OPT_INTERNAL));
 19+ $this->click(BUTTON_INSERTLINK);
 20+ $this->click(BUTTON_PREVIEW);
 21+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
2322 try {
24 - $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"], $this->getText("link=" . $_SESSION["WIKI_INTERNAL_LINK"]));
 23+ $this->assertEquals((WIKI_INTERNAL_LINK), $this->getText(LINK_START . WIKI_INTERNAL_LINK));
2524 } catch (PHPUnit_Framework_AssertionFailedError $e) {
2625 parent::doCreateScreenShot(__FUNCTION__);
2726 array_push($this->verificationErrors, $e->toString());
2827 }
29 - $this->click("link=Daimler-Chrysler");
30 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 28+ $this->click(LINK_START. WIKI_INTERNAL_LINK);
 29+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
3130 try {
32 - $this->assertTrue($this->isTextPresent($_SESSION["WIKI_INTERNAL_LINK"]), $this->getText("firstHeading"));
 31+ $this->assertTrue($this->isTextPresent(WIKI_INTERNAL_LINK), $this->getText(TEXT_PAGE_HEADING));
3332 } catch (PHPUnit_Framework_AssertionFailedError $e) {
3433 parent::doCreateScreenShot(__FUNCTION__);
3534 array_push($this->verificationErrors, $e->toString());
@@ -37,26 +36,25 @@
3837
3938 // Add a internal link with different display text and verify
4039 function verifyInternalLinkWithDisplayText(){
41 - $this->type("wpTextbox1", "");
42 - $this->click("link=Link");
43 - $this->type("wpTextbox1", "");
44 - $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_INTERNAL_LINK"]);
45 - $this->type("wikieditor-toolbar-link-int-text", $_SESSION["WIKI_INTERNAL_LINK"] . " Test");
46 - $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists"));
47 - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int"));
48 - $this->click("//div[13]/div[11]/button[1]");
49 - $this->click("wpPreview");
50 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 40+ $this->type(TEXT_EDITOR, "");
 41+ $this->click(LINK_ADDLINK);
 42+ $this->type(TEXT_LINKNAME, (WIKI_INTERNAL_LINK));
 43+ $this->type(TEXT_LINKDISPLAYNAME, (WIKI_INTERNAL_LINK) . TEXT_LINKDISPLAYNAME_APPENDTEXT);
 44+ $this->assertTrue($this->isElementPresent(ICON_PAGEEXISTS));
 45+ $this->assertEquals("on", $this->getValue(OPT_INTERNAL));
 46+ $this->click(BUTTON_INSERTLINK);
 47+ $this->click(BUTTON_PREVIEW);
 48+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
5149 try {
52 - $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"]." Test", $this->getText("link=" .$_SESSION["WIKI_INTERNAL_LINK"] ." Test"));
 50+ $this->assertEquals((WIKI_INTERNAL_LINK).TEXT_LINKDISPLAYNAME_APPENDTEXT, $this->getText(LINK_START .(WIKI_INTERNAL_LINK) .TEXT_LINKDISPLAYNAME_APPENDTEXT));
5351 } catch (PHPUnit_Framework_AssertionFailedError $e) {
5452 parent::doCreateScreenShot(__FUNCTION__);
5553 array_push($this->verificationErrors, $e->toString());
5654 }
57 - $this->click("link=" .$_SESSION["WIKI_INTERNAL_LINK"]." Test");
58 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 55+ $this->click(LINK_START .(WIKI_INTERNAL_LINK).TEXT_LINKDISPLAYNAME_APPENDTEXT);
 56+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
5957 try {
60 - $this->assertTrue($this->isTextPresent($_SESSION["WIKI_INTERNAL_LINK"]), $this->getText("firstHeading"));
 58+ $this->assertTrue($this->isTextPresent((WIKI_INTERNAL_LINK)), $this->getText(TEXT_PAGE_HEADING));
6159 } catch (PHPUnit_Framework_AssertionFailedError $e) {
6260 parent::doCreateScreenShot(__FUNCTION__);
6361 array_push($this->verificationErrors, $e->toString());
@@ -65,24 +63,25 @@
6664
6765 // Add a internal link with blank display text and verify
6866 function verifyInternalLinkWithBlankDisplayText(){
69 - $this->click("link=Link");
70 - $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_INTERNAL_LINK"]);
71 - $this->type("wikieditor-toolbar-link-int-text", "");
72 - $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists"));
73 - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int"));
74 - $this->click("//div[13]/div[11]/button[1]");
75 - $this->click("wpPreview");
76 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 67+ $this->type(TEXT_EDITOR, "");
 68+ $this->click(LINK_ADDLINK);
 69+ $this->type(TEXT_LINKNAME, (WIKI_INTERNAL_LINK));
 70+ $this->type(TEXT_LINKDISPLAYNAME, "");
 71+ $this->assertTrue($this->isElementPresent(ICON_PAGEEXISTS));
 72+ $this->assertEquals("on", $this->getValue(OPT_INTERNAL));
 73+ $this->click(BUTTON_INSERTLINK);
 74+ $this->click(BUTTON_PREVIEW);
 75+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
7776 try {
78 - $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"], $this->getText("link=".$_SESSION["WIKI_INTERNAL_LINK"]));
 77+ $this->assertEquals((WIKI_INTERNAL_LINK), $this->getText(LINK_START.(WIKI_INTERNAL_LINK)));
7978 } catch (PHPUnit_Framework_AssertionFailedError $e) {
8079 parent::doCreateScreenShot(__FUNCTION__);
8180 array_push($this->verificationErrors, $e->toString());
8281 }
83 - $this->click("link=".$_SESSION["WIKI_INTERNAL_LINK"]);
84 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 82+ $this->click(LINK_START.(WIKI_INTERNAL_LINK));
 83+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
8584 try {
86 - $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"], $this->getText("firstHeading"));
 85+ $this->assertEquals((WIKI_INTERNAL_LINK), $this->getText(TEXT_PAGE_HEADING));
8786 } catch (PHPUnit_Framework_AssertionFailedError $e) {
8887 parent::doCreateScreenShot(__FUNCTION__);
8988 array_push($this->verificationErrors, $e->toString());
@@ -91,29 +90,29 @@
9291
9392 // Add external link and verify
9493 function verifyExternalLink(){
95 - $this->type("wpTextbox1", "");
96 - $this->click("link=Link");
97 - $this->type("wikieditor-toolbar-link-int-target", "www.google.com");
 94+ $this->type(BUTTON_PREVIEW, "");
 95+ $this->click(LINK_ADDLINK);
 96+ $this->type(TEXT_LINKNAME, WIKI_EXTERNAL_LINK);
9897 try {
99 - $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external"));
 98+ $this->assertTrue($this->isElementPresent(ICON_PAGEEXTERNAL));
10099 } catch (PHPUnit_Framework_AssertionFailedError $e) {
101100 parent::doCreateScreenShot(__FUNCTION__);
102101 array_push($this->verificationErrors, $e->toString());
103102 }
104 - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext"));
105 - $this->click("//div[13]/div[11]/button[1]");
106 - $this->click("wpPreview");
107 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 103+ $this->assertEquals("on", $this->getValue(OPT_EXTERNAL));
 104+ $this->click(BUTTON_INSERTLINK);
 105+ $this->click(BUTTON_PREVIEW);
 106+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
108107 try {
109 - $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK"], $this->getText("link=".$_SESSION["WIKI_EXTERNAL_LINK"]));
 108+ $this->assertEquals((WIKI_EXTERNAL_LINK), $this->getText(LINK_START.(WIKI_EXTERNAL_LINK)));
110109 } catch (PHPUnit_Framework_AssertionFailedError $e) {
111110 parent::doCreateScreenShot(__FUNCTION__);
112111 array_push($this->verificationErrors, $e->toString());
113112 }
114 - $this->click("link=".$_SESSION["WIKI_EXTERNAL_LINK"]);
115 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 113+ $this->click(LINK_START.(WIKI_EXTERNAL_LINK));
 114+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
116115 try {
117 - $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getTitle());
 116+ $this->assertEquals((WIKI_EXTERNAL_LINK_TITLE), $this->getTitle());
118117 } catch (PHPUnit_Framework_AssertionFailedError $e) {
119118 parent::doCreateScreenShot(__FUNCTION__);
120119 array_push($this->verificationErrors, $e->toString());
@@ -122,63 +121,62 @@
123122
124123 // Add external link with different display text and verify
125124 function verifyExternalLinkWithDisplayText(){
126 - $this->type("wpTextbox1", "");
127 - $this->click("link=Link");
128 - $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_EXTERNAL_LINK"]);
129 - $this->type("wikieditor-toolbar-link-int-text", $_SESSION["WIKI_EXTERNAL_LINK_TITLE"]);
 125+ $this->type(TEXT_EDITOR, "");
 126+ $this->click(LINK_ADDLINK);
 127+ $this->type(TEXT_LINKNAME, (WIKI_EXTERNAL_LINK));
 128+ $this->type(TEXT_LINKDISPLAYNAME, (WIKI_EXTERNAL_LINK_TITLE));
130129 try {
131 - $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external"));
 130+ $this->assertTrue($this->isElementPresent(ICON_PAGEEXTERNAL));
132131 } catch (PHPUnit_Framework_AssertionFailedError $e) {
133132 parent::doCreateScreenShot(__FUNCTION__);
134133 array_push($this->verificationErrors, $e->toString());
135134 }
136 - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext"));
137 - $this->click("//div[13]/div[11]/button[1]");
138 - $this->click("wpPreview");
139 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 135+ $this->assertEquals("on", $this->getValue(OPT_EXTERNAL));
 136+ $this->click(BUTTON_INSERTLINK);
 137+ $this->click(BUTTON_PREVIEW);
 138+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
140139 try {
141 - $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getText("link=".$_SESSION["WIKI_EXTERNAL_LINK_TITLE"]));
 140+ $this->assertEquals((WIKI_EXTERNAL_LINK_TITLE), $this->getText(LINK_START.(WIKI_EXTERNAL_LINK_TITLE)));
142141 } catch (PHPUnit_Framework_AssertionFailedError $e) {
143142 parent::doCreateScreenShot(__FUNCTION__);
144143 array_push($this->verificationErrors, $e->toString());
145144 }
146 - $this->click("link=".$_SESSION["WIKI_EXTERNAL_LINK_TITLE"]);
147 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 145+ $this->click(LINK_START.(WIKI_EXTERNAL_LINK_TITLE));
 146+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
148147 try {
149 - $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getTitle());
 148+ $this->assertEquals((WIKI_EXTERNAL_LINK_TITLE), $this->getTitle());
150149 } catch (PHPUnit_Framework_AssertionFailedError $e) {
151150 parent::doCreateScreenShot(__FUNCTION__);
152151 array_push($this->verificationErrors, $e->toString());
153152 }
154 -
155153 }
156154
157155 // Add external link with Blank display text and verify
158156 function verifyExternalLinkWithBlankDisplayText(){
159 - $this->type("wpTextbox1", "");
160 - $this->click("link=Link");
161 - $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_EXTERNAL_LINK"]);
162 - $this->type("wikieditor-toolbar-link-int-text", "");
 157+ $this->type(TEXT_EDITOR, "");
 158+ $this->click(LINK_ADDLINK);
 159+ $this->type(TEXT_LINKNAME, (WIKI_EXTERNAL_LINK));
 160+ $this->type(TEXT_LINKDISPLAYNAME, "");
163161 try {
164 - $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external"));
 162+ $this->assertTrue($this->isElementPresent(ICON_PAGEEXTERNAL));
165163 } catch (PHPUnit_Framework_AssertionFailedError $e) {
166164 parent::doCreateScreenShot(__FUNCTION__);
167165 array_push($this->verificationErrors, $e->toString());
168166 }
169 - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext"));
170 - $this->click("//div[13]/div[11]/button[1]");
171 - $this->click("wpPreview");
172 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 167+ $this->assertEquals("on", $this->getValue(OPT_EXTERNAL));
 168+ $this->click(BUTTON_INSERTLINK);
 169+ $this->click(BUTTON_PREVIEW);
 170+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
173171 try {
174 - $this->assertEquals("[1]", $this->getText("link=[1]"));
 172+ $this->assertEquals("[1]", $this->getText(LINK_START ."[1]"));
175173 } catch (PHPUnit_Framework_AssertionFailedError $e) {
176174 parent::doCreateScreenShot(__FUNCTION__);
177175 array_push($this->verificationErrors, $e->toString());
178176 }
179 - $this->click("link=[1]");
180 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 177+ $this->click(LINK_START . "[1]");
 178+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
181179 try {
182 - $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getTitle());
 180+ $this->assertEquals((WIKI_EXTERNAL_LINK_TITLE), $this->getTitle());
183181 } catch (PHPUnit_Framework_AssertionFailedError $e) {
184182 parent::doCreateScreenShot(__FUNCTION__);
185183 array_push($this->verificationErrors, $e->toString());
@@ -187,17 +185,24 @@
188186
189187 // Add a table and verify
190188 function verifyCreateTable(){
 189+ $WIKI_TABLE_ROW = 2;
 190+ $WIKI_TABLE_COL = "5";
191191 parent::doExpandAdvanceSection();
192 - $this->type("wpTextbox1", "");
193 - $this->click("link=Table");
194 - $this->type("wpTextbox1", "");
195 - $this->click("wikieditor-toolbar-table-sortable");
196 - $this->click("//div[3]/button[1]");
197 - $this->click("wikieditor-toolbar-table-sortable");
198 - $this->click("wpPreview");
199 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 192+ $this->type(TEXT_EDITOR, "");
 193+ $this->click(LINK_ADDTABLE);
 194+ $this->click(CHK_SORT);
 195+ $this->type(TEXT_ROW, $WIKI_TABLE_ROW);
 196+ $this->type(TEXT_COL, $WIKI_TABLE_COL);
 197+ $this->click(BUTTON_INSERTABLE);
 198+ $this->click(CHK_SORT);
 199+ $this->click(BUTTON_PREVIEW);
 200+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
200201 try {
201 - $this->assertEquals("Header text", $this->getText("//table[@id='sortable_table_id_0']/tbody/tr[1]/th[3]"));
 202+ $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1;
 203+ $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER .
 204+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
 205+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
 206+ TEXT_VALIDATE_TABLE_PART3 ));
202207 } catch (PHPUnit_Framework_AssertionFailedError $e) {
203208 parent::doCreateScreenShot(__FUNCTION__);
204209 array_push($this->verificationErrors, $e->toString());
@@ -206,18 +211,23 @@
207212
208213 // Add a table and verify only with head row
209214 function verifyCreateTableWithHeadRow(){
 215+ $WIKI_TABLE_ROW = 3;
 216+ $WIKI_TABLE_COL = "4";
210217 parent::doExpandAdvanceSection();
211 - $this->type("wpTextbox1", "");
212 - $this->click("link=Table");
213 - $this->click("wikieditor-toolbar-table-wikitable");
214 - $this->type("wikieditor-toolbar-table-dimensions-rows", "4");
215 - $this->type("wikieditor-toolbar-table-dimensions-columns", "4");
216 - $this->click("//div[3]/button[1]");
217 - $this->click("wikieditor-toolbar-table-wikitable");
218 - $this->click("wpPreview");
219 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 218+ $this->type(TEXT_EDITOR, "");
 219+ $this->click(LINK_ADDTABLE);
 220+ $this->click(CHK_BOARDER);
 221+ $this->type(TEXT_ROW, $WIKI_TABLE_ROW);
 222+ $this->type(TEXT_COL, $WIKI_TABLE_COL);
 223+ $this->click(BUTTON_INSERTABLE);
 224+ $this->click(BUTTON_PREVIEW);
 225+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
220226 try {
221 - $this->assertEquals("Header text", $this->getTable("//div[@id='wikiPreview']/table.0.0"));
 227+ $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1;
 228+ $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER .
 229+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
 230+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
 231+ TEXT_VALIDATE_TABLE_PART3));
222232 } catch (PHPUnit_Framework_AssertionFailedError $e) {
223233 parent::doCreateScreenShot(__FUNCTION__);
224234 array_push($this->verificationErrors, $e->toString());
@@ -226,16 +236,22 @@
227237
228238 // Add a table and verify only with borders
229239 function verifyCreateTableWithBorders(){
230 - $this->type("wpTextbox1", "");
231 - $this->click("link=Table");
232 - $this->click("wikieditor-toolbar-table-dimensions-header");
233 - $this->type("wikieditor-toolbar-table-dimensions-columns", "5");
234 - $this->click("//div[3]/button[1]");
235 - $this->click("wikieditor-toolbar-table-dimensions-header");
236 - $this->click("wpPreview");
237 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 240+ $WIKI_TABLE_ROW = "4";
 241+ $WIKI_TABLE_COL = "6";
 242+ $this->type(TEXT_EDITOR, "");
 243+ $this->click(LINK_ADDTABLE);
 244+ $this->click(CHK_HEADER);
 245+ $this->type(TEXT_ROW,$WIKI_TABLE_ROW);
 246+ $this->type(TEXT_COL,$WIKI_TABLE_COL);
 247+ $this->click(BUTTON_INSERTABLE);
 248+ $this->click(CHK_HEADER);
 249+ $this->click(BUTTON_PREVIEW);
 250+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
238251 try {
239 - $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.1.3"));
 252+ $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER .
 253+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
 254+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
 255+ TEXT_VALIDATE_TABLE_PART3));
240256 } catch (PHPUnit_Framework_AssertionFailedError $e) {
241257 parent::doCreateScreenShot(__FUNCTION__);
242258 array_push($this->verificationErrors, $e->toString());
@@ -244,21 +260,26 @@
245261
246262 // Add a table and verify only with sort row
247263 function verifyCreateTableWithSortRow(){
248 - $this->type("wpTextbox1", "");
249 - $this->click("link=Table");
250 - $this->click("wikieditor-toolbar-table-dimensions-header");
251 - $this->click("wikieditor-toolbar-table-wikitable");
252 - $this->click("wikieditor-toolbar-table-sortable");
253 - $this->type("wikieditor-toolbar-table-dimensions-rows", "2");
254 - $this->type("wikieditor-toolbar-table-dimensions-columns", "5");
255 - $this->click("//div[3]/button[1]");
256 - $this->click("wikieditor-toolbar-table-dimensions-header");
257 - $this->click("wikieditor-toolbar-table-wikitable");
258 - $this->click("wikieditor-toolbar-table-sortable");
259 - $this->click("wpPreview");
260 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 264+ $WIKI_TABLE_ROW = "2";
 265+ $WIKI_TABLE_COL = "5";
 266+ $this->type(TEXT_EDITOR, "");
 267+ $this->click(LINK_ADDTABLE);
 268+ $this->click(CHK_HEADER);
 269+ $this->click(CHK_BOARDER);
 270+ $this->click(CHK_SORT);
 271+ $this->type(TEXT_ROW, $WIKI_TABLE_ROW);
 272+ $this->type(TEXT_COL, $WIKI_TABLE_COL);
 273+ $this->click(BUTTON_INSERTABLE);
 274+ $this->click(CHK_HEADER);
 275+ $this->click(CHK_BOARDER);
 276+ $this->click(CHK_SORT);
 277+ $this->click(BUTTON_PREVIEW);
 278+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
261279 try {
262 - $this->assertEquals("Example", $this->getTable("sortable_table_id_0.0.0"));
 280+ $this->assertTrue($this->isElementPresent(TEXT_TABLEID_WITHALLFEATURES .
 281+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
 282+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
 283+ TEXT_VALIDATE_TABLE_PART3));
263284 } catch (PHPUnit_Framework_AssertionFailedError $e) {
264285 parent::doCreateScreenShot(__FUNCTION__);
265286 array_push($this->verificationErrors, $e->toString());
@@ -267,52 +288,83 @@
268289
269290 // Add a table without headers,borders and sort rows
270291 function verifyCreateTableWithNoSpecialEffects(){
 292+ $WIKI_TABLE_ROW = "6";
 293+ $WIKI_TABLE_COL = "2";
271294 parent::doExpandAdvanceSection();
272 - $this->type("wpTextbox1", "");
273 - $this->click("link=Table");
274 - $this->click("wikieditor-toolbar-table-wikitable");
275 - $this->click("wikieditor-toolbar-table-dimensions-header");
276 - $this->type("wikieditor-toolbar-table-dimensions-rows", "6");
277 - $this->type("wikieditor-toolbar-table-dimensions-columns", "2");
278 - $this->click("//div[3]/button[1]");
279 - $this->click("wikieditor-toolbar-table-dimensions-header");
280 - $this->click("wikieditor-toolbar-table-wikitable");
281 - $this->click("wpPreview");
282 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 295+ $this->type(TEXT_EDITOR, "");
 296+ $this->click(LINK_ADDTABLE);
 297+ $this->click(CHK_BOARDER);
 298+ $this->click(CHK_HEADER);
 299+ $this->type(TEXT_ROW, $WIKI_TABLE_ROW);
 300+ $this->type(TEXT_COL, $WIKI_TABLE_COL);
 301+ $this->click(BUTTON_INSERTABLE);
 302+ $this->click(CHK_BOARDER);
 303+ $this->click(CHK_HEADER);
 304+ $this->click(BUTTON_PREVIEW);
 305+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
283306 try {
284 - $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.0.0"));
 307+ $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER .
 308+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
 309+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
 310+ TEXT_VALIDATE_TABLE_PART3));
285311 } catch (PHPUnit_Framework_AssertionFailedError $e) {
286312 parent::doCreateScreenShot(__FUNCTION__);
287313 array_push($this->verificationErrors, $e->toString());
288314 }
289315 }
290 -
 316+
 317+ // Add a table with headers,borders and sort rows
 318+ function verifyCreateTableWithAllSpecialEffects(){
 319+ $WIKI_TABLE_ROW = 6;
 320+ $WIKI_TABLE_COL = "2";
 321+ parent::doExpandAdvanceSection();
 322+ $this->type(TEXT_EDITOR, "");
 323+ $this->click(LINK_ADDTABLE);
 324+ $this->click(CHK_SORT);
 325+ $this->type(TEXT_ROW, $WIKI_TABLE_ROW);
 326+ $this->type(TEXT_COL, $WIKI_TABLE_COL);
 327+ $this->click(BUTTON_INSERTABLE);
 328+ $this->click(CHK_SORT);
 329+ $this->click(BUTTON_PREVIEW);
 330+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
 331+ try {
 332+ $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1;
 333+ $this->assertTrue($this->isElementPresent(TEXT_TABLEID_WITHALLFEATURES .
 334+ TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .
 335+ TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .
 336+ TEXT_VALIDATE_TABLE_PART3));
 337+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 338+ parent::doCreateScreenShot(__FUNCTION__);
 339+ array_push($this->verificationErrors, $e->toString());
 340+ }
 341+ }
 342+
291343 // Verify the replace all function on Search and Replace
292344 function verifyTextSearchReplaceAll(){
293345 parent::doExpandAdvanceSection();
294 - $this->type("wpTextbox1", "");
295 - $this->click("link=Search and replace");
296 - $this->type("wpTextbox1", $_SESSION["WIKI_SAMPLE_TEXT"]);
297 - $this->type("wikieditor-toolbar-replace-search", $_SESSION["WIKI_SEARCH_TEXT"]);
298 - $this->type("wikieditor-toolbar-replace-replace", $_SESSION["WIKI_REPLACE_TEXT"]);
299 - $this->click("//button[3]");
300 - $this->click("//button[4]");
301 - $this->click("wpPreview");
302 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 346+ $this->type(TEXT_EDITOR, "");
 347+ $this->click(LINK_SEARCH);
 348+ $this->type(TEXT_EDITOR, (TEXT_SAMPLE));
 349+ $this->type(INPUT_SEARCH, (TEXT_SEARCH));
 350+ $this->type(INPUT_REPLACE, (TEXT_REPLACE));
 351+ $this->click(BUTTON_REPLACEALL);
 352+ $this->click(BUTTON_CANCEL);
 353+ $this->click(BUTTON_PREVIEW);
 354+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
303355 try {
304 - $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[1]"));
 356+ $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT1));
305357 } catch (PHPUnit_Framework_AssertionFailedError $e) {
306358 parent::doCreateScreenShot(__FUNCTION__);
307359 array_push($this->verificationErrors, $e->toString());
308360 }
309361 try {
310 - $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[2]"));
 362+ $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT2));
311363 } catch (PHPUnit_Framework_AssertionFailedError $e) {
312364 parent::doCreateScreenShot(__FUNCTION__);
313365 array_push($this->verificationErrors, $e->toString());
314366 }
315367 try {
316 - $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[3]"));
 368+ $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT3));
317369 } catch (PHPUnit_Framework_AssertionFailedError $e) {
318370 parent::doCreateScreenShot(__FUNCTION__);
319371 array_push($this->verificationErrors, $e->toString());
@@ -322,40 +374,38 @@
323375 // Verify the replace next function on Search and Replace
324376 function verifyTextSearchReplaceNext(){
325377 parent::doExpandAdvanceSection();
326 - $this->type("wpTextbox1", "");
327 - $this->click("link=Search and replace");
328 - $this->type("wpTextbox1", $_SESSION["WIKI_SAMPLE_TEXT"]);
329 - $this->click("link=Search and replace");
330 - $this->type("wpTextbox1", $_SESSION["WIKI_SAMPLE_TEXT"]);
331 - $this->type("wikieditor-toolbar-replace-search", $_SESSION["WIKI_SEARCH_TEXT"]);
332 - $this->type("wikieditor-toolbar-replace-replace", $_SESSION["WIKI_REPLACE_TEXT"]);
333 - $this->click("//div[13]/div[11]/button[2]");
334 - $this->click("//div[13]/div[11]/button[2]");
335 - $this->click("//button[4]");
336 - $this->click("wpPreview");
337 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 378+ $this->type(TEXT_EDITOR, "");
 379+ $this->click(LINK_SEARCH);
 380+ $this->type(TEXT_EDITOR, (TEXT_SAMPLE));
 381+ $this->type(INPUT_SEARCH, (TEXT_SEARCH));
 382+ $this->type(INPUT_REPLACE, (TEXT_REPLACE));
 383+ $this->click(BUTTON_REPLACENEXT);
 384+ $this->click(BUTTON_REPLACENEXT);
 385+ $this->click(BUTTON_CANCEL);
 386+ $this->click(BUTTON_PREVIEW);
 387+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
338388 try {
339 - $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[1]"));
 389+ $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT1));
340390 } catch (PHPUnit_Framework_AssertionFailedError $e) {
341391 parent::doCreateScreenShot(__FUNCTION__);
342392 array_push($this->verificationErrors, $e->toString());
343393 }
344394 try {
345 - $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[2]"));
 395+ $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT2));
346396 } catch (PHPUnit_Framework_AssertionFailedError $e) {
347397 parent::doCreateScreenShot(__FUNCTION__);
348398 array_push($this->verificationErrors, $e->toString());
349399 }
350400 try {
351 - $this->assertEquals($_SESSION["WIKI_SEARCH_TEXT"], $this->getText("//div[@id='wikiPreview']/p[3]"));
 401+ $this->assertEquals((TEXT_SEARCH), $this->getText(TEXT_PREVIEW_TEXT3));
352402 } catch (PHPUnit_Framework_AssertionFailedError $e) {
353403 parent::doCreateScreenShot(__FUNCTION__);
354404 array_push($this->verificationErrors, $e->toString());
355405 }
356406 }
357407
358 - /*
359 - * // When user click on find, text highlight on back which is not captured in Selenium directly.
 408+ /*/Verify the find next function on Search and Replace
 409+ // When user click on find, text highlight on back which is not captured in Selenium directly.
360410 function verifyTextSearchFindNext(){
361411 parent::doExpandAdvanceSection();
362412 $this->type("wpTextbox1", "");
@@ -363,7 +413,75 @@
364414 $this->click("link=Search and replace");
365415 $this->type("wikieditor-toolbar-replace-search", "Test");
366416
 417+ }*/
 418+
 419+
 420+ // Verify Match Case option with Replace All on Search and Replace
 421+ function verifyTextMatchCase(){
 422+ parent::doExpandAdvanceSection();
 423+ $this->type(TEXT_EDITOR, "");
 424+ $this->click(LINK_SEARCH);
 425+ $this->type(TEXT_EDITOR, (TEXT_SAMPLE_CASE));
 426+ $this->type(INPUT_SEARCH, (TEXT_SEARCH_CASE));
 427+ $this->type(INPUT_REPLACE, (TEXT_REPLACE));
 428+ $this->click(CHK_MATCHCASE);
 429+ $this->click(BUTTON_REPLACEALL);
 430+ $this->click(BUTTON_CANCEL);
 431+ $this->click(BUTTON_PREVIEW);
 432+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
 433+ try {
 434+ $this->assertEquals((TEXT_SEARCH), $this->getText(TEXT_PREVIEW_TEXT1));
 435+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 436+ parent::doCreateScreenShot(__FUNCTION__);
 437+ array_push($this->verificationErrors, $e->toString());
 438+ }
 439+ try {
 440+ $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT2));
 441+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 442+ parent::doCreateScreenShot(__FUNCTION__);
 443+ array_push($this->verificationErrors, $e->toString());
 444+ }
 445+ try {
 446+ $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT3));
 447+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 448+ parent::doCreateScreenShot(__FUNCTION__);
 449+ array_push($this->verificationErrors, $e->toString());
 450+ }
 451+
367452 }
368 - */
 453+
 454+ // Verify Regular expression option with Replace All on Search and Replace
 455+ function verifyRegEx(){
 456+ parent::doExpandAdvanceSection();
 457+ $this->type(TEXT_EDITOR, "");
 458+ $this->click(LINK_SEARCH);
 459+ $this->type(TEXT_EDITOR, (TEXT_SAMPLE_REGEX));
 460+ $this->type(INPUT_SEARCH, (TEXT_SEARCH_REGEX));
 461+ $this->type(INPUT_REPLACE, (TEXT_REPLACE_REGEX));
 462+ $this->click(CHK_REGEX);
 463+ $this->click(BUTTON_REPLACEALL);
 464+ $this->click(BUTTON_CANCEL);
 465+ $this->click(BUTTON_PREVIEW);
 466+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
 467+ try {
 468+ $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT1));
 469+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 470+ parent::doCreateScreenShot(__FUNCTION__);
 471+ array_push($this->verificationErrors, $e->toString());
 472+ }
 473+ try {
 474+ $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT2));
 475+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 476+ parent::doCreateScreenShot(__FUNCTION__);
 477+ array_push($this->verificationErrors, $e->toString());
 478+ }
 479+ try {
 480+ $this->assertEquals((TEXT_REGEX_PREVIEW), $this->getText(TEXT_PREVIEW_TEXT3));
 481+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 482+ parent::doCreateScreenShot(__FUNCTION__);
 483+ array_push($this->verificationErrors, $e->toString());
 484+ }
 485+ }
 486+
369487 }
370 -?>
 488+?>
\ No newline at end of file
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_NewPage.php
@@ -12,7 +12,6 @@
1313 parent::setUp();
1414 }
1515
16 -
1716 //Create a new page temporary
1817 function createNewPage(){
1918 parent::doOpenLink();
@@ -22,11 +21,18 @@
2322
2423 // Click on Embedded file function and verify the output
2524 function testEmbeddedFile(){
26 - $this->createNewPage();
 25+ $this->createNewPage();
2726 parent::verifyEmbeddedFile();
2827 parent::doLogout();
2928 }
3029
 30+ //Create a reference and verify the output
 31+ function testReferenceLink(){
 32+ $this->createNewPage();
 33+ parent::verifyReference();
 34+ parent::doLogout();
 35+ }
 36+
3137 // Click on Picture Gallery function and verify the output
3238 function testPictureGallery(){
3339 $this->createNewPage();
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_ExistingPage.php
@@ -28,6 +28,14 @@
2929 parent::doLogout();
3030 }
3131
 32+ //Create a reference and verify the output
 33+ function testReferenceLink(){
 34+ $this->openRandomPage();
 35+ parent::verifyReference();
 36+ parent::doLogout();
 37+ }
 38+
 39+
3240 // Click on Picture Gallery function and verify the output
3341 function testPictureGallery(){
3442 $this->openRandomPage();
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_ExsistingPage.php
@@ -25,7 +25,8 @@
2626 parent::doLogout();
2727 }
2828
29 - // Add a internal link with different display text and verify
 29+
 30+ // Add a internal link with different display text and verify
3031 function testInternalLinkWithDisplayText(){
3132 $this->openRandomPage();
3233 parent::verifyInternalLinkWithDisplayText();
@@ -95,6 +96,12 @@
9697 parent::doLogout();
9798 }
9899
 100+ // Add a table with headers,borders and sort rows
 101+ function testCreateTableWithAllSpecialEffects(){
 102+ $this->openRandomPage();
 103+ parent::verifyCreateTableWithAllSpecialEffects();
 104+ parent::doLogout();
 105+ }
99106 // Verify the replace all function on Search and Replace
100107 function testTextSearchReplaceAll(){
101108 $this->openRandomPage();
@@ -109,8 +116,8 @@
110117 parent::doLogout();
111118 }
112119
113 - // When user click on find, text highlight on back which is not captured in Selenium directly. */
114 - /* function testTextSearchFindNext(){
 120+ // When user click on find, text highlight on back which is not captured in Selenium directly.
 121+ function testTextSearchFindNext(){
115122 parent::doOpenLink();
116123 parent::doLogin();
117124 $this->open("/deployment-en/Main_Page");
@@ -118,6 +125,20 @@
119126 parent::doAccessRandomPage();
120127 parent::verifyTextSearchFindNext();
121128 parent::doLogout();
122 - }*/
 129+ }
 130+
 131+ // Verify the Match Case option with Replace All on Search and Replace
 132+ function testTextMatchCase(){
 133+ $this->openRandomPage();
 134+ parent::verifyTextMatchCase();
 135+ parent::doLogout();
 136+ }
 137+
 138+ //Verify Regular expression option with Replace All on Search and Replace
 139+ function testRegEx(){
 140+ $this->openRandomPage();
 141+ parent::verifyRegEx();
 142+ parent::doLogout();
 143+ }
123144 }
124145 ?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/Config.php
@@ -4,22 +4,190 @@
55 * Date : Apr - 2010
66 * @author : BhagyaG - Calcey
77 */
8 -$_SESSION["WIKI_WEB_URL"]="http://prototype.wikimedia.org/"; // The web site URL
9 -$_SESSION["WIKI_OPEN_PAGE"]= "/en.wikipedia.org/Main_Page"; // Main page URL
10 -$_SESSION["WIKI_TEST_WAIT_TIME"]= "30000"; // Waiting time
11 -$_SESSION["WIKI_USER_NAME"]= "bhagya_ca"; // User name
12 -$_SESSION["WIKI_USER_PASSWORD"]= "test"; // Password
13 -$_SESSION["WIKI_USER_DISPLAY_NAME"]= "Bhagya ca"; // Display name of the user
14 -$_SESSION["WIKI_SEARCH_PAGE"]= "Hair (musical)"; // Page name to search
15 -$_SESSION["WIKI_SEARCH_TEXT"]= "TV"; // Text to search
16 -$_SESSION["WIKI_INTERNAL_LINK"]= "Daimler-Chrysler"; // Exisiting page name to add as an internal tag
17 -$_SESSION["WIKI_EXTERNAL_LINK"]= "www.google.com"; // External web site name
18 -$_SESSION["WIKI_EXTERNAL_LINK_TITLE"] = "Google"; // Page title of the external web site name
19 -$_SESSION["WIKI_SAMPLE_TEXT"] = "calcey qa\n\ncalcey qa\n\ncalcey qa"; // String to type in the editor to use for search and replace
20 -$_SESSION["WIKI_SEARCH_TEXT"] = "calcey qa"; // Text use for search
21 -$_SESSION["WIKI_REPLACE_TEXT"] = "test team" ; // Text use for replace search text
22 -$_SESSION["WIKI_CODE_PATH"] = getcwd();
23 -$_SESSION["WIKI_SCREENSHOTS_PATH"] = "screenshots";
24 -$_SESSION["WIKI_SCREENSHOTS_TYPE"] = "png";
 8+// Common variables
259
 10+define ('WIKI_WEB_URL', "http://prototype.wikimedia.org/"); // Domain name
 11+define ('WIKI_OPEN_PAGE',"/en.wikipedia.org/Main_Page"); // Main page URL
 12+
 13+define ('WIKI_TEST_WAIT_TIME', "30000"); // Waiting time
 14+define ('WIKI_USER_NAME', "bhagya_ca"); // User name
 15+define ('WIKI_USER_PASSWORD', "test"); // Password
 16+define ('WIKI_USER_DISPLAY_NAME', "Bhagya ca"); // Display name of the user
 17+define ('WIKI_SEARCH_PAGE',"Hair (musical)"); // Page name to search
 18+define ('WIKI_TEXT_SEARCH',"TV"); // Text to search
 19+define ('WIKI_INTERNAL_LINK',"Daimler-Chrysler"); // Exisiting page name to add as an internal tag
 20+define ('WIKI_EXTERNAL_LINK',"www.google.com"); // External web site name
 21+define ('WIKI_EXTERNAL_LINK_TITLE',"Google"); // Page title of the external web site name
 22+define ('WIKI_CODE_PATH',getcwd()); // get the current path of the program
 23+define ('WIKI_SCREENSHOTS_PATH',"screenshots"); // the folder the error screen shots will be saved
 24+define ('WIKI_SCREENSHOTS_TYPE',"png"); // screen print type
 25+define ('WIKI_TEMP_NEWPAGE',"TestWikiPage"); // temporary creating new page name
 26+
 27+
 28+// tool bar, buttons , links
 29+// commonly using links
 30+define ('LINK_MAIN_PAGE',"link=Main page");
 31+define ('LINK_RANDOM_PAGE',"link=Random article");
 32+define ('TEXT_PAGE_HEADING',"firstHeading");
 33+define ('LINK_START',"link=");
 34+define ('LINK_EDITPAGE',"//li[@id='ca-edit']/a/span");
 35+define ('TEXT_EDITOR',"wpTextbox1");
 36+define ('BUTTON_PREVIEW',"wpPreview");
 37+
 38+// for WikiSearch_TC
 39+define ('INPUT_SEARCH_BOX', "searchInput");
 40+define ('BUTTON_SEARCH',"searchButton");
 41+define ('TEXT_SEARCH_RESULT_HEADING'," - Search results - Wikipedia, the free encyclopedia");
 42+
 43+// for WikiWatchUnWatch_TC
 44+define ('LINK_WATCH_PAGE',"link=Watch");
 45+define ('LINK_WATCH_LIST',"link=My watchlist");
 46+define ('LINK_WATCH_EDIT',"link=View and edit watchlist");
 47+define ('LINK_UNWATCH',"link=Unwatch");
 48+define ('BUTTON_WATCH',"wpWatchthis");
 49+define ('BUTTON_SAVE_WATCH',"wpSave");
 50+define ('TEXT_WATCH',"Watch");
 51+define ('TEXT_UNWATCH',"Unwatch");
 52+
 53+// for WikiCommonFunction_TC
 54+define ('TEXT_LOGOUT',"Log out");
 55+define ('LINK_LOGOUT',"link=Log out");
 56+define ('LINK_LOGIN',"link=Log in / create account");
 57+define ('TEXT_LOGOUT_CONFIRM',"Log in / create account");
 58+define ('INPUT_USER_NAME', "wpName1");
 59+define ('INPUT_PASSWD', "wpPassword1");
 60+define ('BUTTON_LOGIN',"wpLoginAttempt");
 61+define ('TEXT_HEADING',"Heading");
 62+define ('LINK_ADVANCED',"link=Advanced");
 63+
 64+// for WikiDialogs_TC
 65+define ('LINK_ADDLINK',"//div[@id='wikiEditor-ui-toolbar']/div[1]/div[2]/span[1]");
 66+define ('TEXT_LINKNAME',"wikieditor-toolbar-link-int-target");
 67+define ('TEXT_LINKDISPLAYNAME',"wikieditor-toolbar-link-int-text");
 68+define ('TEXT_LINKDISPLAYNAME_APPENDTEXT'," Test");
 69+define ('ICON_PAGEEXISTS',"wikieditor-toolbar-link-int-target-status-exists");
 70+define ('ICON_PAGEEXTERNAL',"wikieditor-toolbar-link-int-target-status-external");
 71+define ('OPT_INTERNAL',"wikieditor-toolbar-link-type-int");
 72+define ('OPT_EXTERNAL',"wikieditor-toolbar-link-type-ext");
 73+define ('BUTTON_INSERTLINK',"//div[10]/div[11]/button[1]");
 74+define ('LINK_ADDTABLE',"//div[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[4]/span[2]");
 75+define ('CHK_HEADER',"wikieditor-toolbar-table-dimensions-header");
 76+define ('CHK_BOARDER',"wikieditor-toolbar-table-wikitable");
 77+define ('CHK_SORT',"wikieditor-toolbar-table-sortable");
 78+define ('TEXT_ROW',"wikieditor-toolbar-table-dimensions-rows");
 79+define ('TEXT_COL',"wikieditor-toolbar-table-dimensions-columns");
 80+define ('BUTTON_INSERTABLE',"//div[3]/button[1]");
 81+define ('TEXT_HEADTABLE_TEXT',"Header text");
 82+define ('TEXT_TABLEID_WITHALLFEATURES', "//table[@id='sortable_table_id_0']/tbody/" );
 83+define ('TEXT_TABLEID_OTHER', "//div[@id='wikiPreview']/table/tbody/" );
 84+define ('TEXT_VALIDATE_TABLE_PART1', "tr[");
 85+define ('TEXT_VALIDATE_TABLE_PART2',"]/td[");
 86+define ('TEXT_VALIDATE_TABLE_PART3',"]");
 87+define ('LINK_SEARCH',"//div[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[5]/span");
 88+define ('INPUT_SEARCH',"wikieditor-toolbar-replace-search");
 89+define ('INPUT_REPLACE',"wikieditor-toolbar-replace-replace");
 90+define ('BUTTON_REPLACEALL',"//button[3]");
 91+define ('BUTTON_REPLACENEXT',"//button[2]");
 92+define ('BUTTON_CANCEL',"//button[4]");
 93+define ('TEXT_PREVIEW_TEXT1',"//div[@id='wikiPreview']/p[1]");
 94+define ('TEXT_PREVIEW_TEXT2',"//div[@id='wikiPreview']/p[2]");
 95+define ('TEXT_PREVIEW_TEXT3',"//div[@id='wikiPreview']/p[3]");
 96+define ('TEXT_SAMPLE',"calcey qa\n\ncalcey qa\n\ncalcey qa");
 97+define ('TEXT_SAMPLE_CASE',"calcey qa\n\nCalcey qa\n\nCalcey qa");
 98+define ('TEXT_SAMPLE_REGEX',"testing Plan\n\ntest Plan\n\ntestQA Plan");
 99+define ('TEXT_SEARCH',"calcey qa");
 100+define ('TEXT_SEARCH_CASE',"Calcey qa");
 101+define ('TEXT_SEARCH_REGEX',"test[^ ]*");
 102+define ('TEXT_REPLACE',"test team") ;
 103+define ('TEXT_REPLACE_REGEX',"QA") ;
 104+define ('TEXT_REGEX_PREVIEW',"QA Plan") ;
 105+define ('CHK_MATCHCASE',"wikieditor-toolbar-replace-case");
 106+define ('CHK_REGEX',"wikieditor-toolbar-replace-regex");
 107+
 108+
 109+// For WikiTextFormat_TC
 110+define ('LINK_BOLD',"//*[@id='wikiEditor-ui-toolbar']/div[1]/div[1]/span[1]");
 111+define ('TEXT_BOLD',"'''Bold''' text");
 112+define ('TEXT_VALIDATE_BOLD',"Bold");
 113+define ('TEXT_VALIDATE_BOLDTEXT',"//div[@id='wikiPreview']/p/b");
 114+define ('LINK_ITALIC',"//*[@id='wikiEditor-ui-toolbar']/div[1]/div[1]/span[2]");
 115+define ('TEXT_ITALIC',"''Italian'' text");
 116+define ('TEXT_VALIDATE_ITALIC',"Italian");
 117+define ('TEXT_VALIDATE_ITALICTEXT',"//div[@id='wikiPreview']/p/i");
 118+define ('TEXT_ITALIC_BOLD',"Text '''''Italic & Bold'''''");
 119+define ('TEXT_VALIDATE_ITALICBOLD',"Italic & Bold");
 120+define ('TEXT_VALIDATE_ITALICBOLDTEXT',"//div[@id='wikiPreview']/p/i/b");
 121+define ('LINK_BULLET',"//*[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[2]/span[1]");
 122+define ('TEXT_BULLET',"* Bulleted list item\n* Bulleted list item\n* Bulleted list item");
 123+define ('TEXT_BULLET_TEXT',"Bulleted list item");
 124+define ('TEXT_BULLET_1',"//div[@id='wikiPreview']/ul/li[1]");
 125+define ('TEXT_BULLET_2',"//div[@id='wikiPreview']/ul/li[2]");
 126+define ('TEXT_BULLET_3',"//div[@id='wikiPreview']/ul/li[3]");
 127+define ('LINK_NUMBERED',"//*[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[2]/span[2]");
 128+define ('TEXT_NUMBERED',"# Numbered list item\n# Numbered list item\n# Numbered list item");
 129+define ('TEXT_NUMBERED_TEXT',"Numbered list item");
 130+define ('TEXT_NUMBERED_1',"//div[@id='wikiPreview']/ol/li[1]");
 131+define ('TEXT_NUMBERED_2',"//div[@id='wikiPreview']/ol/li[2]");
 132+define ('TEXT_NUMBERED_3',"//div[@id='wikiPreview']/ol/li[3]");
 133+define ('TEXT_NOWIKI',"<nowiki>==Heading text==</nowiki>");
 134+define ('TEXT_NOWIKI_TEXT',"==Heading text==");
 135+define ('TEXT_NOWIKI_VALIDATE',"//div[@id='wikiPreview']/p");
 136+define ('TEXT_LINEBREAK',"this is a test text to check the line\n break.");
 137+define ('TEXT_LINEBREAK_TEXT',"this is a test text to check the line\n break.");
 138+define ('TEXT_LINEBREAK_VALIDATE',"//div[@id='wikiPreview']/p");
 139+define ('LINK_TEXTBIG',"//*[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[3]/span[1]");
 140+define ('TEXT_TEXTBIG',"<big>This</big> text");
 141+define ('TEXT_TEXTBIG_TEXT',"This");
 142+define ('TEXT_TEXTBIG_VALIDATE',"//div[@id='wikiPreview']/p/big");
 143+define ('LINK_TEXTSMALL',"//*[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[3]/span[2]");
 144+define ('TEXT_TEXTSMALL',"<small>This</small> text\n");
 145+define ('TEXT_TEXTSMALL_TEXT',"This");
 146+define ('TEXT_TEXTSMALL_VALIDATE',"//div[@id='wikiPreview']/p/small");
 147+define ('LINK_TEXTSUPER',"//*[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[3]/span[3]");
 148+define ('TEXT_TEXTSUPER',"<sup>This</sup> text\n");
 149+define ('TEXT_TEXTSUPER_TEXT',"This");
 150+define ('TEXT_TEXTSUPER_VALIDATE',"//div[@id='wikiPreview']/p/sup");
 151+define ('LINK_TEXTSUB',"//*[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[3]/span[4]");
 152+define ('TEXT_TEXTSUB', "<sub>This</sub> text\n");
 153+define ('TEXT_TEXTSUB_TEXT',"This");
 154+define ('TEXT_TEXTSUB_VALIDATE',"//div[@id='wikiPreview']/p/sub");
 155+
 156+// for WikiToolBarOther_TC
 157+
 158+define ('LINK_TEXTEMBEDDED',"//*[@id='wikiEditor-ui-toolbar']/div[1]/div[2]/span[2]");
 159+define ('TEXT_TEXTEMBEDDED',"[[File:Example.jpg]]");
 160+define ('TEXT_TEXTEMBEDDED_VALIDATE',"//img[@alt='Example.jpg']");
 161+
 162+define ('LINK_TEXTREFERENCE',"//*[@id='wikiEditor-ui-toolbar']/div[1]/div[2]/span[3]");
 163+define ('INPUT_TEXTREFERENCE', "wikieditor-toolbar-reference-text");
 164+define ('TEXT_TEXTREFERENCE', "Test Reference");
 165+define ('BUTTON_REFERENCE', "//button[@type='button']");
 166+define ('TEXT_TEXTREFERENCE_EDITOR',"This is a text <ref>Test Reference</ref>\n\n\n{{reflist}}");
 167+define ('TEXT_REFERENCEID', "[1]");
 168+define ('TEXT_REFERENCELINK', "link=[1]");
 169+define ('TEXT_REFERENCE', "^ Test Reference");
 170+define ('TEXT_PICTURELINK', "//*[@id='wikiEditor-ui-toolbar']/div[3]/div[1]/div[4]/span[1]");
 171+define ('IMAGE_EXAMPLE1',"//img[contains(@src,'http://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Example.jpg/116px-Example.jpg')]");
 172+define ('TEXT_IMG1CAPTION',"Caption1");
 173+define ('TABLE_CAPTION1',"//div[@id='wikiPreview']/table.0.0");
 174+define ('IMAGE_EXAMPLE2',"//div[@id='wikiPreview']/table/tbody/tr/td[2]/div/div[1]/div/a/img");
 175+define ('TEXT_IMG2CAPTION',"Caption2");
 176+define ('TABLE_CAPTION2',"//div[@id='wikiPreview']/table.0.1");
 177+
 178+
 179+// for WikiNTOC_TC
 180+define ('LINK_HEADER',"link=Heading");
 181+define ('TEXT_HEADER',"Heading text");
 182+define ('LINK_LEVEL2HEADER',"link=Level 2");
 183+define ('TEXT_LEVEL2HEADER',"==Heading text==");
 184+define ('TEXT_LEVEL2HEADER_SIZE',"//*[@id='wikiPreview']/h2");
 185+define ('LINK_LEVEL3HEADER',"link=Level 3");
 186+define ('TEXT_LEVEL3HEADER',"===Heading text===");
 187+define ('TEXT_LEVEL3HEADER_SIZE',"//*[@id='wikiPreview']/h3");
 188+define ('LINK_LEVEL4HEADER',"link=Level 4");
 189+define ('TEXT_LEVEL4HEADER',"====Heading text====");
 190+define ('TEXT_LEVEL4HEADER_SIZE',"//*[@id='wikiPreview']/h4");
 191+define ('LINK_LEVEL5HEADER',"link=Level 5");
 192+define ('TEXT_LEVEL5HEADER',"=====Heading text=====");
 193+define ('TEXT_LEVEL5HEADER_SIZE',"//*[@id='wikiPreview']/h5");
26194 ?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikSearch_TC.php
@@ -1,9 +1,6 @@
22 <?php
3 -session_start();
4 -require_once('log4php/Logger.php');
5 -Logger::configure('log4php.properties');
63 require_once 'WikiCommonFunction_TC.php';
7 -require_once 'Config.php';
 4+include 'Config.php';
85
96 /**
107 * This test case will be handling the search function.
@@ -11,54 +8,44 @@
129 * @author : BhagyaG - Calcey
1310 */
1411 class WikiSearch_TC extends WikiCommonFunction_TC {
15 - private $logger;
1612
1713 // Set up the testing environment
1814 function setup(){
1915 parent::setUp();
20 - $this->logger = Logger::getLogger(__CLASS__);
2116 }
2217
23 -
2418 // Search for a Wiki Page. Search result should be directed to the page itself
2519 function testSearchPage(){
26 - $this->logger->info('Test Search Page - Start');
2720 parent::doOpenLink();
2821 parent::doLogin();
29 - $this->click("link=Main page");
30 - $this->type("//*[@id='searchInput']", $_SESSION["WIKI_SEARCH_PAGE"]);
31 - $this->click("//*[@id='searchButton']");
32 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 22+ $this->type(INPUT_SEARCH_BOX,(WIKI_SEARCH_PAGE));
 23+ $this->click(BUTTON_SEARCH);
 24+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
3325 try {
34 - $this->assertEquals($_SESSION["WIKI_SEARCH_PAGE"], $this->getText("//*[@id='firstHeading']"));
 26+ $this->assertEquals((WIKI_SEARCH_PAGE), $this->getText(TEXT_PAGE_HEADING));
3527 } catch (PHPUnit_Framework_AssertionFailedError $e) {
3628 parent::doCreateScreenShot(__FUNCTION__);
3729 array_push($this->verificationErrors, $e->toString());
3830 }
39 - $this->click("link=Main page");
40 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
4131 parent::doLogout();
42 - $this->logger->info('Test Search Page - End');
4332 }
4433
45 -
4634 // Search for a text. Search result should display links which contain the search text
4735 function testSearchText(){
4836 parent::doOpenLink();
4937 parent::doLogin();
50 - $this->click("link=Main page");
51 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
52 - $this->type("//*[@id='searchInput']",$_SESSION["WIKI_SEARCH_TEXT"]);
53 - $this->click("searchButton");
54 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 38+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 39+ $this->type(INPUT_SEARCH_BOX,WIKI_TEXT_SEARCH);
 40+ $this->click(BUTTON_SEARCH);
 41+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
5542 try {
56 - $this->assertEquals("Search results", $this->getText("firstHeading"));
 43+ $this->assertEquals("Search results", $this->getText(TEXT_PAGE_HEADING));
5744 } catch (PHPUnit_Framework_AssertionFailedError $e) {
5845 parent::doCreateScreenShot(__FUNCTION__);
5946 array_push($this->verificationErrors, $e->toString());
6047 }
6148 try {
62 - $this->assertEquals($_SESSION["WIKI_SEARCH_TEXT"] . " - Search results - Wikipedia, the free encyclopedia", $this->getTitle());
 49+ $this->assertEquals((WIKI_TEXT_SEARCH) . TEXT_SEARCH_RESULT_HEADING, $this->getTitle());
6350 } catch (PHPUnit_Framework_AssertionFailedError $e) {
6451 parent::doCreateScreenShot(__FUNCTION__);
6552 array_push($this->verificationErrors, $e->toString());
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTextFormat_TC.php
@@ -11,28 +11,29 @@
1212
1313 // Mark text Bold and verify output
1414 function verifyTextBold(){
15 - $this->type("wpTextbox1", "");
16 - $this->click("link=Bold");
17 - $this->type("wpTextbox1", "'''Bold''' text");
18 - $this->click("wpPreview");
19 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 15+ $this->type(TEXT_EDITOR, "");
 16+ $this->click(LINK_BOLD);
 17+ $this->type(TEXT_EDITOR,TEXT_BOLD);
 18+ $this->click(BUTTON_PREVIEW);
 19+ $this->waitForPageToLoad(50000);
2020 try {
21 - $this->assertEquals("Bold", $this->getText("//div[@id='wikiPreview']/p/b"));
 21+ $this->assertEquals(TEXT_VALIDATE_BOLD, $this->getText(TEXT_VALIDATE_BOLDTEXT));
2222 } catch (PHPUnit_Framework_AssertionFailedError $e) {
2323 parent::doCreateScreenShot(__FUNCTION__);
2424 array_push($this->verificationErrors, $e->toString());
2525 }
 26+
2627 }
2728
2829 // Mark text Italic and verify output
2930 function verifyTextItalic(){
30 - $this->type("wpTextbox1", "");
31 - $this->click("link=Italic");
32 - $this->type("wpTextbox1", "''Italian'' text");
33 - $this->click("wpPreview");
34 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 31+ $this->type(TEXT_EDITOR, "");
 32+ $this->click(LINK_ITALIC);
 33+ $this->type(TEXT_EDITOR, TEXT_ITALIC);
 34+ $this->click(BUTTON_PREVIEW);
 35+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
3536 try {
36 - $this->assertEquals("Italian", $this->getText("//div[@id='wikiPreview']/p/i"));
 37+ $this->assertEquals(TEXT_VALIDATE_ITALIC, $this->getText(TEXT_VALIDATE_ITALICTEXT));
3738 } catch (PHPUnit_Framework_AssertionFailedError $e) {
3839 parent::doCreateScreenShot(__FUNCTION__);
3940 array_push($this->verificationErrors, $e->toString());
@@ -41,45 +42,44 @@
4243
4344 // Mark text Bold and Italic and verify output
4445 function verifyTextItalicandBold(){
45 - $this->type("wpTextbox1", "");
46 - $this->click("link=Italic");
47 - $this->click("link=Bold");
48 - $this->type("wpTextbox1", "Text '''''Italic & Bold'''''");
49 - $this->click("wpPreview");
50 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 46+ $this->type(TEXT_EDITOR, "");
 47+ $this->click(LINK_ITALIC);
 48+ $this->click(LINK_BOLD);
 49+ $this->type(TEXT_EDITOR, TEXT_ITALIC_BOLD);
 50+ $this->click(BUTTON_PREVIEW);
 51+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
5152 try {
52 - $this->assertEquals("Italic & Bold", $this->getText("//div[@id='wikiPreview']/p/i/b"));
 53+ $this->assertEquals(TEXT_VALIDATE_ITALICBOLD, $this->getText(TEXT_VALIDATE_ITALICBOLDTEXT));
5354 } catch (PHPUnit_Framework_AssertionFailedError $e) {
5455 parent::doCreateScreenShot(__FUNCTION__);
5556 array_push($this->verificationErrors, $e->toString());
5657 }
5758 }
5859
59 -
6060 // Use Bullet Item function and verify output
6161 function verifyBulletItem(){
6262 parent::doExpandAdvanceSection();
63 - $this->type("wpTextbox1", "");
64 - $this->click("link=Bulleted list");
65 - $this->click("link=Bulleted list");
66 - $this->click("link=Bulleted list");
67 - $this->type("wpTextbox1", "* Bulleted list item\n* Bulleted list item\n* Bulleted list item");
68 - $this->click("wpPreview");
69 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 63+ $this->type(TEXT_EDITOR, "");
 64+ $this->click(LINK_BULLET);
 65+ $this->click(LINK_BULLET);
 66+ $this->click(LINK_BULLET);
 67+ $this->type(TEXT_EDITOR, TEXT_BULLET);
 68+ $this->click(BUTTON_PREVIEW);
 69+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
7070 try {
71 - $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[1]"));
 71+ $this->assertEquals(TEXT_BULLET_TEXT, $this->getText(TEXT_BULLET_1));
7272 } catch (PHPUnit_Framework_AssertionFailedError $e) {
7373 parent::doCreateScreenShot(__FUNCTION__);
7474 array_push($this->verificationErrors, $e->toString());
7575 }
7676 try {
77 - $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[2]"));
 77+ $this->assertEquals(TEXT_BULLET_TEXT, $this->getText(TEXT_BULLET_2));
7878 } catch (PHPUnit_Framework_AssertionFailedError $e) {
7979 parent::doCreateScreenShot(__FUNCTION__);
8080 array_push($this->verificationErrors, $e->toString());
8181 }
8282 try {
83 - $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[3]"));
 83+ $this->assertEquals(TEXT_BULLET_TEXT, $this->getText(TEXT_BULLET_3));
8484 } catch (PHPUnit_Framework_AssertionFailedError $e) {
8585 parent::doCreateScreenShot(__FUNCTION__);
8686 array_push($this->verificationErrors, $e->toString());
@@ -89,27 +89,27 @@
9090 // Use Numbered Item function and verify output
9191 function verifyNumberedItem(){
9292 parent::doExpandAdvanceSection();
93 - $this->type("wpTextbox1", "");
94 - $this->click("link=Numbered list");
95 - $this->click("link=Numbered list");
96 - $this->click("link=Numbered list");
97 - $this->type("wpTextbox1", "# Numbered list item\n# Numbered list item\n# Numbered list item");
98 - $this->click("wpPreview");
99 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 93+ $this->type(TEXT_EDITOR, "");
 94+ $this->click(LINK_NUMBERED);
 95+ $this->click(LINK_NUMBERED);
 96+ $this->click(LINK_NUMBERED);
 97+ $this->type(TEXT_EDITOR, TEXT_NUMBERED);
 98+ $this->click(BUTTON_PREVIEW);
 99+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
100100 try {
101 - $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[1]"));
 101+ $this->assertEquals(TEXT_NUMBERED_TEXT, $this->getText(TEXT_NUMBERED_1));
102102 } catch (PHPUnit_Framework_AssertionFailedError $e) {
103103 parent::doCreateScreenShot(__FUNCTION__);
104104 array_push($this->verificationErrors, $e->toString());
105105 }
106106 try {
107 - $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[2]"));
 107+ $this->assertEquals(TEXT_NUMBERED_TEXT, $this->getText(TEXT_NUMBERED_2));
108108 } catch (PHPUnit_Framework_AssertionFailedError $e) {
109109 parent::doCreateScreenShot(__FUNCTION__);
110110 array_push($this->verificationErrors, $e->toString());
111111 }
112112 try {
113 - $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[3]"));
 113+ $this->assertEquals(TEXT_NUMBERED_TEXT, $this->getText(TEXT_NUMBERED_3));
114114 } catch (PHPUnit_Framework_AssertionFailedError $e) {
115115 parent::doCreateScreenShot(__FUNCTION__);
116116 array_push($this->verificationErrors, $e->toString());
@@ -119,12 +119,12 @@
120120 // Mark text as Nowiki and verify output
121121 function verifyNoWiki(){
122122 parent::doExpandAdvanceSection();
123 - $this->type("wpTextbox1", "");
124 - $this->type("wpTextbox1", "<nowiki>==Heading text==</nowiki>");
125 - $this->click("wpPreview");
126 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 123+ $this->type(TEXT_EDITOR, "");
 124+ $this->type(TEXT_EDITOR, TEXT_NOWIKI);
 125+ $this->click(BUTTON_PREVIEW);
 126+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
127127 try {
128 - $this->assertEquals("==Heading text==", $this->getText("//div[@id='wikiPreview']/p"));
 128+ $this->assertEquals(TEXT_NOWIKI_TEXT, $this->getText(TEXT_NOWIKI_VALIDATE));
129129 } catch (PHPUnit_Framework_AssertionFailedError $e) {
130130 parent::doCreateScreenShot(__FUNCTION__);
131131 array_push($this->verificationErrors, $e->toString());
@@ -134,12 +134,12 @@
135135 // Create a line break and verify output
136136 function verifyLineBreak(){
137137 parent::doExpandAdvanceSection();
138 - $this->type("wpTextbox1", "");
139 - $this->type("wpTextbox1", "this is a test text to check the line\n break.");
140 - $this->click("wpPreview");
141 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 138+ $this->type(TEXT_EDITOR, "");
 139+ $this->type(TEXT_EDITOR, TEXT_LINEBREAK);
 140+ $this->click(BUTTON_PREVIEW);
 141+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
142142 try {
143 - $this->assertEquals("this is a test text to check the line\n break.", $this->getText("//div[@id='wikiPreview']/p"));
 143+ $this->assertEquals(TEXT_LINEBREAK_TEXT, $this->getText(TEXT_LINEBREAK_VALIDATE));
144144 } catch (PHPUnit_Framework_AssertionFailedError $e) {
145145 parent::doCreateScreenShot(__FUNCTION__);
146146 array_push($this->verificationErrors, $e->toString());
@@ -149,13 +149,13 @@
150150 // Mark text as Big and verify output
151151 function verifyTextBig(){
152152 parent::doExpandAdvanceSection();
153 - $this->type("wpTextbox1", "");
154 - $this->click("link=Big");
155 - $this->type("wpTextbox1", "<big>This</big> text");
156 - $this->click("wpPreview");
157 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 153+ $this->type(TEXT_EDITOR, "");
 154+ $this->click(LINK_TEXTBIG);
 155+ $this->type(TEXT_EDITOR, TEXT_TEXTBIG);
 156+ $this->click(BUTTON_PREVIEW);
 157+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
158158 try {
159 - $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/big"));
 159+ $this->assertEquals(TEXT_TEXTBIG_TEXT, $this->getText(TEXT_TEXTBIG_VALIDATE));
160160 } catch (PHPUnit_Framework_AssertionFailedError $e) {
161161 parent::doCreateScreenShot(__FUNCTION__);
162162 array_push($this->verificationErrors, $e->toString());
@@ -165,13 +165,13 @@
166166 // Mark text as Small and verify output
167167 function verifyTextSmall(){
168168 parent::doExpandAdvanceSection();
169 - $this->type("wpTextbox1", "");
170 - $this->click("link=Small");
171 - $this->type("wpTextbox1", "<small>This</small> text\n");
172 - $this->click("wpPreview");
173 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 169+ $this->type(TEXT_EDITOR, "");
 170+ $this->click(LINK_TEXTSMALL);
 171+ $this->type(TEXT_EDITOR, TEXT_TEXTSMALL);
 172+ $this->click(BUTTON_PREVIEW);
 173+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
174174 try {
175 - $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/small"));
 175+ $this->assertEquals(TEXT_TEXTSMALL_TEXT, $this->getText(TEXT_TEXTSMALL_VALIDATE));
176176 } catch (PHPUnit_Framework_AssertionFailedError $e) {
177177 parent::doCreateScreenShot(__FUNCTION__);
178178 array_push($this->verificationErrors, $e->toString());
@@ -181,13 +181,13 @@
182182 // Mark text as Super Script and verify output
183183 function verifyTextSuperscript(){
184184 parent::doExpandAdvanceSection();
185 - $this->type("wpTextbox1", "");
186 - $this->click("link=Superscript");
187 - $this->type("wpTextbox1", "<sup>This</sup> text\n");
188 - $this->click("wpPreview");
189 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 185+ $this->type(TEXT_EDITOR, "");
 186+ $this->click(LINK_TEXTSUPER);
 187+ $this->type(TEXT_EDITOR,TEXT_TEXTSUPER );
 188+ $this->click(BUTTON_PREVIEW);
 189+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
190190 try {
191 - $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sup"));
 191+ $this->assertEquals(TEXT_TEXTSUPER_TEXT, $this->getText(TEXT_TEXTSUPER_VALIDATE));
192192 } catch (PHPUnit_Framework_AssertionFailedError $e) {
193193 parent::doCreateScreenShot(__FUNCTION__);
194194 array_push($this->verificationErrors, $e->toString());
@@ -197,13 +197,13 @@
198198 // Mark text as Sub Script and verify output
199199 function verifyTextSubscript(){
200200 parent::doExpandAdvanceSection();
201 - $this->type("wpTextbox1", "");
202 - $this->click("link=Subscript");
203 - $this->type("wpTextbox1", "<sub>This</sub> text\n");
204 - $this->click("wpPreview");
205 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 201+ $this->type(TEXT_EDITOR, "");
 202+ $this->click(LINK_TEXTSUB);
 203+ $this->type(TEXT_EDITOR,TEXT_TEXTSUB);
 204+ $this->click(BUTTON_PREVIEW);
 205+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
206206 try {
207 - $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sub"));
 207+ $this->assertEquals(TEXT_TEXTSUB_TEXT, $this->getText(TEXT_TEXTSUB_VALIDATE));
208208 } catch (PHPUnit_Framework_AssertionFailedError $e) {
209209 parent::doCreateScreenShot(__FUNCTION__);
210210 array_push($this->verificationErrors, $e->toString());
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiCommonFunction_TC.php
@@ -1,7 +1,8 @@
22 <?php
33 session_start();
44 require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
5 -require_once 'Config.php';
 5+include 'Config.php';
 6+
67 /**
78 * This test case will be handling the common functions on test.
89 * Date : Apr - 2010
@@ -19,90 +20,101 @@
2021 'port' => 4444,
2122 'timeout' => 30000,
2223 )
23 - ); **/
 24+ ); */
2425
2526 // Setup the browser URL and local browser
2627 function setUp() {
2728 // Setting the local browser. this should be disabled if the test run in Wiki environment.
2829 $this->setBrowser("*firefox");
 30+ //$this->setBrowser("*iexplore");
 31+ //$this->setBrowser("*safari");
 32+ //$this->setBrowser("*opera");
 33+ //$this->setBrowser("*googlechrome");
2934 // Main link to be connected
30 - $this->setBrowserUrl($_SESSION["WIKI_WEB_URL"]);
31 -
 35+ $this->setBrowserUrl(WIKI_WEB_URL);
3236 }
3337
3438 // Open the page.
3539 function doOpenLink(){
36 - $this->open($_SESSION["WIKI_OPEN_PAGE"]);
37 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 40+ $this->open(WIKI_OPEN_PAGE);
 41+ /*try {
 42+ $this->assertTrue($this->isTextPresent("Welcome to Wikipedia"));
 43+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 44+ array_push($this->verificationErrors, $e->toString());
 45+ }*/
 46+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
3847 }
3948
4049 // Login to the application
4150 function doLogin() {
42 - if (!$this->isTextPresent("Log out")) {
43 - $this->click("link=Log in / create account");
44 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
45 - $this->type("wpName1", $_SESSION["WIKI_USER_NAME"]);
46 - $this->type("wpPassword1", $_SESSION["WIKI_USER_PASSWORD"]);
47 - $this->click("wpLoginAttempt");
48 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 51+ if (!$this->isTextPresent(TEXT_LOGOUT)) {
 52+ $this->click(LINK_LOGIN);
 53+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 54+ $this->type(INPUT_USER_NAME, WIKI_USER_NAME);
 55+ $this->type(INPUT_PASSWD,WIKI_USER_PASSWORD);
 56+ $this->click(BUTTON_LOGIN);
 57+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
4958 try {
50 - $this->assertEquals($_SESSION["WIKI_USER_DISPLAY_NAME"], $this->getText("link=" . $_SESSION["WIKI_USER_DISPLAY_NAME"]));
 59+ $this->assertEquals(WIKI_USER_DISPLAY_NAME, $this->getText(LINK_START . WIKI_USER_DISPLAY_NAME));
5160 } catch (PHPUnit_Framework_AssertionFailedError $e) {
 61+ parent::doCreateScreenShot(__FUNCTION__);
5262 array_push($this->verificationErrors, $e->toString());
5363 }
54 - $this->open($_SESSION["WIKI_OPEN_PAGE"]);
55 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 64+ $this->click(LINK_MAIN_PAGE);
 65+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
5666 }
5767 }
5868
5969 // Log out from the application
6070 function doLogout() {
61 - $this->open($_SESSION["WIKI_OPEN_PAGE"]);
62 - if ($this->isTextPresent("Log out")) {
63 - $this->click("link=Log out");
64 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 71+ $this->open(WIKI_OPEN_PAGE);
 72+ if ($this->isTextPresent(TEXT_LOGOUT)) {
 73+ $this->click(LINK_LOGOUT);
 74+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
6575 try {
66 - $this->assertEquals("Log in / create account", $this->getText("link=Log in / create account"));
 76+ $this->assertEquals(TEXT_LOGOUT_CONFIRM, $this->getText(LINK_LOGIN));
6777 } catch (PHPUnit_Framework_AssertionFailedError $e) {
 78+ parent::doCreateScreenShot(__FUNCTION__);
6879 array_push($this->verificationErrors, $e->toString());
6980 }
70 - $this->open($_SESSION["WIKI_OPEN_PAGE"]);
71 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 81+ $this->open(WIKI_OPEN_PAGE);
 82+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
7283 }
7384 }
7485
7586 //Expand advance tool bar section if its not
7687 function doExpandAdvanceSection() {
77 - if (!$this->isTextPresent("Heading")){
78 - $this->click("link=Advanced");
 88+ if (!$this->isTextPresent(TEXT_HEADING)){
 89+ $this->click(LINK_ADVANCED);
7990 }
8091 }
8192
8293 //Create a temporary new page
8394 function doCreateNewPageTemporary() {
84 - $this->type("//*[@id='searchInput']", "TestWikiPaget");
85 - $this->click("//*[@id='searchButton']");
86 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
87 - $this->click("link=TestWikiPaget");
88 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 95+ $this->type(INPUT_SEARCH_BOX, WIKI_TEMP_NEWPAGE);
 96+ $this->click(BUTTON_SEARCH);
 97+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 98+ $this->click(LINK_START . WIKI_TEMP_NEWPAGE);
 99+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
89100 }
90101
91102 //Access a random page
92103 function doAccessRandomPage() {
93 - $this->click("link=Random article");
94 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 104+ $this->click(LINK_RANDOM_PAGE);
 105+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
95106 }
96107
97108 //Access a random page
98109 function doEditPage() {
99 - $this->click("//li[@id='ca-edit']/a/span");
100 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 110+ $this->click(LINK_EDITPAGE);
 111+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
101112 }
102113
103114 //Screenshot create on error
104115 function doCreateScreenShot($file_name){
105 - $this->captureEntirePageScreenshot($_SESSION["WIKI_CODE_PATH"] . "\/". $_SESSION["WIKI_SCREENSHOTS_PATH"] ."\/". $file_name . "_error" . date("Y_m_d") . "." . $_SESSION["WIKI_SCREENSHOTS_TYPE"] , "");
 116+ $this->windowFocus();
 117+ $this->windowMaximize();
 118+ $this->captureEntirePageScreenshot(WIKI_CODE_PATH . "//". WIKI_SCREENSHOTS_PATH ."//". $file_name . "_error" . date("Y_m_d") . "." . WIKI_SCREENSHOTS_TYPE , "");
106119 }
107 -
108120 }
109121 ?>
\ No newline at end of file
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiWatchUnWatch_TC.php
@@ -1,7 +1,6 @@
22 <?php
3 -session_start();
43 require_once 'WikiCommonFunction_TC.php';
5 -require_once 'Config.php';
 4+include 'Config.php';
65 /**
76 * This test case will be handling the page watch functions.
87 * Date : Apr - 2010
@@ -17,14 +16,13 @@
1817 function testWatch(){
1918 parent::doOpenLink();
2019 parent::doLogin();
21 - $this->click("link=Random article");
22 - $this->waitForPageToLoad("30000");
23 - $randompage = $this->getText("firstHeading");
24 - $this->click("link=Watch");
25 - $this->click("link=My watchlist");
26 - $this->waitForPageToLoad("30000");
27 - $this->click("link=View and edit watchlist");
28 - $this->waitForPageToLoad("30000");
 20+ parent::doAccessRandomPage();
 21+ $randompage = $this->getText(TEXT_PAGE_HEADING);
 22+ $this->click(LINK_WATCH_PAGE);
 23+ $this->click(LINK_WATCH_LIST);
 24+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 25+ $this->click(LINK_WATCH_EDIT);
 26+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
2927 try {
3028 $this->assertTrue($this->isTextPresent($randompage));
3129 } catch (PHPUnit_Framework_AssertionFailedError $e) {
@@ -38,25 +36,23 @@
3937
4038 // Mark a page as watch and mark the same page as unwatch and verify the My Watch list
4139 function testUnWatch(){
42 -
43 - parent::doOpenLink();
 40+ parent::doOpenLink();
4441 parent::doLogin();
45 - $this->click("link=Random article");
46 - $this->waitForPageToLoad("30000");
47 - $randompage = $this->getText("firstHeading");
48 - $this->click("link=Watch");
49 - $this->click("link=My watchlist");
50 - $this->waitForPageToLoad("30000");
51 - $this->click("link=View and edit watchlist");
52 - $this->waitForPageToLoad("30000");
 42+ parent::doAccessRandomPage();
 43+ $randompage = $this->getText(TEXT_PAGE_HEADING);
 44+ $this->click(LINK_WATCH_PAGE);
 45+ $this->click(LINK_WATCH_LIST);
 46+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 47+ $this->click(LINK_WATCH_EDIT);
 48+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
5349 $this->assertTrue($this->isTextPresent($randompage));
54 - $this->click("link=" . $randompage);
55 - $this->waitForPageToLoad("30000");
56 - $this->click("link=Unwatch");
57 - $this->click("link=My watchlist");
58 - $this->waitForPageToLoad("30000");
59 - $this->click("link=View and edit watchlist");
60 - $this->waitForPageToLoad("30000");
 50+ $this->click(LINK_START . $randompage);
 51+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 52+ $this->click(LINK_UNWATCH);
 53+ $this->click(LINK_WATCH_LIST);
 54+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 55+ $this->click(LINK_WATCH_EDIT);
 56+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
6157 try {
6258 $this->assertFalse($this->isTextPresent($randompage));
6359 } catch (PHPUnit_Framework_AssertionFailedError $e) {
@@ -72,26 +68,27 @@
7369 parent::doOpenLink();
7470 parent::doLogin();
7571 parent::doAccessRandomPage();
76 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
77 - $randompage = $this->getText("firstHeading");
 72+ $randompage = $this->getText(TEXT_PAGE_HEADING);
7873 parent::doEditPage();
7974 try {
80 - $this->assertEquals("Watch", $this->getText("link=Watch"));
 75+ $this->assertEquals(TEXT_WATCH, $this->getText(LINK_WATCH_PAGE));
8176 } catch (PHPUnit_Framework_AssertionFailedError $e) {
 77+ parent::doCreateScreenShot(__FUNCTION__);
8278 array_push($this->verificationErrors, $e->toString());
8379 }
84 - $this->click("wpWatchthis");
85 - $this->click("wpSave");
86 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 80+ $this->click(BUTTON_WATCH);
 81+ $this->click(BUTTON_SAVE_WATCH);
 82+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
8783 try {
88 - $this->assertEquals("Unwatch", $this->getText("link=Unwatch"));
 84+ $this->assertEquals(TEXT_UNWATCH, $this->getText(LINK_UNWATCH));
8985 } catch (PHPUnit_Framework_AssertionFailedError $e) {
 86+ parent::doCreateScreenShot(__FUNCTION__);
9087 array_push($this->verificationErrors, $e->toString());
9188 }
92 - $this->click("link=My watchlist");
93 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
94 - $this->click("link=View and edit watchlist");
95 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 89+ $this->click(LINK_WATCH_LIST);
 90+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 91+ $this->click(LINK_WATCH_EDIT);
 92+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
9693 $this->assertTrue($this->isTextPresent($randompage));
9794
9895 parent::doLogout();
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_NewPage.php
@@ -60,7 +60,7 @@
6161 parent::doLogout();
6262 }
6363
64 - // Add a table and verify
 64+ // Add a table and verify
6565 function testCreateTable(){
6666 $this->createNewPage();
6767 parent::verifyCreateTable();
@@ -95,6 +95,13 @@
9696 parent::doLogout();
9797 }
9898
 99+ // Add a table with headers,borders and sort rows
 100+ function testCreateTableWithAllSpecialEffects(){
 101+ $this->createNewPage();
 102+ parent::verifyCreateTableWithAllSpecialEffects();
 103+ parent::doLogout();
 104+ }
 105+
99106 // Verify the replace all function on Search and Replace
100107 function testTextSearchReplaceAll(){
101108 $this->createNewPage();
@@ -107,13 +114,28 @@
108115 $this->createNewPage();
109116 parent::verifyTextSearchReplaceNext();
110117 parent::doLogout();
111 - }
 118+ }
112119
113 - // When user click on find, text highlight on back which is not captured in Selenium directly. */
 120+ /*// When user click on find, text highlight on back which is not captured in Selenium directly.
114121 function testTextSearchFindNext(){
115122 $this->createNewPage();
116123 parent::verifyTextSearchFindNext();
117124 parent::doLogout();
 125+ }*/
 126+
 127+ // Verify the Match Case option with Replace All on Search and Replace
 128+ function testTextMatchCase(){
 129+ $this->createNewPage();
 130+ parent::verifyTextMatchCase();
 131+ parent::doLogout();
118132 }
 133+
 134+ //Verify Regular expression option with Replace All on Search and Replace
 135+ function testRegEx(){
 136+ $this->createNewPage();
 137+ parent::verifyRegEx();
 138+ parent::doLogout();
 139+ }
 140+
119141 }
120142 ?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTestSuite.php
@@ -1,7 +1,9 @@
22 <?php
33 require_once 'PHPUnit/Framework.php';
4 -require_once 'PHPUnit/TextUI/TestRunner.php';
 4+require_once 'PHPUnit/Framework/TestSuite.php';
55
 6+require_once 'WikiListener.php';
 7+
68 require_once 'WikSearch_TC.php';
79 require_once 'WikiWatchUnWatch_TC.php';
810
@@ -15,18 +17,16 @@
1618 require_once 'WikiToolBarOther_NewPage.php';
1719 require_once 'WikiTextFormat_NewPage.php';
1820
 21+$suite = new PHPUnit_Framework_TestSuite('ArrayTest');
1922
20 -$suite = new PHPUnit_Framework_TestSuite('Wiki Tests');
 23+$result = new PHPUnit_Framework_TestResult;
 24+$result->addListener(new WikiListener);
2125
22 -require_once('WikiListener.php');
23 -$wLis = new WikiListener();
24 -$result = new PHPUnit_Framework_TestResult();
25 -//Add test case to the test suite
26 -$suite->addTestSuite("WikSearch_TC");
27 -$suite->addTestSuite("WikiWatchUnWatch_TC");
 26+$suite->addTestSuite('WikiSearch_TC'); // Working in Chrome
 27+$suite->addTestSuite('WikiWatchUnWatch_TC'); // Working in Chrome
2828
29 -$suite->addTestSuite("WikiNTOC_ ExistingPage");
30 -$suite->addTestSuite("WikiDialogs_ExsistingPage");
 29+$suite->addTestSuite("WikiNTOC_ExistingPage"); // Working in Chrome
 30+$suite->addTestSuite("WikiDialogs_ExsistingPage");
3131 $suite->addTestSuite("WikiToolBarOther_ExistingPage");
3232 $suite->addTestSuite("WikiTextFormat_ExistingPage");
3333
@@ -35,7 +35,5 @@
3636 $suite->addTestSuite("WikiToolBarOther_NewPage");
3737 $suite->addTestSuite("WikiTextFormat_NewPage");
3838
39 -//$result->addListener($wLis); //Define your listener which the test result will use to give output
40 -$suite->run($result); //And of course run this tests
41 -
42 -?>
 39+$suite->run($result);
 40+?>
\ No newline at end of file
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiNTOC_TC.php
@@ -1,7 +1,6 @@
22 <?php
3 -session_start();
43 require_once 'WikiCommonFunction_TC.php';
5 -require_once 'Config.php';
 4+include 'Config.php';
65 /*
76 * This test case will be handling the NTOC related functions.
87 * Adding different header levels via tool bar and verify the output
@@ -14,14 +13,13 @@
1514 // Add header level 2 and verify Header output
1615 function verifyHeaderLevel2(){
1716 parent::doExpandAdvanceSection();
18 - $this->click("link=Heading");
19 - $this->click("link=Heading");
20 - $this->click("link=Level 2");
21 - $this->type("wpTextbox1", "==Heading text==");
22 - $this->click("wpPreview");
23 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 17+ $this->click(LINK_HEADER);
 18+ $this->click(LINK_LEVEL2HEADER);
 19+ $this->type(TEXT_EDITOR, TEXT_LEVEL2HEADER);
 20+ $this->click(BUTTON_PREVIEW);
 21+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
2422 try {
25 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2"));
 23+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL2HEADER_SIZE));
2624 } catch (PHPUnit_Framework_AssertionFailedError $e) {
2725 parent::doCreateScreenShot(__FUNCTION__);
2826 array_push($this->verificationErrors, $e->toString());
@@ -32,14 +30,13 @@
3331 // Add header level 3 and verify Header output
3432 function verifyHeaderLevel3(){
3533 parent::doExpandAdvanceSection();
36 - $this->click("link=Heading");
37 - $this->click("link=Heading");
38 - $this->click("link=Level 3");
39 - $this->type("wpTextbox1", "===Heading text===");
40 - $this->click("wpPreview");
41 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 34+ $this->click(LINK_HEADER);
 35+ $this->click(LINK_LEVEL3HEADER);
 36+ $this->type(TEXT_EDITOR, TEXT_LEVEL3HEADER);
 37+ $this->click(BUTTON_PREVIEW);
 38+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
4239 try {
43 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3"));
 40+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL3HEADER_SIZE));
4441 } catch (PHPUnit_Framework_AssertionFailedError $e) {
4542 parent::doCreateScreenShot(__FUNCTION__);
4643 array_push($this->verificationErrors, $e->toString());
@@ -49,14 +46,13 @@
5047 // Add header level 4 and verify Header output
5148 function verifyHeaderLevel4(){
5249 parent::doExpandAdvanceSection();
53 - $this->click("link=Heading");
54 - $this->click("link=Heading");
55 - $this->click("link=Level 4");
56 - $this->type("wpTextbox1", "====Heading text====");
57 - $this->click("wpPreview");
58 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 50+ $this->click(LINK_HEADER);
 51+ $this->click(LINK_LEVEL4HEADER);
 52+ $this->type(TEXT_EDITOR, TEXT_LEVEL4HEADER);
 53+ $this->click(BUTTON_PREVIEW);
 54+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
5955 try {
60 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4"));
 56+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL4HEADER_SIZE));
6157 } catch (PHPUnit_Framework_AssertionFailedError $e) {
6258 parent::doCreateScreenShot(__FUNCTION__);
6359 array_push($this->verificationErrors, $e->toString());
@@ -66,14 +62,13 @@
6763 // Add header level 5 and verify Header output
6864 function verifyHeaderLevel5(){
6965 parent::doExpandAdvanceSection();
70 - $this->click("link=Heading");
71 - $this->click("link=Heading");
72 - $this->click("link=Level 5");
73 - $this->type("wpTextbox1", "=====Heading text=====");
74 - $this->click("wpPreview");
75 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 66+ $this->click(LINK_HEADER);
 67+ $this->click(LINK_LEVEL5HEADER);
 68+ $this->type(TEXT_EDITOR, TEXT_LEVEL5HEADER);
 69+ $this->click(BUTTON_PREVIEW);
 70+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
7671 try {
77 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h5"));
 72+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL5HEADER_SIZE));
7873 } catch (PHPUnit_Framework_AssertionFailedError $e) {
7974 parent::doCreateScreenShot(__FUNCTION__);
8075 array_push($this->verificationErrors, $e->toString());
@@ -83,20 +78,21 @@
8479 // Add header level 2 & 3 and verify Header output
8580 function verifyHeaderLevel2and3(){
8681 parent::doExpandAdvanceSection();
87 - $this->click("link=Heading");
88 - $this->click("link=Level 2");
89 - $this->click("link=Heading");
90 - $this->click("link=Level 3");
91 - $this->type("wpTextbox1", "==Heading text==\n===Heading text===");
92 - $this->click("wpPreview");
93 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 82+ $this->click(LINK_HEADER);
 83+ $this->click(LINK_LEVEL2HEADER);
 84+ $this->click(LINK_HEADER);
 85+ $this->click(LINK_LEVEL3HEADER);
 86+ $this->type(TEXT_EDITOR, TEXT_LEVEL2HEADER ."\n". TEXT_LEVEL3HEADER );
 87+ $this->click(BUTTON_PREVIEW);
 88+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
9489 try {
95 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2"));
 90+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL2HEADER_SIZE));
9691 } catch (PHPUnit_Framework_AssertionFailedError $e) {
 92+ parent::doCreateScreenShot(__FUNCTION__);
9793 array_push($this->verificationErrors, $e->toString());
9894 }
9995 try {
100 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3"));
 96+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL3HEADER_SIZE));
10197 } catch (PHPUnit_Framework_AssertionFailedError $e) {
10298 parent::doCreateScreenShot(__FUNCTION__);
10399 array_push($this->verificationErrors, $e->toString());
@@ -106,29 +102,29 @@
107103 // Add header level 2 , 3 & 4 and verify Header output
108104 function verifyHeaderLevel23and4(){
109105 parent::doExpandAdvanceSection();
110 - $this->click("link=Heading");
111 - $this->click("link=Level 2");
112 - $this->click("link=Heading");
113 - $this->click("link=Level 3");
114 - $this->click("link=Heading");
115 - $this->click("link=Level 4");
116 - $this->type("wpTextbox1", "==Heading text==\n===Heading text===\n====Heading text====");
117 - $this->click("wpPreview");
118 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 106+ $this->click(LINK_HEADER);
 107+ $this->click(LINK_LEVEL2HEADER);
 108+ $this->click(LINK_HEADER);
 109+ $this->click(LINK_LEVEL3HEADER);
 110+ $this->click(LINK_HEADER);
 111+ $this->click(LINK_LEVEL4HEADER);
 112+ $this->type(TEXT_EDITOR, TEXT_LEVEL2HEADER ."\n". TEXT_LEVEL3HEADER ."\n". TEXT_LEVEL4HEADER );
 113+ $this->click(BUTTON_PREVIEW);
 114+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
119115 try {
120 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2"));
 116+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL2HEADER_SIZE));
121117 } catch (PHPUnit_Framework_AssertionFailedError $e) {
122118 parent::doCreateScreenShot(__FUNCTION__);
123119 array_push($this->verificationErrors, $e->toString());
124120 }
125121 try {
126 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3"));
 122+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL3HEADER_SIZE));
127123 } catch (PHPUnit_Framework_AssertionFailedError $e) {
128124 parent::doCreateScreenShot(__FUNCTION__);
129125 array_push($this->verificationErrors, $e->toString());
130126 }
131127 try {
132 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4"));
 128+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL4HEADER_SIZE));
133129 } catch (PHPUnit_Framework_AssertionFailedError $e) {
134130 parent::doCreateScreenShot(__FUNCTION__);
135131 array_push($this->verificationErrors, $e->toString());
@@ -138,37 +134,37 @@
139135 // Add header level 2 , 3 , 4 & 5 and verify Header output
140136 function verifyHeaderLevel234and5(){
141137 parent::doExpandAdvanceSection();
142 - $this->click("link=Heading");
143 - $this->click("link=Level 2");
144 - $this->click("link=Heading");
145 - $this->click("link=Level 3");
146 - $this->click("link=Heading");
147 - $this->click("link=Level 4");
148 - $this->click("link=Heading");
149 - $this->click("link=Level 5");
150 - $this->type("wpTextbox1", "==Heading text==\n===Heading text===\n====Heading text====\n=====Heading text=====");
151 - $this->click("wpPreview");
152 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 138+ $this->click(LINK_HEADER);
 139+ $this->click(LINK_LEVEL2HEADER);
 140+ $this->click(LINK_HEADER);
 141+ $this->click(LINK_LEVEL3HEADER);
 142+ $this->click(LINK_HEADER);
 143+ $this->click(LINK_LEVEL4HEADER);
 144+ $this->click(LINK_HEADER);
 145+ $this->click(LINK_LEVEL5HEADER);
 146+ $this->type(TEXT_EDITOR, TEXT_LEVEL2HEADER ."\n". TEXT_LEVEL3HEADER ."\n". TEXT_LEVEL4HEADER ."\n". TEXT_LEVEL5HEADER);
 147+ $this->click(BUTTON_PREVIEW);
 148+ $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));
153149 try {
154 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2"));
 150+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL2HEADER_SIZE));
155151 } catch (PHPUnit_Framework_AssertionFailedError $e) {
156152 parent::doCreateScreenShot(__FUNCTION__);
157153 array_push($this->verificationErrors, $e->toString());
158154 }
159155 try {
160 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3"));
 156+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL3HEADER_SIZE));
161157 } catch (PHPUnit_Framework_AssertionFailedError $e) {
162158 parent::doCreateScreenShot(__FUNCTION__);
163159 array_push($this->verificationErrors, $e->toString());
164160 }
165161 try {
166 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4"));
 162+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL4HEADER_SIZE));
167163 } catch (PHPUnit_Framework_AssertionFailedError $e) {
168164 parent::doCreateScreenShot(__FUNCTION__);
169165 array_push($this->verificationErrors, $e->toString());
170166 }
171167 try {
172 - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h5"));
 168+ $this->assertEquals(TEXT_HEADER, $this->getText(TEXT_LEVEL5HEADER_SIZE));
173169 } catch (PHPUnit_Framework_AssertionFailedError $e) {
174170 parent::doCreateScreenShot(__FUNCTION__);
175171 array_push($this->verificationErrors, $e->toString());
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_TC.php
@@ -1,5 +1,4 @@
22 <?php
3 -session_start();
43 require_once 'WikiCommonFunction_TC.php';
54 require_once 'Config.php';
65 /**
@@ -8,54 +7,66 @@
98 * @author : BhagyaG - Calcey
109 */
1110 class WikiToolBarOther_TC extends WikiCommonFunction_TC {
12 - // Click on Embedded file function and verify the output
 11+
 12+ // Add Embedded file function and verify the output
1313 function verifyEmbeddedFile(){
14 - $this->click("link=Embedded file");
15 - $this->type("wpTextbox1", "\" \"");
16 - $this->type("wpTextbox1", "[[File:Example.jpg]]");
17 - $this->click("wpPreview");
18 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 14+ $this->type(TEXT_EDITOR, "");
 15+ $this->click(LINK_TEXTEMBEDDED);
 16+ $this->type(TEXT_EDITOR, TEXT_TEXTEMBEDDED);
 17+ $this->click(BUTTON_PREVIEW);
 18+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
1919 try {
20 - $this->assertEquals("", $this->getText("//img[@alt='Example.jpg']"));
 20+ $this->assertTrue($this->isElementPresent(TEXT_TEXTEMBEDDED_VALIDATE));
2121 } catch (PHPUnit_Framework_AssertionFailedError $e) {
2222 parent::doCreateScreenShot(__FUNCTION__);
2323 array_push($this->verificationErrors, $e->toString());
2424 }
25 - }
 25+ }
2626
27 - /** Reference link is not directing to the given link.
28 - * For example if I add www.google.com as the reference link,
29 - * on preview the link is not directing to google site.
 27+ //Add Reference file function and verify the output
3028 function verifyReference(){
31 - parent::doOpenLink();
32 - parent::doLogin();
 29+ $this->type(TEXT_EDITOR, "");
 30+ $this->click(LINK_TEXTREFERENCE);
 31+ $this->type(INPUT_TEXTREFERENCE,TEXT_TEXTREFERENCE);
 32+ $this->click(BUTTON_REFERENCE);
 33+ $this->type(TEXT_EDITOR, TEXT_TEXTREFERENCE_EDITOR);
 34+ $this->click(BUTTON_PREVIEW);
 35+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 36+ try {
 37+ $this->assertEquals(TEXT_REFERENCEID, $this->getText(TEXT_REFERENCELINK));
 38+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 39+ parent::doCreateScreenShot(__FUNCTION__);
 40+ array_push($this->verificationErrors, $e->toString());
 41+ }
 42+ try {
 43+ $this->assertTrue($this->isTextPresent(TEXT_REFERENCE));
 44+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 45+ parent::doCreateScreenShot(__FUNCTION__);
 46+ array_push($this->verificationErrors, $e->toString());
 47+ }
3348
34 - $this->open("/deployment-en/Main_Page");
35 - $this->click("link=Random article");
36 - $this->waitForPageToLoad("30000");
37 - $this->click("//li[@id='ca-edit']/a/span");
38 - $this->waitForPageToLoad("30000");
39 - $this->type("wpTextbox1", "");
40 - $this->click("link=Reference");
41 - $this->type("wpTextbox1", "");
42 - $this->type("wikieditor-toolbar-reference-text", "www.google.com");
43 - $this->click("//div[13]/div[11]/button[1]");
44 - $this->click("wpPreview");
45 -
4649 parent::doLogout();
47 - }**/
 50+ }
4851
49 - // Click on Picture Gallery function and verify the output
 52+ // Add Picture Gallery function and verify the output
5053 function verifyPictureGallery(){
5154 parent::doExpandAdvanceSection();
52 - $this->type("wpTextbox1", "");
53 - $this->click("link=Picture gallery");
54 - $this->click("wpPreview");
55 - $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]);
 55+ $this->type(TEXT_EDITOR, "");
 56+ $this->click(TEXT_PICTURELINK);
 57+ $this->click(BUTTON_PREVIEW);
 58+ $this->waitForPageToLoad(WIKI_TEST_WAIT_TIME);
 59+ $this->assertTrue($this->isElementPresent(IMAGE_EXAMPLE1));
5660 try {
 61+ $this->assertEquals(TEXT_IMG1CAPTION, $this->getTable(TABLE_CAPTION1));
 62+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
5763 parent::doCreateScreenShot(__FUNCTION__);
58 - $this->assertEquals("", $this->getText("//div[@id='wikiPreview']/table/tbody/tr/td[1]/div/div[1]/div"));
 64+ array_push($this->verificationErrors, $e->toString());
 65+ }
 66+ $this->assertTrue($this->isElementPresent(IMAGE_EXAMPLE2));
 67+ try {
 68+ $this->assertEquals(TEXT_IMG2CAPTION, $this->getTable(TABLE_CAPTION2));
5969 } catch (PHPUnit_Framework_AssertionFailedError $e) {
 70+ parent::doCreateScreenShot(__FUNCTION__);
6071 array_push($this->verificationErrors, $e->toString());
6172 }
6273 }

Status & tagging log