Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiAcaiPreferencesTC.php |
— | — | @@ -1,15 +0,0 @@ |
2 | | -<?php |
3 | | -require_once 'WikiCommonTC.php'; |
4 | | -/** |
5 | | - * This test case will be handling the user account settings. |
6 | | - * Date : Apr - 2010 |
7 | | - * @author : BhagyaG - Calcey |
8 | | - */ |
9 | | -class WikiPreferencesTC extends WikiCommonTC { |
10 | | - |
11 | | - function setup(){ |
12 | | - parent::setUp(); |
13 | | - } |
14 | | - |
15 | | -} |
16 | | -?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarNTOC.php |
— | — | @@ -1,245 +0,0 @@ |
2 | | -<?php |
3 | | -require_once 'WikiCommonTC.php'; |
4 | | -/** |
5 | | - * This test case will be handling the NTOC related functions. |
6 | | - * Adding different header levels via tool bar and verify the output |
7 | | - * Date : Apr - 2010 |
8 | | - * @author : BhagyaG - Calcey |
9 | | - */ |
10 | | -class WikiToolBarNTOC extends WikiCommonTC { |
11 | | - |
12 | | - // Set up the testing environment |
13 | | - function setup(){ |
14 | | - parent::setUp(); |
15 | | - } |
16 | | - |
17 | | - |
18 | | - // Add header level 2 and verify Header output |
19 | | - function testHeaderLevel2(){ |
20 | | - |
21 | | - parent::doOpenLink(); |
22 | | - parent::doLogin(); |
23 | | - $this->open("/deployment-en/Main_Page"); |
24 | | - $this->waitForPageToLoad("30000"); |
25 | | - $this->click("link=Random article"); |
26 | | - $this->waitForPageToLoad("30000"); |
27 | | - $this->click("//li[@id='ca-edit']/a/span"); |
28 | | - $this->waitForPageToLoad("30000"); |
29 | | - parent::doExpandAdvanceSection(); |
30 | | - $this->click("link=Heading"); |
31 | | - $this->click("link=Heading"); |
32 | | - $this->click("link=Level 2"); |
33 | | - $this->type("wpTextbox1", "==Heading text=="); |
34 | | - $this->click("wpPreview"); |
35 | | - $this->waitForPageToLoad("30000"); |
36 | | - try { |
37 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
38 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
39 | | - array_push($this->verificationErrors, $e->toString()); |
40 | | - } |
41 | | - |
42 | | - parent::doLogout(); |
43 | | - |
44 | | - } |
45 | | - |
46 | | - // Add header level 3 and verify Header output |
47 | | - function testHeaderLevel3(){ |
48 | | - |
49 | | - parent::doOpenLink(); |
50 | | - parent::doLogin(); |
51 | | - $this->open("/deployment-en/Main_Page"); |
52 | | - $this->waitForPageToLoad("30000"); |
53 | | - $this->click("link=Random article"); |
54 | | - $this->waitForPageToLoad("30000"); |
55 | | - $this->click("//li[@id='ca-edit']/a/span"); |
56 | | - $this->waitForPageToLoad("30000"); |
57 | | - parent::doExpandAdvanceSection(); |
58 | | - $this->click("link=Heading"); |
59 | | - $this->click("link=Heading"); |
60 | | - $this->click("link=Level 3"); |
61 | | - $this->type("wpTextbox1", "===Heading text==="); |
62 | | - $this->click("wpPreview"); |
63 | | - $this->waitForPageToLoad("30000"); |
64 | | - try { |
65 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3")); |
66 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
67 | | - array_push($this->verificationErrors, $e->toString()); |
68 | | - } |
69 | | - |
70 | | - parent::doLogout(); |
71 | | - |
72 | | - } |
73 | | - |
74 | | - // Add header level 4 and verify Header output |
75 | | - function testHeaderLevel4(){ |
76 | | - |
77 | | - parent::doOpenLink(); |
78 | | - parent::doLogin(); |
79 | | - $this->open("/deployment-en/Main_Page"); |
80 | | - $this->waitForPageToLoad("30000"); |
81 | | - $this->click("link=Random article"); |
82 | | - $this->waitForPageToLoad("30000"); |
83 | | - $this->click("//li[@id='ca-edit']/a/span"); |
84 | | - $this->waitForPageToLoad("30000"); |
85 | | - parent::doExpandAdvanceSection(); |
86 | | - $this->click("link=Heading"); |
87 | | - $this->click("link=Heading"); |
88 | | - $this->click("link=Level 4"); |
89 | | - $this->type("wpTextbox1", "====Heading text===="); |
90 | | - $this->click("wpPreview"); |
91 | | - $this->waitForPageToLoad("30000"); |
92 | | - try { |
93 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4")); |
94 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
95 | | - array_push($this->verificationErrors, $e->toString()); |
96 | | - } |
97 | | - |
98 | | - parent::doLogout(); |
99 | | - |
100 | | - } |
101 | | - |
102 | | - // Add header level 5 and verify Header output |
103 | | - function testHeaderLevel5(){ |
104 | | - parent::doOpenLink(); |
105 | | - parent::doLogin(); |
106 | | - $this->open("/deployment-en/Main_Page"); |
107 | | - $this->waitForPageToLoad("30000"); |
108 | | - $this->click("link=Random article"); |
109 | | - $this->waitForPageToLoad("30000"); |
110 | | - $this->click("//li[@id='ca-edit']/a/span"); |
111 | | - $this->waitForPageToLoad("30000"); |
112 | | - parent::doExpandAdvanceSection(); |
113 | | - $this->click("link=Heading"); |
114 | | - $this->click("link=Heading"); |
115 | | - $this->click("link=Level 5"); |
116 | | - $this->type("wpTextbox1", "=====Heading text====="); |
117 | | - $this->click("wpPreview"); |
118 | | - $this->waitForPageToLoad("30000"); |
119 | | - try { |
120 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h5")); |
121 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
122 | | - array_push($this->verificationErrors, $e->toString()); |
123 | | - } |
124 | | - |
125 | | - parent::doLogout(); |
126 | | - |
127 | | - } |
128 | | - |
129 | | - // Add header level 2 & 3 and verify Header output |
130 | | - function testHeaderLevel2and3(){ |
131 | | - parent::doOpenLink(); |
132 | | - parent::doLogin(); |
133 | | - $this->open("/deployment-en/Main_Page"); |
134 | | - $this->waitForPageToLoad("30000"); |
135 | | - $this->click("link=Random article"); |
136 | | - $this->waitForPageToLoad("30000"); |
137 | | - $this->click("//li[@id='ca-edit']/a/span"); |
138 | | - $this->waitForPageToLoad("30000"); |
139 | | - parent::doExpandAdvanceSection(); |
140 | | - $this->click("link=Heading"); |
141 | | - $this->click("link=Level 2"); |
142 | | - $this->click("link=Heading"); |
143 | | - $this->click("link=Level 3"); |
144 | | - $this->type("wpTextbox1", "==Heading text==\n===Heading text==="); |
145 | | - $this->click("wpPreview"); |
146 | | - $this->waitForPageToLoad("30000"); |
147 | | - try { |
148 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
149 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
150 | | - array_push($this->verificationErrors, $e->toString()); |
151 | | - } |
152 | | - try { |
153 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3")); |
154 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
155 | | - array_push($this->verificationErrors, $e->toString()); |
156 | | - } |
157 | | - |
158 | | - parent::doLogout(); |
159 | | - } |
160 | | - |
161 | | - // Add header level 2 , 3 & 4 and verify Header output |
162 | | - function testHeaderLevel23and4(){ |
163 | | - parent::doOpenLink(); |
164 | | - parent::doLogin(); |
165 | | - $this->open("/deployment-en/Main_Page"); |
166 | | - $this->waitForPageToLoad("30000"); |
167 | | - $this->click("link=Random article"); |
168 | | - $this->waitForPageToLoad("30000"); |
169 | | - $this->click("//li[@id='ca-edit']/a/span"); |
170 | | - $this->waitForPageToLoad("30000"); |
171 | | - parent::doExpandAdvanceSection(); |
172 | | - $this->click("link=Heading"); |
173 | | - $this->click("link=Level 2"); |
174 | | - $this->click("link=Heading"); |
175 | | - $this->click("link=Level 3"); |
176 | | - $this->click("link=Heading"); |
177 | | - $this->click("link=Level 4"); |
178 | | - $this->type("wpTextbox1", "==Heading text==\n===Heading text===\n====Heading text===="); |
179 | | - $this->click("wpPreview"); |
180 | | - $this->waitForPageToLoad("30000"); |
181 | | - try { |
182 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
183 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
184 | | - array_push($this->verificationErrors, $e->toString()); |
185 | | - } |
186 | | - try { |
187 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3")); |
188 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
189 | | - array_push($this->verificationErrors, $e->toString()); |
190 | | - } |
191 | | - try { |
192 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4")); |
193 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
194 | | - array_push($this->verificationErrors, $e->toString()); |
195 | | - } |
196 | | - |
197 | | - parent::doLogout(); |
198 | | - } |
199 | | - |
200 | | - // Add header level 2 , 3 , 4 & 5 and verify Header output |
201 | | - function testHeaderLevel234and5(){ |
202 | | - parent::doOpenLink(); |
203 | | - parent::doLogin(); |
204 | | - $this->open("/deployment-en/Main_Page"); |
205 | | - $this->waitForPageToLoad("30000"); |
206 | | - $this->click("link=Random article"); |
207 | | - $this->waitForPageToLoad("30000"); |
208 | | - $this->click("//li[@id='ca-edit']/a/span"); |
209 | | - $this->waitForPageToLoad("30000"); |
210 | | - parent::doExpandAdvanceSection(); |
211 | | - $this->click("link=Heading"); |
212 | | - $this->click("link=Level 2"); |
213 | | - $this->click("link=Heading"); |
214 | | - $this->click("link=Level 3"); |
215 | | - $this->click("link=Heading"); |
216 | | - $this->click("link=Level 4"); |
217 | | - $this->click("link=Heading"); |
218 | | - $this->click("link=Level 5"); |
219 | | - $this->type("wpTextbox1", "==Heading text==\n===Heading text===\n====Heading text====\n=====Heading text====="); |
220 | | - $this->click("wpPreview"); |
221 | | - $this->waitForPageToLoad("30000"); |
222 | | - try { |
223 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
224 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
225 | | - array_push($this->verificationErrors, $e->toString()); |
226 | | - } |
227 | | - try { |
228 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3")); |
229 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
230 | | - array_push($this->verificationErrors, $e->toString()); |
231 | | - } |
232 | | - try { |
233 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4")); |
234 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
235 | | - array_push($this->verificationErrors, $e->toString()); |
236 | | - } |
237 | | - try { |
238 | | - $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h5")); |
239 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
240 | | - array_push($this->verificationErrors, $e->toString()); |
241 | | - } |
242 | | - |
243 | | - parent::doLogout(); |
244 | | - } |
245 | | -} |
246 | | -?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarTextFormatTC.php |
— | — | @@ -1,286 +0,0 @@ |
2 | | -<?php |
3 | | -require_once 'WikiCommonTC.php'; |
4 | | -/** |
5 | | - * This test case will be handling the text formatting related functions via tool bar |
6 | | - * Date : Apr - 2010 |
7 | | - * @author : BhagyaG - Calcey |
8 | | - */ |
9 | | -class WikiToolBarTextFormatTC extends WikiCommonTC { |
10 | | - // Set up the testing environment |
11 | | - function setup(){ |
12 | | - parent::setUp(); |
13 | | - } |
14 | | - |
15 | | - // Mark text Bold and verify output |
16 | | - function testMakeTextBold(){ |
17 | | - |
18 | | - parent::doOpenLink(); |
19 | | - parent::doLogin(); |
20 | | - $this->open("/deployment-en/Main_Page"); |
21 | | - $this->click("link=Random article"); |
22 | | - $this->waitForPageToLoad("30000"); |
23 | | - $this->click("//li[@id='ca-edit']/a/span"); |
24 | | - $this->waitForPageToLoad("30000"); |
25 | | - $this->type("wpTextbox1", ""); |
26 | | - $this->click("link=Bold"); |
27 | | - $this->type("wpTextbox1", "'''Bold''' text"); |
28 | | - $this->click("wpPreview"); |
29 | | - $this->waitForPageToLoad("30000"); |
30 | | - try { |
31 | | - $this->assertEquals("Bold", $this->getText("//div[@id='wikiPreview']/p/b")); |
32 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
33 | | - array_push($this->verificationErrors, $e->toString()); |
34 | | - } |
35 | | - |
36 | | - parent::doLogout(); |
37 | | - |
38 | | - } |
39 | | - |
40 | | - // Mark text Italic and verify output |
41 | | - function testMakeTextItalic(){ |
42 | | - |
43 | | - parent::doOpenLink(); |
44 | | - parent::doLogin(); |
45 | | - $this->click("link=Random article"); |
46 | | - $this->waitForPageToLoad("30000"); |
47 | | - $this->click("//li[@id='ca-edit']/a/span"); |
48 | | - $this->waitForPageToLoad("30000"); |
49 | | - $this->type("wpTextbox1", ""); |
50 | | - $this->click("link=Italic"); |
51 | | - $this->type("wpTextbox1", "''Italian'' text"); |
52 | | - $this->click("wpPreview"); |
53 | | - $this->waitForPageToLoad("30000"); |
54 | | - $this->assertEquals("Italian", $this->getText("//div[@id='wikiPreview']/p/i")); |
55 | | - parent::doLogout(); |
56 | | - |
57 | | - } |
58 | | - |
59 | | - // Use Bullet Item function and verify output |
60 | | - function testBulletItem(){ |
61 | | - |
62 | | - parent::doOpenLink(); |
63 | | - parent::doLogin(); |
64 | | - $this->open("/deployment-en/Main_Page"); |
65 | | - $this->click("link=Random article"); |
66 | | - $this->waitForPageToLoad("30000"); |
67 | | - $this->click("//li[@id='ca-edit']/a/span"); |
68 | | - $this->waitForPageToLoad("30000"); |
69 | | - parent::doExpandAdvanceSection(); |
70 | | - $this->type("wpTextbox1", ""); |
71 | | - $this->click("link=Bulleted list"); |
72 | | - $this->click("link=Bulleted list"); |
73 | | - $this->click("link=Bulleted list"); |
74 | | - $this->type("wpTextbox1", "* Bulleted list item\n* Bulleted list item\n* Bulleted list item"); |
75 | | - $this->click("wpPreview"); |
76 | | - $this->waitForPageToLoad("30000"); |
77 | | - try { |
78 | | - $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[1]")); |
79 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
80 | | - array_push($this->verificationErrors, $e->toString()); |
81 | | - } |
82 | | - try { |
83 | | - $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[2]")); |
84 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
85 | | - array_push($this->verificationErrors, $e->toString()); |
86 | | - } |
87 | | - try { |
88 | | - $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[3]")); |
89 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
90 | | - array_push($this->verificationErrors, $e->toString()); |
91 | | - } |
92 | | - |
93 | | - parent::doLogout(); |
94 | | - |
95 | | - } |
96 | | - |
97 | | - // Use Numbered Item function and verify output |
98 | | - function testNumberedItem(){ |
99 | | - |
100 | | - parent::doOpenLink(); |
101 | | - parent::doLogin(); |
102 | | - $this->open("/deployment-en/Main_Page"); |
103 | | - $this->click("link=Random article"); |
104 | | - $this->waitForPageToLoad("30000"); |
105 | | - $this->click("//li[@id='ca-edit']/a/span"); |
106 | | - $this->waitForPageToLoad("30000"); |
107 | | - parent::doExpandAdvanceSection(); |
108 | | - $this->type("wpTextbox1", ""); |
109 | | - $this->click("link=Numbered list"); |
110 | | - $this->click("link=Numbered list"); |
111 | | - $this->click("link=Numbered list"); |
112 | | - $this->type("wpTextbox1", "# Numbered list item\n# Numbered list item\n# Numbered list item"); |
113 | | - $this->click("wpPreview"); |
114 | | - $this->waitForPageToLoad("30000"); |
115 | | - try { |
116 | | - $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[1]")); |
117 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
118 | | - array_push($this->verificationErrors, $e->toString()); |
119 | | - } |
120 | | - try { |
121 | | - $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[2]")); |
122 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
123 | | - array_push($this->verificationErrors, $e->toString()); |
124 | | - } |
125 | | - try { |
126 | | - $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[3]")); |
127 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
128 | | - array_push($this->verificationErrors, $e->toString()); |
129 | | - } |
130 | | - parent::doLogout(); |
131 | | - |
132 | | - } |
133 | | - |
134 | | - // Mark text as Nowiki and verify output |
135 | | - function testNoWiki(){ |
136 | | - |
137 | | - parent::doOpenLink(); |
138 | | - parent::doLogin(); |
139 | | - $this->open("/deployment-en/Main_Page"); |
140 | | - $this->click("link=Random article"); |
141 | | - $this->waitForPageToLoad("30000"); |
142 | | - $this->click("//li[@id='ca-edit']/a/span"); |
143 | | - $this->waitForPageToLoad("30000"); |
144 | | - parent::doExpandAdvanceSection(); |
145 | | - $this->type("wpTextbox1", ""); |
146 | | - $this->type("wpTextbox1", "<nowiki>==Heading text==</nowiki>"); |
147 | | - $this->click("wpPreview"); |
148 | | - $this->waitForPageToLoad("30000"); |
149 | | - try { |
150 | | - $this->assertEquals("==Heading text==", $this->getText("//div[@id='wikiPreview']/p")); |
151 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
152 | | - array_push($this->verificationErrors, $e->toString()); |
153 | | - } |
154 | | - parent::doLogout(); |
155 | | - |
156 | | - } |
157 | | - |
158 | | - // Create a line break and verify output |
159 | | - function testLineBreak(){ |
160 | | - |
161 | | - parent::doOpenLink(); |
162 | | - parent::doLogin(); |
163 | | - $this->open("/deployment-en/Main_Page"); |
164 | | - $this->click("link=Random article"); |
165 | | - $this->waitForPageToLoad("30000"); |
166 | | - $this->click("//li[@id='ca-edit']/a/span"); |
167 | | - $this->waitForPageToLoad("30000"); |
168 | | - parent::doExpandAdvanceSection(); |
169 | | - $this->type("wpTextbox1", ""); |
170 | | - $this->type("wpTextbox1", "this is a test text to check the line\n break."); |
171 | | - $this->click("wpPreview"); |
172 | | - $this->waitForPageToLoad("30000"); |
173 | | - try { |
174 | | - $this->assertEquals("this is a test text to check the line\n break.", $this->getText("//div[@id='wikiPreview']/p")); |
175 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
176 | | - array_push($this->verificationErrors, $e->toString()); |
177 | | - } |
178 | | - parent::doLogout(); |
179 | | - |
180 | | - } |
181 | | - |
182 | | - // Mark text as Big and verify output |
183 | | - function testTextBig(){ |
184 | | - |
185 | | - parent::doOpenLink(); |
186 | | - parent::doLogin(); |
187 | | - $this->open("/deployment-en/Main_Page"); |
188 | | - $this->click("link=Random article"); |
189 | | - $this->waitForPageToLoad("30000"); |
190 | | - $this->click("//li[@id='ca-edit']/a/span"); |
191 | | - $this->waitForPageToLoad("30000"); |
192 | | - parent::doExpandAdvanceSection(); |
193 | | - $this->type("wpTextbox1", ""); |
194 | | - $this->click("link=Big"); |
195 | | - $this->type("wpTextbox1", "<big>This</big> text"); |
196 | | - $this->click("wpPreview"); |
197 | | - $this->waitForPageToLoad("30000"); |
198 | | - try { |
199 | | - $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/big")); |
200 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
201 | | - array_push($this->verificationErrors, $e->toString()); |
202 | | - } |
203 | | - |
204 | | - parent::doLogout(); |
205 | | - |
206 | | - } |
207 | | - |
208 | | - // Mark text as Small and verify output |
209 | | - function testTextSmall(){ |
210 | | - |
211 | | - parent::doOpenLink(); |
212 | | - parent::doLogin(); |
213 | | - $this->open("/deployment-en/Main_Page"); |
214 | | - $this->click("link=Random article"); |
215 | | - $this->waitForPageToLoad("30000"); |
216 | | - $this->click("//li[@id='ca-edit']/a/span"); |
217 | | - $this->waitForPageToLoad("30000"); |
218 | | - parent::doExpandAdvanceSection(); |
219 | | - $this->type("wpTextbox1", ""); |
220 | | - $this->click("link=Small"); |
221 | | - $this->type("wpTextbox1", "<small>This</small> text\n"); |
222 | | - $this->click("wpPreview"); |
223 | | - $this->waitForPageToLoad("30000"); |
224 | | - try { |
225 | | - $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/small")); |
226 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
227 | | - array_push($this->verificationErrors, $e->toString()); |
228 | | - } |
229 | | - |
230 | | - parent::doLogout(); |
231 | | - |
232 | | - } |
233 | | - |
234 | | - // Mark text as Super Script and verify output |
235 | | - function testTextSuperscript(){ |
236 | | - |
237 | | - parent::doOpenLink(); |
238 | | - parent::doLogin(); |
239 | | - $this->open("/deployment-en/Main_Page"); |
240 | | - $this->click("link=Random article"); |
241 | | - $this->waitForPageToLoad("30000"); |
242 | | - $this->click("//li[@id='ca-edit']/a/span"); |
243 | | - $this->waitForPageToLoad("30000"); |
244 | | - parent::doExpandAdvanceSection(); |
245 | | - $this->type("wpTextbox1", ""); |
246 | | - $this->click("link=Superscript"); |
247 | | - $this->type("wpTextbox1", "<sup>This</sup> text\n"); |
248 | | - $this->click("wpPreview"); |
249 | | - $this->waitForPageToLoad("30000"); |
250 | | - try { |
251 | | - $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sup")); |
252 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
253 | | - array_push($this->verificationErrors, $e->toString()); |
254 | | - } |
255 | | - |
256 | | - parent::doLogout(); |
257 | | - |
258 | | - } |
259 | | - |
260 | | - // Mark text as Sub Script and verify output |
261 | | - function testTextSubscript(){ |
262 | | - |
263 | | - parent::doOpenLink(); |
264 | | - parent::doLogin(); |
265 | | - $this->open("/deployment-en/Main_Page"); |
266 | | - $this->click("link=Random article"); |
267 | | - $this->waitForPageToLoad("30000"); |
268 | | - $this->click("//li[@id='ca-edit']/a/span"); |
269 | | - $this->waitForPageToLoad("30000"); |
270 | | - parent::doExpandAdvanceSection(); |
271 | | - $this->type("wpTextbox1", ""); |
272 | | - $this->click("link=Subscript"); |
273 | | - $this->type("wpTextbox1", "<sub>This</sub> text\n"); |
274 | | - $this->click("wpPreview"); |
275 | | - $this->waitForPageToLoad("30000"); |
276 | | - try { |
277 | | - $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sub")); |
278 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
279 | | - array_push($this->verificationErrors, $e->toString()); |
280 | | - } |
281 | | - |
282 | | - parent::doLogout(); |
283 | | - |
284 | | - } |
285 | | - |
286 | | -} |
287 | | -?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiWatchUnWatchTC.php |
— | — | @@ -1,69 +0,0 @@ |
2 | | -<?php |
3 | | -require_once 'WikiCommonTC.php'; |
4 | | -/** |
5 | | - * This test case will be handling the page watch functions. |
6 | | - * Date : Apr - 2010 |
7 | | - * @author : BhagyaG - Calcey |
8 | | - */ |
9 | | -class WikiWatchUnWatchTC extends WikiCommonTC { |
10 | | - // Set up the testing environment |
11 | | - function setup(){ |
12 | | - parent::setUp(); |
13 | | - } |
14 | | - |
15 | | - // Mark a page as watch and verify the My Watch list |
16 | | - function testWatch(){ |
17 | | - |
18 | | - parent::doOpenLink(); |
19 | | - parent::doLogin(); |
20 | | - $this->click("link=Random article"); |
21 | | - $this->waitForPageToLoad("30000"); |
22 | | - $randompage = $this->getText("firstHeading"); |
23 | | - $this->click("link=Watch"); |
24 | | - $this->click("link=My watchlist"); |
25 | | - $this->waitForPageToLoad("30000"); |
26 | | - $this->click("link=View and edit watchlist"); |
27 | | - $this->waitForPageToLoad("30000"); |
28 | | - |
29 | | - $this->assertTrue($this->isTextPresent($randompage)); |
30 | | - parent::doLogout(); |
31 | | - |
32 | | - } |
33 | | - |
34 | | - |
35 | | - // Mark a page as watch and mark the same page as unwatch and verify the My Watch list |
36 | | - function testUnWatch(){ |
37 | | - |
38 | | - parent::doOpenLink(); |
39 | | - parent::doLogin(); |
40 | | - $this->click("link=Random article"); |
41 | | - $this->waitForPageToLoad("30000"); |
42 | | - $randompage = $this->getText("firstHeading"); |
43 | | - $this->click("link=Watch"); |
44 | | - $this->click("link=My watchlist"); |
45 | | - $this->waitForPageToLoad("30000"); |
46 | | - $this->click("link=View and edit watchlist"); |
47 | | - $this->waitForPageToLoad("30000"); |
48 | | - $this->assertTrue($this->isTextPresent($randompage)); |
49 | | - $this->click("link=" . $randompage); |
50 | | - $this->waitForPageToLoad("30000"); |
51 | | - $this->click("link=Unwatch"); |
52 | | - $this->click("link=My watchlist"); |
53 | | - $this->waitForPageToLoad("30000"); |
54 | | - $this->click("link=View and edit watchlist"); |
55 | | - $this->waitForPageToLoad("30000"); |
56 | | - try { |
57 | | - $this->assertFalse($this->isTextPresent($randompage)); |
58 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
59 | | - array_push($this->verificationErrors, $e->toString()); |
60 | | - } |
61 | | - parent::doLogout(); |
62 | | - |
63 | | - } |
64 | | - |
65 | | - /** function testEditWatch(){ |
66 | | - |
67 | | - }**/ |
68 | | - |
69 | | -} |
70 | | -?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiAcaiSearchTC.php |
— | — | @@ -1,55 +0,0 @@ |
2 | | -<?php |
3 | | -require_once 'WikiCommonTC.php'; |
4 | | -/** |
5 | | - * This test case will be handling the search function. |
6 | | - * Date : Apr - 2010 |
7 | | - * @author : BhagyaG - Calcey |
8 | | - */ |
9 | | -class WikiAcaiSearchTC extends WikiCommonTC { |
10 | | - // Set up the testing environment |
11 | | - function setup(){ |
12 | | - parent::setUp(); |
13 | | - } |
14 | | - |
15 | | - // Search for a Wiki Page. Search result should be directed to the page itself |
16 | | - function testSearchPage(){ |
17 | | - parent::doOpenLink(); |
18 | | - parent::doLogin(); |
19 | | - $this->click("link=Main page"); |
20 | | - $this->type("//*[@id='searchInput']", "Hair (musical)"); |
21 | | - $this->click("//*[@id='searchButton']"); |
22 | | - $this->waitForPageToLoad("30000"); |
23 | | - try { |
24 | | - $this->assertEquals("Hair (musical)", $this->getText("//*[@id='firstHeading']")); |
25 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
26 | | - array_push($this->verificationErrors, $e->toString()); |
27 | | - } |
28 | | - $this->click("link=Main page"); |
29 | | - $this->waitForPageToLoad("30000"); |
30 | | - parent::doLogout(); |
31 | | - } |
32 | | - |
33 | | - // Search for a text. Search result should display links which contain the search text |
34 | | - function testSearchText(){ |
35 | | - parent::doOpenLink(); |
36 | | - parent::doLogin(); |
37 | | - $this->click("link=Main page"); |
38 | | - $this->waitForPageToLoad("30000"); |
39 | | - $this->type("//*[@id='searchInput']", "TV"); |
40 | | - $this->click("searchButton"); |
41 | | - $this->waitForPageToLoad("30000"); |
42 | | - try { |
43 | | - $this->assertEquals("Search results", $this->getText("firstHeading")); |
44 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
45 | | - array_push($this->verificationErrors, $e->toString()); |
46 | | - } |
47 | | - try { |
48 | | - $this->assertEquals("TV - Search results - Wikipedia, the free encyclopedia", $this->getTitle()); |
49 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
50 | | - array_push($this->verificationErrors, $e->toString()); |
51 | | - } |
52 | | - parent::doLogout(); |
53 | | - } |
54 | | - |
55 | | -} |
56 | | -?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOtherTC.php |
— | — | @@ -1,87 +0,0 @@ |
2 | | -<?php |
3 | | -require_once 'WikiCommonTC.php'; |
4 | | -/** |
5 | | - * This test case will be handling the general tool bar functions |
6 | | - * Date : Apr - 2010 |
7 | | - * @author : BhagyaG - Calcey |
8 | | - */ |
9 | | -class WikiToolBarOtherTC extends WikiCommonTC { |
10 | | - // Set up the testing environment |
11 | | - function setup(){ |
12 | | - parent::setUp(); |
13 | | - } |
14 | | - |
15 | | - // Click on Embedded file function and verify the output |
16 | | - function testEmbeddedFile(){ |
17 | | - |
18 | | - parent::doOpenLink(); |
19 | | - parent::doLogin(); |
20 | | - $this->click("link=Random article"); |
21 | | - $this->waitForPageToLoad("30000"); |
22 | | - $this->click("//li[@id='ca-edit']/a/span"); |
23 | | - $this->waitForPageToLoad("30000"); |
24 | | - $this->click("link=Embedded file"); |
25 | | - $this->type("wpTextbox1", "\" \""); |
26 | | - $this->type("wpTextbox1", "[[File:Example.jpg]]"); |
27 | | - $this->click("wpPreview"); |
28 | | - $this->waitForPageToLoad("30000"); |
29 | | - try { |
30 | | - $this->assertEquals("", $this->getText("//img[@alt='Example.jpg']")); |
31 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
32 | | - array_push($this->verificationErrors, $e->toString()); |
33 | | - } |
34 | | - parent::doLogout(); |
35 | | - |
36 | | - } |
37 | | - |
38 | | - /** Reference link is not directing to the given link. |
39 | | - * For example if I add www.google.com as the reference link, |
40 | | - * on preview the link is not directing to google site. |
41 | | - function testReference(){ |
42 | | - parent::doOpenLink(); |
43 | | - parent::doLogin(); |
44 | | - |
45 | | - $this->open("/deployment-en/Main_Page"); |
46 | | - $this->click("link=Random article"); |
47 | | - $this->waitForPageToLoad("30000"); |
48 | | - $this->click("//li[@id='ca-edit']/a/span"); |
49 | | - $this->waitForPageToLoad("30000"); |
50 | | - $this->type("wpTextbox1", ""); |
51 | | - $this->click("link=Reference"); |
52 | | - $this->type("wpTextbox1", ""); |
53 | | - $this->type("wikieditor-toolbar-reference-text", "www.google.com"); |
54 | | - $this->click("//div[13]/div[11]/button[1]"); |
55 | | - $this->click("wpPreview"); |
56 | | - |
57 | | - parent::doLogout(); |
58 | | - }**/ |
59 | | - |
60 | | - // Click on Picture Gallery function and verify the output |
61 | | - function testPictureGallery(){ |
62 | | - |
63 | | - parent::doOpenLink(); |
64 | | - parent::doLogin(); |
65 | | - |
66 | | - $this->open("/deployment-en/Main_Page"); |
67 | | - $this->click("link=Random article"); |
68 | | - $this->waitForPageToLoad("30000"); |
69 | | - $this->click("//li[@id='ca-edit']/a/span"); |
70 | | - $this->waitForPageToLoad("30000"); |
71 | | - parent::doExpandAdvanceSection(); |
72 | | - $this->type("wpTextbox1", ""); |
73 | | - $this->click("link=Picture gallery"); |
74 | | - $this->click("wpPreview"); |
75 | | - $this->waitForPageToLoad("30000"); |
76 | | - try { |
77 | | - $this->assertEquals("", $this->getText("//div[@id='wikiPreview']/table/tbody/tr/td[1]/div/div[1]/div")); |
78 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
79 | | - array_push($this->verificationErrors, $e->toString()); |
80 | | - } |
81 | | - |
82 | | - parent::doLogout(); |
83 | | - |
84 | | - } |
85 | | - |
86 | | - |
87 | | -} |
88 | | -?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php |
— | — | @@ -1,473 +0,0 @@ |
2 | | -<?php |
3 | | -require_once 'WikiCommonTC.php'; |
4 | | -/** |
5 | | - * This test case will be handling the Wiki Tool bar Dialog functions |
6 | | - * Date : Apr - 2010 |
7 | | - * @author : BhagyaG - Calcey |
8 | | - */ |
9 | | -class WikiToolBarDialogsTC extends WikiCommonTC { |
10 | | - // Set up the testing environment |
11 | | - function setup(){ |
12 | | - parent::setUp(); |
13 | | - } |
14 | | - |
15 | | - |
16 | | - // Add a internal link and verify |
17 | | - function testInternalLink(){ |
18 | | - |
19 | | - parent::doOpenLink(); |
20 | | - parent::doLogin(); |
21 | | - $this->click("link=Random article"); |
22 | | - $this->waitForPageToLoad("30000"); |
23 | | - $this->click("//li[@id='ca-edit']/a/span"); |
24 | | - $this->waitForPageToLoad("30000"); |
25 | | - $this->type("wpTextbox1", ""); |
26 | | - $this->click("link=Link"); |
27 | | - $this->type("wikieditor-toolbar-link-int-target", "Daimler-Chrysler"); |
28 | | - $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists")); |
29 | | - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int")); |
30 | | - $this->click("//div[13]/div[11]/button[1]"); |
31 | | - $this->click("wpPreview"); |
32 | | - $this->waitForPageToLoad("30000"); |
33 | | - try { |
34 | | - $this->assertEquals("Daimler-Chrysler", $this->getText("link=Daimler-Chrysler")); |
35 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
36 | | - array_push($this->verificationErrors, $e->toString()); |
37 | | - } |
38 | | - $this->click("link=Daimler-Chrysler"); |
39 | | - $this->waitForPageToLoad("30000"); |
40 | | - try { |
41 | | - $this->assertTrue($this->isTextPresent("Daimler-Chrysler"), $this->getText("firstHeading")); |
42 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
43 | | - array_push($this->verificationErrors, $e->toString()); |
44 | | - } |
45 | | - parent::doLogout(); |
46 | | - |
47 | | - } |
48 | | - |
49 | | - // Add a internal link with different display text and verify |
50 | | - function testInternalLinkWithDisplayText(){ |
51 | | - |
52 | | - parent::doOpenLink(); |
53 | | - parent::doLogin(); |
54 | | - $this->click("link=Random article"); |
55 | | - $this->waitForPageToLoad("30000"); |
56 | | - $this->click("//li[@id='ca-edit']/a/span"); |
57 | | - $this->waitForPageToLoad("30000"); |
58 | | - $this->type("wpTextbox1", ""); |
59 | | - $this->click("link=Link"); |
60 | | - $this->type("wpTextbox1", ""); |
61 | | - $this->type("wikieditor-toolbar-link-int-target", "Fashion Island"); |
62 | | - $this->type("wikieditor-toolbar-link-int-text", "Fashion Island Test"); |
63 | | - $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists")); |
64 | | - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int")); |
65 | | - $this->click("//div[13]/div[11]/button[1]"); |
66 | | - $this->click("wpPreview"); |
67 | | - $this->waitForPageToLoad("30000"); |
68 | | - try { |
69 | | - $this->assertEquals("Fashion Island Test", $this->getText("link=Fashion Island Test")); |
70 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
71 | | - array_push($this->verificationErrors, $e->toString()); |
72 | | - } |
73 | | - $this->click("link=Fashion Island Test"); |
74 | | - $this->waitForPageToLoad("30000"); |
75 | | - try { |
76 | | - $this->assertTrue($this->isTextPresent("Fashion Island"), $this->getText("firstHeading")); |
77 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
78 | | - array_push($this->verificationErrors, $e->toString()); |
79 | | - } |
80 | | - |
81 | | - parent::doLogout(); |
82 | | - |
83 | | - } |
84 | | - |
85 | | - // Add a internal link with blank display text and verify |
86 | | - function testInternalLinkWithBlankDisplayText(){ |
87 | | - |
88 | | - parent::doOpenLink(); |
89 | | - parent::doLogin(); |
90 | | - $this->click("link=Random article"); |
91 | | - $this->waitForPageToLoad("30000"); |
92 | | - $this->click("//li[@id='ca-edit']/a/span"); |
93 | | - $this->waitForPageToLoad("30000"); |
94 | | - $this->click("link=Link"); |
95 | | - $this->type("wikieditor-toolbar-link-int-target", "Magical Mystery Tour (film)"); |
96 | | - $this->type("wikieditor-toolbar-link-int-text", ""); |
97 | | - $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists")); |
98 | | - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int")); |
99 | | - $this->click("//div[13]/div[11]/button[1]"); |
100 | | - $this->click("wpPreview"); |
101 | | - $this->waitForPageToLoad("30000"); |
102 | | - try { |
103 | | - $this->assertEquals("Magical Mystery Tour (film)", $this->getText("link=Magical Mystery Tour (film)")); |
104 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
105 | | - array_push($this->verificationErrors, $e->toString()); |
106 | | - } |
107 | | - $this->click("link=Magical Mystery Tour (film)"); |
108 | | - $this->waitForPageToLoad("30000"); |
109 | | - try { |
110 | | - $this->assertEquals("Magical Mystery Tour (film)", $this->getText("firstHeading")); |
111 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
112 | | - array_push($this->verificationErrors, $e->toString()); |
113 | | - } |
114 | | - |
115 | | - parent::doLogout(); |
116 | | - |
117 | | - } |
118 | | - |
119 | | - // Add external link and verify |
120 | | - function testExternalLink(){ |
121 | | - |
122 | | - parent::doOpenLink(); |
123 | | - parent::doLogin(); |
124 | | - $this->click("link=Random article"); |
125 | | - $this->waitForPageToLoad("30000"); |
126 | | - $this->click("//li[@id='ca-edit']/a/span"); |
127 | | - $this->waitForPageToLoad("30000"); |
128 | | - $this->type("wpTextbox1", ""); |
129 | | - $this->click("link=Link"); |
130 | | - $this->type("wikieditor-toolbar-link-int-target", "www.google.com"); |
131 | | - try { |
132 | | - $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external")); |
133 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
134 | | - array_push($this->verificationErrors, $e->toString()); |
135 | | - } |
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("30000"); |
140 | | - try { |
141 | | - $this->assertEquals("www.google.com", $this->getText("link=www.google.com")); |
142 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
143 | | - array_push($this->verificationErrors, $e->toString()); |
144 | | - } |
145 | | - $this->click("link=www.google.com"); |
146 | | - $this->waitForPageToLoad("30000"); |
147 | | - try { |
148 | | - $this->assertEquals("Google", $this->getTitle()); |
149 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
150 | | - array_push($this->verificationErrors, $e->toString()); |
151 | | - } |
152 | | - parent::doLogout(); |
153 | | - } |
154 | | - |
155 | | - // Add external link with different display text and verify |
156 | | - function testExternalLinkWithDisplayText(){ |
157 | | - |
158 | | - parent::doOpenLink(); |
159 | | - parent::doLogin(); |
160 | | - $this->click("link=Random article"); |
161 | | - $this->waitForPageToLoad("30000"); |
162 | | - $this->click("//li[@id='ca-edit']/a/span"); |
163 | | - $this->waitForPageToLoad("30000"); |
164 | | - $this->type("wpTextbox1", ""); |
165 | | - $this->click("link=Link"); |
166 | | - $this->type("wikieditor-toolbar-link-int-target", "www.google.com"); |
167 | | - $this->type("wikieditor-toolbar-link-int-text", "Google"); |
168 | | - try { |
169 | | - $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external")); |
170 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
171 | | - array_push($this->verificationErrors, $e->toString()); |
172 | | - } |
173 | | - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext")); |
174 | | - $this->click("//div[13]/div[11]/button[1]"); |
175 | | - $this->click("wpPreview"); |
176 | | - $this->waitForPageToLoad("30000"); |
177 | | - try { |
178 | | - $this->assertEquals("Google", $this->getText("link=Google")); |
179 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
180 | | - array_push($this->verificationErrors, $e->toString()); |
181 | | - } |
182 | | - $this->click("link=Google"); |
183 | | - $this->waitForPageToLoad("30000"); |
184 | | - try { |
185 | | - $this->assertEquals("Google", $this->getTitle()); |
186 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
187 | | - array_push($this->verificationErrors, $e->toString()); |
188 | | - } |
189 | | - |
190 | | - parent::doLogout(); |
191 | | - |
192 | | - } |
193 | | - |
194 | | - // Add external link with Blank display text and verify |
195 | | - function testExternalLinkWithBlankDisplayText(){ |
196 | | - |
197 | | - parent::doOpenLink(); |
198 | | - parent::doLogin(); |
199 | | - $this->click("link=Random article"); |
200 | | - $this->waitForPageToLoad("30000"); |
201 | | - $this->click("//li[@id='ca-edit']/a/span"); |
202 | | - $this->waitForPageToLoad("30000"); |
203 | | - $this->type("wpTextbox1", ""); |
204 | | - $this->click("link=Link"); |
205 | | - $this->type("wikieditor-toolbar-link-int-target", "www.google.com"); |
206 | | - $this->type("wikieditor-toolbar-link-int-text", ""); |
207 | | - try { |
208 | | - $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external")); |
209 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
210 | | - array_push($this->verificationErrors, $e->toString()); |
211 | | - } |
212 | | - $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext")); |
213 | | - $this->click("//div[13]/div[11]/button[1]"); |
214 | | - $this->click("wpPreview"); |
215 | | - $this->waitForPageToLoad("30000"); |
216 | | - try { |
217 | | - $this->assertEquals("[1]", $this->getText("link=[1]")); |
218 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
219 | | - array_push($this->verificationErrors, $e->toString()); |
220 | | - } |
221 | | - $this->click("link=[1]"); |
222 | | - $this->waitForPageToLoad("30000"); |
223 | | - try { |
224 | | - $this->assertEquals("Google", $this->getTitle()); |
225 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
226 | | - array_push($this->verificationErrors, $e->toString()); |
227 | | - } |
228 | | - |
229 | | - parent::doLogout(); |
230 | | - |
231 | | - } |
232 | | - |
233 | | - // Add a table and verify |
234 | | - function testCreateTable(){ |
235 | | - parent::doOpenLink(); |
236 | | - parent::doLogin(); |
237 | | - $this->open("/deployment-en/Main_Page"); |
238 | | - $this->click("link=Random article"); |
239 | | - $this->waitForPageToLoad("30000"); |
240 | | - $this->click("//li[@id='ca-edit']/a/span"); |
241 | | - $this->waitForPageToLoad("30000"); |
242 | | - parent::doExpandAdvanceSection(); |
243 | | - $this->type("wpTextbox1", ""); |
244 | | - $this->click("link=Table"); |
245 | | - $this->type("wpTextbox1", ""); |
246 | | - $this->click("wikieditor-toolbar-table-sortable"); |
247 | | - $this->click("//div[3]/button[1]"); |
248 | | - $this->click("wikieditor-toolbar-table-sortable"); |
249 | | - $this->click("wpPreview"); |
250 | | - $this->waitForPageToLoad("30000"); |
251 | | - try { |
252 | | - $this->assertEquals("Header text", $this->getText("//table[@id='sortable_table_id_0']/tbody/tr[1]/th[3]")); |
253 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
254 | | - array_push($this->verificationErrors, $e->toString()); |
255 | | - } |
256 | | - parent::doLogout(); |
257 | | - } |
258 | | - |
259 | | - // Add a table and verify only with head row |
260 | | - function testCreateTableWithHeadRow(){ |
261 | | - parent::doOpenLink(); |
262 | | - parent::doLogin(); |
263 | | - $this->open("/deployment-en/Main_Page"); |
264 | | - $this->click("link=Random article"); |
265 | | - $this->waitForPageToLoad("30000"); |
266 | | - $this->click("//li[@id='ca-edit']/a/span"); |
267 | | - $this->waitForPageToLoad("30000"); |
268 | | - parent::doExpandAdvanceSection(); |
269 | | - $this->type("wpTextbox1", ""); |
270 | | - $this->click("link=Table"); |
271 | | - $this->click("wikieditor-toolbar-table-wikitable"); |
272 | | - $this->type("wikieditor-toolbar-table-dimensions-rows", "4"); |
273 | | - $this->type("wikieditor-toolbar-table-dimensions-columns", "4"); |
274 | | - $this->click("//div[3]/button[1]"); |
275 | | - $this->click("wikieditor-toolbar-table-wikitable"); |
276 | | - $this->click("wpPreview"); |
277 | | - $this->waitForPageToLoad("30000"); |
278 | | - try { |
279 | | - $this->assertEquals("Header text", $this->getTable("//div[@id='wikiPreview']/table.0.0")); |
280 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
281 | | - array_push($this->verificationErrors, $e->toString()); |
282 | | - } |
283 | | - |
284 | | - parent::doLogout(); |
285 | | - } |
286 | | - |
287 | | - // Add a table and verify only with borders |
288 | | - function testCreateTableWithBorders(){ |
289 | | - parent::doOpenLink(); |
290 | | - parent::doLogin(); |
291 | | - $this->open("/deployment-en/Main_Page"); |
292 | | - $this->click("link=Random article"); |
293 | | - $this->waitForPageToLoad("30000"); |
294 | | - $this->click("//li[@id='ca-edit']/a/span"); |
295 | | - $this->waitForPageToLoad("30000"); |
296 | | - parent::doExpandAdvanceSection(); |
297 | | - $this->type("wpTextbox1", ""); |
298 | | - $this->click("link=Table"); |
299 | | - $this->click("wikieditor-toolbar-table-dimensions-header"); |
300 | | - $this->type("wikieditor-toolbar-table-dimensions-columns", "5"); |
301 | | - $this->click("//div[3]/button[1]"); |
302 | | - $this->click("wikieditor-toolbar-table-dimensions-header"); |
303 | | - $this->click("wpPreview"); |
304 | | - $this->waitForPageToLoad("30000"); |
305 | | - try { |
306 | | - $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.1.3")); |
307 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
308 | | - array_push($this->verificationErrors, $e->toString()); |
309 | | - } |
310 | | - |
311 | | - parent::doLogout(); |
312 | | - } |
313 | | - |
314 | | - // Add a table and verify only with sort row |
315 | | - function testCreateTableWithSortRow(){ |
316 | | - parent::doOpenLink(); |
317 | | - parent::doLogin(); |
318 | | - $this->open("/deployment-en/Main_Page"); |
319 | | - $this->click("link=Random article"); |
320 | | - $this->waitForPageToLoad("30000"); |
321 | | - $this->click("//li[@id='ca-edit']/a/span"); |
322 | | - $this->waitForPageToLoad("30000"); |
323 | | - parent::doExpandAdvanceSection(); |
324 | | - $this->type("wpTextbox1", ""); |
325 | | - $this->click("link=Table"); |
326 | | - $this->click("wikieditor-toolbar-table-dimensions-header"); |
327 | | - $this->click("wikieditor-toolbar-table-wikitable"); |
328 | | - $this->click("wikieditor-toolbar-table-sortable"); |
329 | | - $this->type("wikieditor-toolbar-table-dimensions-rows", "2"); |
330 | | - $this->type("wikieditor-toolbar-table-dimensions-columns", "5"); |
331 | | - $this->click("//div[3]/button[1]"); |
332 | | - $this->click("wikieditor-toolbar-table-dimensions-header"); |
333 | | - $this->click("wikieditor-toolbar-table-wikitable"); |
334 | | - $this->click("wikieditor-toolbar-table-sortable"); |
335 | | - $this->click("wpPreview"); |
336 | | - $this->waitForPageToLoad("30000"); |
337 | | - try { |
338 | | - $this->assertEquals("Example", $this->getTable("sortable_table_id_0.0.0")); |
339 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
340 | | - array_push($this->verificationErrors, $e->toString()); |
341 | | - } |
342 | | - parent::doLogout(); |
343 | | - } |
344 | | - |
345 | | - // Add a table without headers,borders and sort rows |
346 | | - function testCreateTableWithNoSpecialEffects(){ |
347 | | - parent::doOpenLink(); |
348 | | - parent::doLogin(); |
349 | | - $this->open("/deployment-en/Main_Page"); |
350 | | - $this->click("link=Random article"); |
351 | | - $this->waitForPageToLoad("30000"); |
352 | | - $this->click("//li[@id='ca-edit']/a/span"); |
353 | | - $this->waitForPageToLoad("30000"); |
354 | | - parent::doExpandAdvanceSection(); |
355 | | - $this->type("wpTextbox1", ""); |
356 | | - $this->click("link=Table"); |
357 | | - $this->click("wikieditor-toolbar-table-wikitable"); |
358 | | - $this->click("wikieditor-toolbar-table-dimensions-header"); |
359 | | - $this->type("wikieditor-toolbar-table-dimensions-rows", "6"); |
360 | | - $this->type("wikieditor-toolbar-table-dimensions-columns", "2"); |
361 | | - $this->click("//div[3]/button[1]"); |
362 | | - $this->click("wikieditor-toolbar-table-dimensions-header"); |
363 | | - $this->click("wikieditor-toolbar-table-wikitable"); |
364 | | - $this->click("wpPreview"); |
365 | | - $this->waitForPageToLoad("30000"); |
366 | | - try { |
367 | | - $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.0.0")); |
368 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
369 | | - array_push($this->verificationErrors, $e->toString()); |
370 | | - } |
371 | | - parent::doLogout(); |
372 | | - } |
373 | | - |
374 | | - // Verify the replace all function on Search and Replace |
375 | | - function testTextSearchReplaceAll(){ |
376 | | - |
377 | | - parent::doOpenLink(); |
378 | | - parent::doLogin(); |
379 | | - $this->open("/deployment-en/Main_Page"); |
380 | | - $this->click("link=Random article"); |
381 | | - $this->waitForPageToLoad("30000"); |
382 | | - $this->click("//li[@id='ca-edit']/a/span"); |
383 | | - $this->waitForPageToLoad("30000"); |
384 | | - parent::doExpandAdvanceSection(); |
385 | | - $this->type("wpTextbox1", ""); |
386 | | - $this->click("link=Search and replace"); |
387 | | - $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa"); |
388 | | - $this->type("wikieditor-toolbar-replace-search", "calcey"); |
389 | | - $this->type("wikieditor-toolbar-replace-search", "calcey qa"); |
390 | | - $this->type("wikieditor-toolbar-replace-replace", "test team"); |
391 | | - $this->click("//button[3]"); |
392 | | - $this->click("//button[4]"); |
393 | | - $this->click("wpPreview"); |
394 | | - $this->waitForPageToLoad("30000"); |
395 | | - try { |
396 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[1]")); |
397 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
398 | | - array_push($this->verificationErrors, $e->toString()); |
399 | | - } |
400 | | - try { |
401 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[2]")); |
402 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
403 | | - array_push($this->verificationErrors, $e->toString()); |
404 | | - } |
405 | | - try { |
406 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[3]")); |
407 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
408 | | - array_push($this->verificationErrors, $e->toString()); |
409 | | - } |
410 | | - |
411 | | - parent::doLogout(); |
412 | | - |
413 | | - } |
414 | | - |
415 | | - // Verify the replace next function on Search and Replace |
416 | | - function testTextSearchReplaceNext(){ |
417 | | - |
418 | | - parent::doOpenLink(); |
419 | | - parent::doLogin(); |
420 | | - $this->open("/deployment-en/Main_Page"); |
421 | | - $this->click("link=Random article"); |
422 | | - $this->waitForPageToLoad("30000"); |
423 | | - $this->click("//li[@id='ca-edit']/a/span"); |
424 | | - $this->waitForPageToLoad("30000"); |
425 | | - parent::doExpandAdvanceSection(); |
426 | | - $this->type("wpTextbox1", ""); |
427 | | - $this->click("link=Search and replace"); |
428 | | - $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa"); |
429 | | - $this->click("link=Search and replace"); |
430 | | - $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa"); |
431 | | - $this->type("wikieditor-toolbar-replace-search", "calcey qa"); |
432 | | - $this->type("wikieditor-toolbar-replace-replace", "test team"); |
433 | | - $this->click("//div[13]/div[11]/button[2]"); |
434 | | - $this->click("//div[13]/div[11]/button[2]"); |
435 | | - $this->click("//button[4]"); |
436 | | - $this->click("wpPreview"); |
437 | | - $this->waitForPageToLoad("30000"); |
438 | | - try { |
439 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[1]")); |
440 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
441 | | - array_push($this->verificationErrors, $e->toString()); |
442 | | - } |
443 | | - try { |
444 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[2]")); |
445 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
446 | | - array_push($this->verificationErrors, $e->toString()); |
447 | | - } |
448 | | - try { |
449 | | - $this->assertEquals("calcey qa", $this->getText("//div[@id='wikiPreview']/p[3]")); |
450 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
451 | | - array_push($this->verificationErrors, $e->toString()); |
452 | | - } |
453 | | - parent::doLogout(); |
454 | | - |
455 | | - } |
456 | | - |
457 | | - /** When user click on find, text highlight on back which is not captured in Selenium directly. |
458 | | - function testTextSearchFindNext(){ |
459 | | - parent::doLogin(); |
460 | | - $this->open("/deployment-en/Main_Page"); |
461 | | - $this->click("link=Random article"); |
462 | | - $this->waitForPageToLoad("30000"); |
463 | | - $this->click("//li[@id='ca-edit']/a/span"); |
464 | | - $this->waitForPageToLoad("30000"); |
465 | | - parent::doExpandAdvanceSection(); |
466 | | - $this->type("wpTextbox1", ""); |
467 | | - $this->click("link=Search and replace"); |
468 | | - |
469 | | - |
470 | | - |
471 | | - parent::doLogout(); |
472 | | - }*/ |
473 | | -} |
474 | | -?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiCommonTC.php |
— | — | @@ -1,74 +0,0 @@ |
2 | | -<?php |
3 | | -require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; |
4 | | -/** |
5 | | - * This test case will be handling the common functions on test. |
6 | | - * Date : Apr - 2010 |
7 | | - * @author : BhagyaG - Calcey |
8 | | - */ |
9 | | -class WikiCommonTC extends PHPUnit_Extensions_SeleniumTestCase { |
10 | | - /** Wiki server environment details.This array should be commented if the test |
11 | | - * run on local browsers. |
12 | | - |
13 | | - public static $browsers = array( |
14 | | - array( |
15 | | - 'name' => 'Safari', |
16 | | - 'browser' => '*safari', |
17 | | - 'host' => 'raskin.usability.wikimedia.org', |
18 | | - 'port' => 4444, |
19 | | - 'timeout' => 30000, |
20 | | - ) |
21 | | - ); **/ |
22 | | - |
23 | | - // Setup the browser URL and local browser |
24 | | - function setUp() { |
25 | | - // Setting the local browser. this should be disabled if the test run in Wiki environment. |
26 | | - $this->setBrowser("*firefox"); |
27 | | - // Main link to be connected |
28 | | - $this->setBrowserUrl("http://prototype.wikimedia.org"); |
29 | | - } |
30 | | - |
31 | | - // Open the page. |
32 | | - function doOpenLink(){ |
33 | | - $this->open("/deployment-en/Main_Page"); |
34 | | - $this->waitForPageToLoad("30000"); |
35 | | - } |
36 | | - |
37 | | - // Login to the application |
38 | | - function doLogin() { |
39 | | - if (!$this->isTextPresent("Log out")) { |
40 | | - $this->click("link=Log in / create account"); |
41 | | - $this->waitForPageToLoad("30000"); |
42 | | - $this->type("wpName1", "bhagya_qa"); |
43 | | - $this->type("wpPassword1", "test"); |
44 | | - $this->click("wpLoginAttempt"); |
45 | | - $this->waitForPageToLoad("30000"); |
46 | | - try { |
47 | | - $this->assertEquals("Bhagya qa", $this->getText("link=Bhagya qa")); |
48 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
49 | | - array_push($this->verificationErrors, $e->toString()); |
50 | | - } |
51 | | - } |
52 | | - } |
53 | | - |
54 | | - // Log out from the application |
55 | | - function doLogout() { |
56 | | - $this->open("/deployment-en/Main_Page"); |
57 | | - if ($this->isTextPresent("Log out")) { |
58 | | - $this->click("link=Log out"); |
59 | | - $this->waitForPageToLoad("30000"); |
60 | | - try { |
61 | | - $this->assertEquals("Log in / create account", $this->getText("link=Log in / create account")); |
62 | | - } catch (PHPUnit_Framework_AssertionFailedError $e) { |
63 | | - array_push($this->verificationErrors, $e->toString()); |
64 | | - } |
65 | | - } |
66 | | - } |
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 | | - } |
74 | | -} |
75 | | -?> |
\ No newline at end of file |