r79511 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79510‎ | r79511 | r79512 >
Date:09:07, 3 January 2011
Author:nadeesha
Status:deferred (Comments)
Tags:
Comment:
Changed 'enter your wiki' link, environment ok text and remove 'Subscribe to the release announcements mailing list' check box verification section
Modified paths:
  • /trunk/phase3/tests/selenium/installer/MediaWikiUserInterfaceTestCase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/selenium/installer/MediaWikiUserInterfaceTestCase.php
@@ -38,379 +38,369 @@
3939
4040
4141 class MediaWikiUserInterfaceTestCase extends MediaWikiInstallationCommonFunction {
42 -
 42+
4343 function setUp() {
4444 parent::setUp();
4545 }
46 -
47 -
 46+
 47+
4848 public function testInitialPageUI() {
49 -
 49+
5050 parent::navigateInitialpage();
51 -
 51+
5252 // MediaWiki logo available
5353 $this->assertTrue( $this->isElementPresent( "//img[@alt='The MediaWiki logo']" ));
54 -
 54+
5555 // 'MediaWiki 1.18alpha' text available
5656 $this->assertEquals( "MediaWiki 1.18alpha", $this->getText( "//h1" ));
57 -
 57+
5858 // 'LocalSettings.php not found.' text available
5959 $this->assertEquals( "LocalSettings.php not found.", $this->getText( "//p[1]" ));
60 -
 60+
6161 // 'Please set up the wiki first' text available
6262 $this->assertEquals( "Please set up the wiki first.", $this->getText( "//p[2]" ));
63 -
 63+
6464 // 'set up the wiki' link available
6565 $this->assertTrue($this->isElementPresent( "link=set up the wiki" ));
6666 }
67 -
68 -
 67+
 68+
6969 public function testlanguagePageUI() {
70 -
 70+
7171 parent::navigateLanguagePage();
72 -
 72+
7373 // Verify 'Language' heading
7474 $this->assertEquals( "Language", $this->getText( LINK_DIV."h2" ));
75 -
 75+
7676 // 'Your language' label available
7777 $this->assertEquals( "Your language:",
7878 $this->getText( LINK_FORM."div[1]/div[1]/label" ));
79 -
 79+
8080 // 'Your language' dropdown available
8181 $this->assertTrue( $this->isElementPresent( "UserLang" ));
82 -
 82+
8383 // 'Wiki language' label available
8484 $this->assertEquals( "Wiki language:",
8585 $this->getText( LINK_FORM."div[2]/div[1]/label" ));
86 -
 86+
8787 // 'Wiki language' dropdown available
8888 $this->assertTrue($this->isElementPresent( "ContLang" ));
8989 }
90 -
91 -
 90+
 91+
9292 public function testWelcometoMediaWikiUI() {
93 -
 93+
9494 parent::navigateWelcometoMediaWikiPage();
95 -
 95+
9696 // Verify 'Welcome to MediaWiki!' heading
9797 $this->assertEquals( "Welcome to MediaWiki!",
9898 $this->getText( LINK_DIV."h2" ));
99 -
 99+
100100 // Verify environment ok text displayed.
101101 $this->assertEquals( "The environment has been checked.You can install MediaWiki.",
102 - $this->getText( LINK_DIV."div[7]/span" ));
 102+ $this->getText( LINK_DIV."div[6]/span" ));
103103 }
104 -
105 -
 104+
 105+
