r65120 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65119‎ | r65120 | r65121 >
Date:12:12, 16 April 2010
Author:bhagya
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiAcaiSearchTC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiCommonTC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTestSuite.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarNTOCTC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOtherTC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarTextFormatTC.php (modified) (history)
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiWatchUnWatchTC.php (modified) (history)

Diff [purge]

Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarTextFormatTC.php
@@ -13,6 +13,7 @@
1414
1515 // Mark text Bold and verify output
1616 function testMakeTextBold(){
 17+
1718 parent::doOpenLink();
1819 parent::doLogin();
1920 $this->open("/deployment-en/Main_Page");
@@ -32,10 +33,12 @@
3334 }
3435
3536 parent::doLogout();
 37+
3638 }
3739
3840 // Mark text Italic and verify output
3941 function testMakeTextItalic(){
 42+
4043 parent::doOpenLink();
4144 parent::doLogin();
4245 $this->click("link=Random article");
@@ -49,17 +52,20 @@
5053 $this->waitForPageToLoad("30000");
5154 $this->assertEquals("Italian", $this->getText("//div[@id='wikiPreview']/p/i"));
5255 parent::doLogout();
 56+
5357 }
5458
5559 // Use Bullet Item function and verify output
5660 function testBulletItem(){
57 - parent::doOpenLink();
 61+
 62+ parent::doOpenLink();
5863 parent::doLogin();
5964 $this->open("/deployment-en/Main_Page");
6065 $this->click("link=Random article");
6166 $this->waitForPageToLoad("30000");
6267 $this->click("//li[@id='ca-edit']/a/span");
6368 $this->waitForPageToLoad("30000");
 69+ parent::doExpandAdvanceSection();
6470 $this->type("wpTextbox1", "");
6571 $this->click("link=Bulleted list");
6672 $this->click("link=Bulleted list");
@@ -84,10 +90,12 @@
8591 }
8692
8793 parent::doLogout();
 94+
8895 }
8996
9097 // Use Numbered Item function and verify output
9198 function testNumberedItem(){
 99+
92100 parent::doOpenLink();
93101 parent::doLogin();
94102 $this->open("/deployment-en/Main_Page");
@@ -95,6 +103,7 @@
96104 $this->waitForPageToLoad("30000");
97105 $this->click("//li[@id='ca-edit']/a/span");
98106 $this->waitForPageToLoad("30000");
 107+ parent::doExpandAdvanceSection();
99108 $this->type("wpTextbox1", "");
100109 $this->click("link=Numbered list");
101110 $this->click("link=Numbered list");
@@ -118,10 +127,12 @@
119128 array_push($this->verificationErrors, $e->toString());
120129 }
121130 parent::doLogout();
 131+
122132 }
123133
124134 // Mark text as Nowiki and verify output
125135 function testNoWiki(){
 136+
126137 parent::doOpenLink();
127138 parent::doLogin();
128139 $this->open("/deployment-en/Main_Page");
@@ -129,6 +140,7 @@
130141 $this->waitForPageToLoad("30000");
131142 $this->click("//li[@id='ca-edit']/a/span");
132143 $this->waitForPageToLoad("30000");
 144+ parent::doExpandAdvanceSection();
133145 $this->type("wpTextbox1", "");
134146 $this->type("wpTextbox1", "<nowiki>==Heading text==</nowiki>");
135147 $this->click("wpPreview");
@@ -138,13 +150,13 @@
139151 } catch (PHPUnit_Framework_AssertionFailedError $e) {
140152 array_push($this->verificationErrors, $e->toString());
141153 }
142 -
143 -
144154 parent::doLogout();
 155+
145156 }
146157
147158 // Create a line break and verify output
148159 function testLineBreak(){
 160+
149161 parent::doOpenLink();
150162 parent::doLogin();
151163 $this->open("/deployment-en/Main_Page");
@@ -152,6 +164,7 @@
153165 $this->waitForPageToLoad("30000");
154166 $this->click("//li[@id='ca-edit']/a/span");
155167 $this->waitForPageToLoad("30000");
 168+ parent::doExpandAdvanceSection();
156169 $this->type("wpTextbox1", "");
157170 $this->type("wpTextbox1", "this is a test text to check the line\n break.");
158171 $this->click("wpPreview");
@@ -162,10 +175,12 @@
163176 array_push($this->verificationErrors, $e->toString());
164177 }
165178 parent::doLogout();
 179+