106106 public function testConnectToDatabaseUI() {
107 -
 107+
108108 parent::navigateConnetToDatabasePage();
109 -
 109+
110110 // 'MYSQL radio button available
111111 $this->assertEquals( "MySQL",
112112 $this->getText( LINK_FORM."div[2]/div[2]/ul/li[1]/label" ));
113113 $this->assertTrue( $this->isElementPresent( LINK_FORM."div[2]/div[2]/ul/li[1]" ));
114 -
 114+
115115 // 'SQLite' radio button available
116116 $this->assertTrue( $this->isElementPresent( LINK_FORM."div[2]/div[2]/ul/li[2]" ));
117117 $this->assertEquals( "SQLite", $this->getText( LINK_FORM."div[2]/div[2]/ul/li[2]/label "));
118 -
 118+
119119 // 'Database host' label available
120120 $this->assertEquals( "Database host:", $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/label" ));
121 -
 121+
122122 // 'Database host' text box default to 'localhost'
123123 $this->assertEquals( "localhost", $this->getValue( "mysql_wgDBserver" ));
124 -
 124+
125125 // 'Identify this wiki' section available
126126 $this->assertTrue( $this->isElementPresent( "//div[@id='DB_wrapper_mysql']/fieldset[1]/legend" ));
127 -
 127+
128128 // 'Identify this wiki' label available
129129 $this->assertEquals( "Identify this wiki", $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/legend" ));
130 -
 130+
131131 // 'Database name' lable available
132132 $this->assertEquals( "Database name:",
133133 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/label" ));
134 -
 134+
135135 // Verify 'Database name:' text box is default to 'my_wiki'
136136 $this->assertEquals( "my_wiki", $this->getValue( "mysql_wgDBname" ));
137 -
 137+
138138 // Verify 'Database table prefix:' label available
139139 $this->assertEquals( "Database table prefix:",
140140 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/label" ));
141 -
 141+
142142 // 'User account for installation' section available
143143 $this->assertTrue( $this->isElementPresent( "//div[@id='DB_wrapper_mysql']/fieldset[2]/legend" ));
144 -
 144+
145145 // 'User account for installation' label available
146146 $this->assertEquals( "User account for installation", $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/legend" ));
147 -
 147+
148148 // 'Database username' label available
149149 $this->assertEquals( "Database username:",
150150 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/label" ));
151 -
 151+
152152 // 'Database username' text box defaults to 'root'
153153 $this->assertEquals("root", $this->getValue( "mysql__InstallUser" ));
154 -
 154+
155155 // 'Database password' label available
156156 $this->assertEquals( "Database password:",
157157 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/label" ));
158158 }
159 -
160 -
161 -
 159+
 160+
 161+
162162 public function testDatabaseSettingsUI() {
163 -
 163+
164164 $databaseName = DB_NAME_PREFIX."_db_settings_UI";
165165 parent::navigateDatabaseSettingsPage( $databaseName );
166 -
 166+
167167 // 'Database settings' text available.
168168 $this->assertEquals( "Database settings", $this->getText( LINK_DIV."h2" ));
169 -
 169+
170170 // 'Database account for web access' section available
171171 $this->assertTrue( $this->isElementPresent( LINK_FORM."fieldset" ));
172 -
 172+
173173 // 'Database account for web access' label available
174174 $this->assertEquals( "Database account for web access", $this->getText( LINK_FORM."fieldset/legend" ));
175 -
 175+
176176 // 'Use the same account as for installation' check box available
177177 $this->assertEquals( "Use the same account as for installation", $this->getText( LINK_FORM."fieldset/div[1]/label" ));
178 -
 178+
179179 // 'Use the same account as for installation' check box is selected by default
180180 $this->assertEquals( "on", $this->getValue( "mysql__SameAccount" ));
181 -
 181+
182182 // 'Use the same account as for installation' check box deselected
183183 $this->click( "mysql__SameAccount" );
184 -
 184+
185185 // verify 'Use the same account as for installation' check box is not selected
186186 $this->assertEquals( "off", $this->getValue( "mysql__SameAccount" ));
187 -
 187+
188188 // 'Database username' label available
189189 $this->assertEquals( "Database username:", $this->getText( "//div[@id='dbOtherAccount']/div[1]/div[1]/label" ));
190 -
 190+
191191 // 'Database username' text box is default to the 'wikiuser'
192192 $this->assertEquals( "wikiuser", $this->getValue( "mysql_wgDBuser" ));
193 -
 193+
194194 // 'Database password' label available
195195 $this->assertEquals( "Database password:", $this->getText( "//div[@id='dbOtherAccount']/div[2]/div[1]/label" ));
196 -
 196+
197197 // 'Create the account if it does not already exist' label available
198198 $this->assertEquals( "Create the account if it does not already exist", $this->getText( "//div[@id='dbOtherAccount']/div[4]/label" ));
199 -
 199+
200200 // 'Create the account if it does not already exist' check box is not selected by default
201201 $this->assertEquals( "off" , $this->getValue( "mysql__CreateDBAccount" ));
202 -
 202+
203203 // 'Create the account if it does not already exist' check box selected
204204 $this->click( "mysql__CreateDBAccount" );
205 -
 205+
206206 // Verify 'Create the account if it does not already exist' check box is selected
207207 $this->assertEquals( "on" , $this->getValue( "mysql__CreateDBAccount" ));
208208 $this->click( "mysql__SameAccount" );
209209 $this->assertEquals( "on", $this->getValue( "mysql__SameAccount" ));
210 -
 210+
211211 // 'Storage engine' label available
212212 $this->assertEquals( "Storage engine:",
213213 $this->getText( LINK_FORM."div[1]/div[1]/label"));
214 -
 214+
215215 // 'InnoDB' label available
216216 $this->assertEquals( "InnoDB",
217217 $this->getText( LINK_FORM."div[1]/div[2]/ul/li[1]/label" ));
218 -
 218+
219219 // 'InnoDB' radio button available
220220 $this->assertTrue( $this->isElementPresent( "mysql__MysqlEngine_InnoDB" ));
221 -
 221+
222222 // 'MyISAM' label available
223223 $this->assertEquals( "MyISAM", $this->getText( LINK_FORM."div[1]/div[2]/ul/li[2]/label" ));
224 -
 224+
225225 // 'MyISAM' radio button available
226226 $this->assertTrue($this->isElementPresent( "mysql__MysqlEngine_MyISAM" ));
227 -
 227+
228228 // 'Database character set' label available
229229 $this->assertEquals( "Database character set:",
230230 $this->getText( LINK_FORM."div[3]/div[1]/label" ));
231 -
 231+
232232 // 'Binary' radio button available
233233 $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_binary" ));
234 -
 234+
235235 // 'Binary' radio button available
236236 $this->assertEquals( "Binary", $this->getText( LINK_FORM."div[3]/div[2]/ul/li[1]/label" ));
237 -
 237+
238238 // 'UTF-8' radio button available
239239 $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_utf8" ));
240 -
 240+
241241 // 'UTF-8' label available
242242 $this->assertEquals( "UTF-8", $this->getText( LINK_FORM."div[3]/div[2]/ul/li[2]/label" ));
243 -
 243+
244244 // 'Binary' radio button is selected
245245 $this->assertEquals( "on", $this->getValue( "mysql__MysqlCharset_binary" ));
246246 }
247 -
248 -
249 -
 247+
 248+
 249+
250250 public function testNamePageUI() {
251 -
 251+
252252 $databaseName = DB_NAME_PREFIX."_name_UI";
253253 parent::navigateNamePage($databaseName);
254 -
 254+
255255 // 'Name of wiki' text box available
256256 $this->assertEquals( "Name of wiki:",
257257 $this->getText( LINK_FORM."div[1]/div[1]/label" ));
258 -
 258+
259259 $this->assertTrue( $this->isElementPresent( "config_wgSitename" ));
260 -
 260+
261261 // 'Project namespace' label available
262262 $this->assertEquals( "Project namespace:",
263263 $this->getText( LINK_FORM."div[2]/div[1]/label" ));
264 -
 264+
265265 // 'Same as the wiki name' radio button available
266266 $this->assertTrue( $this->isElementPresent( "config__NamespaceType_site-name" ));
267 -
 267+
268268 // 'Project' radio button available
269269 $this->assertTrue( $this->isElementPresent( "config__NamespaceType_generic" ));
270 -
 270+
271271 // 'Project' radio button available
272272 $this->assertTrue( $this->isElementPresent( "config__NamespaceType_other" ));
273 -
 273+
274274 // 'Same as the wiki name' label available
275275 $this->assertEquals( "Same as the wiki name:",
276276 $this->getText( LINK_FORM."div[2]/div[2]/ul/li[1]/label" ));
277 -
 277+
278278 // 'Project' label available
279279 $this->assertEquals("Project",
280280 $this->getText( LINK_FORM."div[2]/div[2]/ul/li[2]/label" ));
281 -
 281+
282282 // 'Project' label available
283283 $this->assertEquals( "Other (specify)",
284284 $this->getText( LINK_FORM."div[2]/div[2]/ul/li[3]/label" ));
285 -
 285+
286286 // 'Same as the wiki name' radio button selected by default
287287 $this->assertEquals( "on", $this->getValue( "config__NamespaceType_site-name" ));
288 -
 288+
289289 // 'Administrator account' section available
290290 $this->assertTrue( $this->isElementPresent( LINK_FORM."fieldset" ));
291 -
 291+
292292 // 'Administrator account' label available
293293 $this->assertEquals( "Administrator account",
294294 $this->getText( LINK_FORM."fieldset/legend" ));
295 -
 295+
296296 // 'Your Name' label available
297297 $this->assertEquals( "Your name:",
298298 $this->getText( LINK_FORM."fieldset/div[1]/div[1]/label" ));
299 -
 299+
300300 // 'Your Name' text box available
301301 $this->assertTrue( $this->isElementPresent( "config__AdminName" ));
302 -
 302+
303303 // 'Password' label available
304304 $this->assertEquals( "Password:",
305305 $this->getText( LINK_FORM."fieldset/div[2]/div[1]/label" ));
306 -
 306+
307307 // 'Password' text box available
308308 $this->assertTrue( $this->isElementPresent( "config__AdminPassword" ));
309 -
 309+
310310 // 'Password again' label available
311311 $this->assertEquals( "Password again:",
312312 $this->getText( LINK_FORM."fieldset/div[3]/div[1]/label" ));
313 -
 313+
314314 // 'Password again' text box available
315315 $this->assertTrue( $this->isElementPresent( "config__AdminPassword2" ));
316 -
 316+
317317 // 'Email address' label avaialble
318318 $this->assertEquals( "E-mail address:",
319319 $this->getText( LINK_FORM."fieldset/div[4]/div[1]/label" ));
320 -
 320+
321321 // 'Email address' text box available
322322 $this->assertTrue( $this->isElementPresent( "config__AdminEmail" ));
323 -
324 - // 'Subscribe to the release announcements mailing list. ' check box available
325 - $this->assertTrue( $this->isElementPresent( "config__Subscribe" ));
326 -
327 - // 'Subscribe to the release announcements mailing list. ' label avaialble
328 - $this->assertEquals( "Subscribe to the release announcements mailing list.",
329 - $this->getText( LINK_FORM."fieldset/div[5]/label" ));
330 -
331 - // 'release announcements mailing list' link available
332 - $this->assertTrue( $this->isElementPresent( "link=release announcements mailing list" ));
333 -
 323+
334324 // Message displayed
335325 $this->assertEquals( "You are almost done! You can now skip the remaining configuration and install the wiki right now.",
336 - $this->getText( LINK_FORM."/div[4]/div[2]" ));
337 -
 326+ $this->getText( LINK_FORM."/div[4]/div[2]/p" ));
 327+
338328 // 'Ask me more questions.' radio button available
339329 $this->assertTrue( $this->isElementPresent( "config__SkipOptional_continue" ));
340 -
 330+
341331 // 'Ask me more questions.' label available
342332 $this->assertEquals( "Ask me more questions.",
343333 $this->getText( LINK_FORM."div[5]/div[2]/ul/li[1]/label" ));
344 -
 334+
345335 // 'I'm bored already, just install the wiki' radio button is avaiable
346336 $this->assertTrue( $this->isElementPresent( "config__SkipOptional_skip" ));
347 -
 337+
348338 // 'I'm bored already, just install the wiki' label available
349339 $this->assertEquals( "I'm bored already, just install the wiki.",
350340 $this->getText( LINK_FORM."div[5]/div[2]/ul/li[2]/label" ));
351 -
 341+
352342 // 'Ask me more questions.' radio button is default selected
353343 $this->assertEquals( "on", $this->getValue( "config__SkipOptional_continue" ));
354344 }
355 -
356 -
357 -
 345+
 346+
 347+
358348 public function testOptionPageUI() {
359 -
 349+
360350 $databaseName = DB_NAME_PREFIX."_options_UI";
361351 parent::navigateOptionsPage($databaseName);
362 -
 352+
363353 // 'Options' label available
364354 $this->assertEquals( "Options", $this->getText( LINK_DIV."h2"));
365 -
 355+
366356 // 'Return e-mail address' label available
367357 $this->assertEquals( "Return e-mail address:", $this->getText( "//div[@id='emailwrapper']/div[1]/div[1]/label" ));
368 -
 358+
369359 // 'Return e-mail address' text box available
370360 $this->assertTrue( $this->isElementPresent( "config_wgPasswordSender" ));
371 -
 361+
372362 // Text 'apache@localhost' is default value of the 'Return e-mail address' text box
373363 $this->assertEquals( "apache@localhost", $this->getValue( "config_wgPasswordSender" ));
374 -
 364+
375365 // 'Logo URL' label available
376366 $this->assertEquals( "Logo URL:", $this->getText( LINK_FORM."fieldset[2]/div[3]/div[1]/label" ));
377 -
 367+
378368 // 'Logo URL' text box available
379369 $this->assertTrue( $this->isElementPresent( "config_wgLogo" ));
380 -
 370+
381371 // Correct path available in the 'Logo URL' text box
382372 $this->assertEquals( "/wiki/skins/common/images/wiki.png", $this->getValue( "config_wgLogo" ));
383 -
 373+
384374 // 'Enable file uploads' radio button available
385375 $this->assertTrue( $this->isElementPresent( "config_wgEnableUploads" ));
386 -
 376+
387377 // 'Enable file uploads' label available
388378 $this->assertEquals( "Enable file uploads",
389379 $this->getText( LINK_FORM."fieldset[2]/div[1]/label" ));
390 -
 380+
391381 // 'Enable file uploads' check box is not selected
392382 $this->assertEquals( "off", $this->getValue( "config_wgEnableUploads" ));
393 -
 383+
394384 $this->click( "config_wgEnableUploads" );
395 -
 385+
396386 // 'Directory for deleted files' label available
397387 $this->assertEquals( "Directory for deleted files:",
398388 $this->getText( "//div[@id='uploadwrapper']/div/div[1]/label" ));
399 -
 389+
400390 // 'Directory for deleted files' text box available
401391 $this->assertTrue( $this->isElementPresent( "config_wgDeletedDirectory" ));
402 -
 392+
403393 // Correct path available in the 'Directory for deleted files' text box
404394 $this->assertEquals( "C:\\wamp\\www\\".DIRECTORY_NAME."/images/deleted",
405395 $this->getValue( "config_wgDeletedDirectory" ));
406396 }
407 -
408 -
409 -
 397+
 398+
 399+
410400 public function testInstallPageUI() {
411 -
 401+
412402 $databaseName = DB_NAME_PREFIX."_install_UI";
413403 parent::navigateInstallPage( $databaseName );
414 -
 404+
415405 // Verify installation done messages display
416406 $this->assertEquals( "Setting up database... done",
417407 $this->getText( LINK_FORM."ul/li[1]" ));
@@ -429,92 +419,92 @@
430420 $this->assertEquals( "Creating main page with default content... done",
431421 $this->getText( LINK_FORM."ul/li[8]" ));
432422 }
433 -
434 -
435 -
 423+
 424+
 425+
436426 public function testCompletePageUI() {
437 -
 427+
438428 $databaseName = DB_NAME_PREFIX."_complete_UI";
439429 parent::navigateCompletePage( $databaseName );
440 -
 430+
441431 // 'Congratulations!' text display
442432 $this->assertEquals("Congratulations!",
443433 $this->getText( LINK_FORM."div[1]/div[2]/p[1]/b"));
444434 // 'LocalSettings.php' generated message display
445435 $this->assertEquals( "The installer has generated a LocalSettings.php file. It contains all your configuration.",
446436 $this->getText( LINK_FORM."div[1]/div[2]/p[2]" ));
447 -
 437+
448438 // 'Download LocalSettings.php'' link available
449439 $this->assertTrue( $this->isElementPresent( "link=Download LocalSettings.php" ));
450 -
 440+
451441 // 'enter your wiki' link available
452 - $this->assertTrue( $this->isElementPresent( "link=enter your wiki" ));
 442+ $this->assertTrue($this->isElementPresent("link=Folder/index.php enter your wiki"));
453443 }
454 -
455 -
456 -
 444+
 445+
 446+
457447 public function testRestartInstallation() {
458 -
 448+
459449 parent::navigateConnetToDatabasePage();
460450 $this->click( "link=Restart installation" );
461451 $this->waitForPageToLoad( PAGE_LOAD_TIME );
462 -
 452+
463453 // Restart installation' label should be available.
464454 $this->assertEquals( "Restart installation", $this->getText( LINK_DIV."h2" ));
465 -
 455+
466456 //'Do you want to clear all saved data that you have entered and restart the installation process?' label available
467457 $this->assertEquals( "Do you want to clear all saved data that you have entered and restart the installation process?",
468458 $this->getText( "//*[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
469459 // 'Back' button available
470460 $this->assertTrue($this->isElementPresent( "submit-back" ));
471 -
 461+
472462 // 'Restart' button available
473463 $this->assertTrue($this->isElementPresent( "submit-restart" ));
474464 }
475 -
476 -
477 -
 465+
 466+
 467+
478468 public function testMediaWikiLogoAvailability() {
479 -
 469+
480470 $databaseName = DB_NAME_PREFIX."_mediawiki_logo";
481471 parent::navigateInitialpage();
482472 parent::mediaWikiLogoPresentInitialScreen();
483473 $this->click( "link=set up the wiki" );
484474 $this->waitForPageToLoad( PAGE_LOAD_TIME );
485 -
 475+
486476 // 'Language' page
487477 parent::mediaWikiLogoPresent();
488478 parent::clickContinueButton();
489 -
 479+
490480 // 'Welcome to MediaWiki' page
491481 parent::mediaWikiLogoPresent();
492482 parent::clickContinueButton();
493 -
 483+
494484 // 'Connet to database' page
495485 parent::mediaWikiLogoPresent();
496486 $this->type("mysql_wgDBname", $databaseName );
497487 parent::clickContinueButton();
498 -
 488+
499489 // 'Database setting' page
500490 parent::mediaWikiLogoPresent();
501491 parent::clickContinueButton();
502 -
 492+
503493 // 'Name' page
504494 parent::mediaWikiLogoPresent();
505495 parent::completeNamePage();
506496 parent::clickContinueButton();
507 -
 497+
508498 // 'Options' page
509499 parent::mediaWikiLogoPresent();
510500 parent::clickContinueButton();
511 -
 501+
512502 // 'Install' page
513503 parent::mediaWikiLogoPresent();
514504 }
515 -
516 -
 505+
 506+
517507 public function testRightFramework() {
518 -
 508+
519509 parent::navigateLanguagePage();
520510 // Verfy right framework texts display
521511 $this->assertEquals( "Language",

Comments

#Comment by 😂 (talk | contribs)   22:50, 5 January 2011

Subscribe test can be re-added, per r79678.

Status & tagging log