166180 }
167181
168182 // Mark text as Big and verify output
169183 function testTextBig(){
 184+
170185 parent::doOpenLink();
171186 parent::doLogin();
172187 $this->open("/deployment-en/Main_Page");
@@ -173,6 +188,7 @@
174189 $this->waitForPageToLoad("30000");
175190 $this->click("//li[@id='ca-edit']/a/span");
176191 $this->waitForPageToLoad("30000");
 192+ parent::doExpandAdvanceSection();
177193 $this->type("wpTextbox1", "");
178194 $this->click("link=Big");
179195 $this->type("wpTextbox1", "<big>This</big> text");
@@ -185,10 +201,12 @@
186202 }
187203
188204 parent::doLogout();
 205+
189206 }
190207
191208 // Mark text as Small and verify output
192209 function testTextSmall(){
 210+
193211 parent::doOpenLink();
194212 parent::doLogin();
195213 $this->open("/deployment-en/Main_Page");
@@ -196,6 +214,7 @@
197215 $this->waitForPageToLoad("30000");
198216 $this->click("//li[@id='ca-edit']/a/span");
199217 $this->waitForPageToLoad("30000");
 218+ parent::doExpandAdvanceSection();
200219 $this->type("wpTextbox1", "");
201220 $this->click("link=Small");
202221 $this->type("wpTextbox1", "<small>This</small> text\n");
@@ -208,17 +227,20 @@
209228 }
210229
211230 parent::doLogout();
 231+
212232 }
213233
214234 // Mark text as Super Script and verify output
215235 function testTextSuperscript(){
216 - parent::doOpenLink();
217 - parent::doLogin();
 236+
 237+ parent::doOpenLink();
 238+ parent::doLogin();
218239 $this->open("/deployment-en/Main_Page");
219240 $this->click("link=Random article");
220241 $this->waitForPageToLoad("30000");
221242 $this->click("//li[@id='ca-edit']/a/span");
222243 $this->waitForPageToLoad("30000");
 244+ parent::doExpandAdvanceSection();
223245 $this->type("wpTextbox1", "");
224246 $this->click("link=Superscript");
225247 $this->type("wpTextbox1", "<sup>This</sup> text\n");
@@ -231,10 +253,12 @@
232254 }
233255
234256 parent::doLogout();
 257+
235258 }
236259
237260 // Mark text as Sub Script and verify output
238261 function testTextSubscript(){
 262+
239263 parent::doOpenLink();
240264 parent::doLogin();
241265 $this->open("/deployment-en/Main_Page");
@@ -242,6 +266,7 @@
243267 $this->waitForPageToLoad("30000");
244268 $this->click("//li[@id='ca-edit']/a/span");
245269 $this->waitForPageToLoad("30000");
 270+ parent::doExpandAdvanceSection();
246271 $this->type("wpTextbox1", "");
247272 $this->click("link=Subscript");
248273 $this->type("wpTextbox1", "<sub>This</sub> text\n");
@@ -254,6 +279,7 @@
255280 }
256281
257282 parent::doLogout();
 283+
258284 }
259285
260286 }
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiWatchUnWatchTC.php
@@ -13,6 +13,7 @@
1414
1515 // Mark a page as watch and verify the My Watch list
1616 function testWatch(){
 17+
1718 parent::doOpenLink();
1819 parent::doLogin();
1920 $this->click("link=Random article");
@@ -26,11 +27,13 @@
2728
2829 $this->assertTrue($this->isTextPresent($randompage));
2930 parent::doLogout();
 31+
3032 }
3133
3234
3335 // Mark a page as watch and mark the same page as unwatch and verify the My Watch list
3436 function testUnWatch(){
 37+
3538 parent::doOpenLink();
3639 parent::doLogin();
3740 $this->click("link=Random article");
@@ -55,6 +58,7 @@
5659 array_push($this->verificationErrors, $e->toString());
5760 }
5861 parent::doLogout();
 62+
5963 }
6064
6165 /** function testEditWatch(){
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTestSuite.php
@@ -1,19 +1,17 @@
22 <?php
3 -/*
4 - * To change this template, choose Tools | Templates
5 - * and open the template in the editor.
6 - */
 3+require_once 'PHPUnit/Framework.php';
 4+require_once 'PHPUnit/TextUI/TestRunner.php';
75
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 -}
 6+
 7+require_once 'WikiAcaiSearchTC.php';
 8+
 9+$suite = new PHPUnit_Framework_TestSuite('Wiki Tests');
 10+
 11+require_once('WikiListener.php');
 12+$wLis = new WikiListener();
 13+$result = new PHPUnit_Framework_TestResult();
 14+$suite->addTestSuite("WikiAcaiSearchTC"); //Add your test case to the test suite
 15+$result->addListener($wLis); //Define your listener which the test result will use to give output
 16+$suite->run($result); //And of course run this tests
 17+
2018 ?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiAcaiSearchTC.php
@@ -30,7 +30,7 @@
3131 }
3232
3333 // Search for a text. Search result should display links which contain the search text
34 - function testSearchText(){
 34+ function testSearchText(){
3535 parent::doOpenLink();
3636 parent::doLogin();
3737 $this->click("link=Main page");
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOtherTC.php
@@ -13,9 +13,9 @@
1414
1515 // Click on Embedded file function and verify the output
1616 function testEmbeddedFile(){
 17+
1718 parent::doOpenLink();
1819 parent::doLogin();
19 -
2020 $this->click("link=Random article");
2121 $this->waitForPageToLoad("30000");
2222 $this->click("//li[@id='ca-edit']/a/span");
@@ -31,6 +31,7 @@
3232 array_push($this->verificationErrors, $e->toString());
3333 }
3434 parent::doLogout();
 35+
3536 }
3637
3738 /** Reference link is not directing to the given link.
@@ -57,6 +58,7 @@
5859
5960 // Click on Picture Gallery function and verify the output
6061 function testPictureGallery(){
 62+
6163 parent::doOpenLink();
6264 parent::doLogin();
6365
@@ -65,6 +67,7 @@
6668 $this->waitForPageToLoad("30000");
6769 $this->click("//li[@id='ca-edit']/a/span");
6870 $this->waitForPageToLoad("30000");
 71+ parent::doExpandAdvanceSection();
6972 $this->type("wpTextbox1", "");
7073 $this->click("link=Picture gallery");
7174 $this->click("wpPreview");
@@ -76,6 +79,7 @@
7780 }
7881
7982 parent::doLogout();
 83+
8084 }
8185
8286
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php
@@ -13,6 +13,7 @@
1414
1515 // Add a internal link and verify
1616 function testInternalLink(){
 17+
1718 parent::doOpenLink();
1819 parent::doLogin();
1920 $this->click("link=Random article");
@@ -30,10 +31,12 @@
3132 $this->assertEquals("Daimler-Chrysler", $this->getText("link=Daimler-Chrysler"));
3233
3334 parent::doLogout();
 35+
3436 }
3537
3638 // Add external link and verify
3739 function testExternalLink(){
 40+
3841 parent::doOpenLink();
3942 parent::doLogin();
4043 $this->click("link=Random article");
@@ -55,10 +58,12 @@
5659 $this->assertEquals("www.google.com", $this->getText("link=www.google.com"));
5760
5861 parent::doLogout();
 62+
5963 }
6064
6165 // Add a table and verify
6266 function testCreateTable(){
 67+
6368 parent::doOpenLink();
6469 parent::doLogin();
6570 $this->open("/deployment-en/Main_Page");
@@ -66,6 +71,7 @@
6772 $this->waitForPageToLoad("30000");
6873 $this->click("//li[@id='ca-edit']/a/span");
6974 $this->waitForPageToLoad("30000");
 75+ parent::doExpandAdvanceSection();
7076 $this->type("wpTextbox1", "");
7177 $this->click("link=Table");
7278 $this->type("wpTextbox1", "");
@@ -81,10 +87,12 @@
8288 }
8389
8490 parent::doLogout();
 91+
8592 }
8693
8794 // Verify the replace all function on Search and Replace
8895 function testTextSearchReplaceAll(){
 96+
8997 parent::doOpenLink();
9098 parent::doLogin();
9199 $this->open("/deployment-en/Main_Page");
@@ -92,6 +100,7 @@
93101 $this->waitForPageToLoad("30000");
94102 $this->click("//li[@id='ca-edit']/a/span");
95103 $this->waitForPageToLoad("30000");
 104+ parent::doExpandAdvanceSection();
96105 $this->type("wpTextbox1", "");
97106 $this->click("link=Search and replace");
98107 $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa");
@@ -119,10 +128,12 @@
120129 }
121130
122131 parent::doLogout();
 132+
123133 }
124134
125135 // Verify the replace next function on Search and Replace
126136 function testTextSearchReplaceNext(){
 137+
127138 parent::doOpenLink();
128139 parent::doLogin();
129140 $this->open("/deployment-en/Main_Page");
@@ -130,6 +141,7 @@
131142 $this->waitForPageToLoad("30000");
132143 $this->click("//li[@id='ca-edit']/a/span");
133144 $this->waitForPageToLoad("30000");
 145+ parent::doExpandAdvanceSection();
134146 $this->type("wpTextbox1", "");
135147 $this->click("link=Search and replace");
136148 $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa");
@@ -158,6 +170,7 @@
159171 array_push($this->verificationErrors, $e->toString());
160172 }
161173 parent::doLogout();
 174+
162175 }
163176
164177 /** When user click on find, text highlight on back which is not captured in Selenium directly.
@@ -168,6 +181,7 @@
169182 $this->waitForPageToLoad("30000");
170183 $this->click("//li[@id='ca-edit']/a/span");
171184 $this->waitForPageToLoad("30000");
 185+ parent::doExpandAdvanceSection();
172186 $this->type("wpTextbox1", "");
173187 $this->click("link=Search and replace");
174188
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarNTOCTC.php
@@ -14,6 +14,7 @@
1515
1616 // Add header level 2 and verify Header output
1717 function testHeaderLevel2(){
 18+
1819 parent::doOpenLink();
1920 parent::doLogin();
2021 $this->open("/deployment-en/Main_Page");
@@ -22,6 +23,7 @@
2324 $this->waitForPageToLoad("30000");
2425 $this->click("//li[@id='ca-edit']/a/span");
2526 $this->waitForPageToLoad("30000");
 27+ parent::doExpandAdvanceSection();
2628 $this->click("link=Heading");
2729 $this->click("link=Heading");
2830 $this->click("link=Level 2");
@@ -35,10 +37,12 @@
3638 }
3739
3840 parent::doLogout();
 41+
3942 }
4043
4144 // Add header level 3 and verify Header output
4245 function testHeaderLevel3(){
 46+
4347 parent::doOpenLink();
4448 parent::doLogin();
4549 $this->open("/deployment-en/Main_Page");
@@ -47,6 +51,7 @@
4852 $this->waitForPageToLoad("30000");
4953 $this->click("//li[@id='ca-edit']/a/span");
5054 $this->waitForPageToLoad("30000");
 55+ parent::doExpandAdvanceSection();
5156 $this->click("link=Heading");
5257 $this->click("link=Heading");
5358 $this->click("link=Level 3");
@@ -60,10 +65,12 @@
6166 }
6267
6368 parent::doLogout();
 69+
6470 }
6571
6672 // Add header level 4 and verify Header output
6773 function testHeaderLevel4(){
 74+
6875 parent::doOpenLink();
6976 parent::doLogin();
7077 $this->open("/deployment-en/Main_Page");
@@ -72,6 +79,7 @@
7380 $this->waitForPageToLoad("30000");
7481 $this->click("//li[@id='ca-edit']/a/span");
7582 $this->waitForPageToLoad("30000");
 83+ parent::doExpandAdvanceSection();
7684 $this->click("link=Heading");
7785 $this->click("link=Heading");
7886 $this->click("link=Level 4");
@@ -85,10 +93,12 @@
8694 }
8795
8896 parent::doLogout();
 97+
8998 }
9099
91100 // Add header level 5 and verify Header output
92101 function testHeaderLevel5(){
 102+
93103 parent::doOpenLink();
94104 parent::doLogin();
95105 $this->open("/deployment-en/Main_Page");
@@ -97,6 +107,7 @@
98108 $this->waitForPageToLoad("30000");
99109 $this->click("//li[@id='ca-edit']/a/span");
100110 $this->waitForPageToLoad("30000");
 111+ parent::doExpandAdvanceSection();
101112 $this->click("link=Heading");
102113 $this->click("link=Heading");
103114 $this->click("link=Level 5");
@@ -110,6 +121,7 @@
111122 }
112123
113124 parent::doLogout();
 125+
114126 }
115127 }
116128 ?>
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiCommonTC.php
@@ -7,7 +7,7 @@
88 */
99 class WikiCommonTC extends PHPUnit_Extensions_SeleniumTestCase {
1010 /** Wiki server environment details.This array should be commented if the test
11 - * run on local browsers. **/
 11+ * run on local browsers.
1212
1313 public static $browsers = array(
1414 array(
@@ -17,12 +17,12 @@
1818 'port' => 4444,
1919 'timeout' => 30000,
2020 )
21 - );
 21+ ); **/
2222
2323 // Setup the browser URL and local browser
2424 function setUp() {
2525 // Setting the local browser. this should be disabled if the test run in Wiki environment.
26 - // $this->setBrowser("*firefox");
 26+ $this->setBrowser("*firefox");
2727 // Main link to be connected
2828 $this->setBrowserUrl("http://prototype.wikimedia.org");
2929 }
@@ -30,6 +30,7 @@
3131 // Open the page.
3232 function doOpenLink(){
3333 $this->open("/deployment-en/Main_Page");
 34+ $this->waitForPageToLoad("30000");
3435 }
3536
3637 // Login to the application
@@ -62,5 +63,12 @@
6364 }
6465 }
6566 }
 67+
 68+ //Expand advance tool bar section if its not
 69+ function doExpandAdvanceSection() {
 70+ if (!$this->isTextPresent("Heading")){
 71+ $this->click("link=Advanced");
 72+ }
 73+ }
6674 }
6775 ?>
\ No newline at end of file

Status & tagging log