r78877 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78876‎ | r78877 | r78878 >
Date:10:36, 23 December 2010
Author:nadeesha
Status:deferred (Comments)
Tags:
Comment:
Updated the test cases as per the code review comments
Modified paths:
  • /trunk/phase3/tests/installer/MediaWikiButtonsAvailabilityTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiDifferentDatabaseAccountTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiDifferntDatabasePrefixTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiErrorsNamepageTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiHelpFieldHintTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiInstallationCommonFunction.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiInstallationConfig.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiInstallerTestSuite.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiMySQLDataBaseTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiMySQLiteDataBaseTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiOnAlreadyInstalledTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiRestartInstallationTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiRightFrameworkLinksTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiUpgradeExistingDatabaseTestCase.php (modified) (history)
  • /trunk/phase3/tests/installer/MediaWikiUserInterfaceTestCase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/installer/MediaWikiErrorsNamepageTestCase.php
@@ -33,7 +33,7 @@
3434 * Version : MediaWiki 1.18alpha
3535 */
3636
37 -require_once 'MediaWikiInstallationCommonFunction.php';
 37+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3838
3939 class MediaWikiErrorsNamepageTestCase extends MediaWikiInstallationCommonFunction {
4040
@@ -42,7 +42,7 @@
4343 }
4444
4545 // Verify warning message for the 'Name' page
46 - public function testErrorsNamePage(){
 46+ public function testErrorsNamePage() {
4747
4848 $databaseName = DB_NAME_PREFIX."_error_name";
4949
@@ -73,7 +73,7 @@
7474 $this->click( "config__NamespaceType_other" );
7575 $this->type( "config_wgMetaNamespace", INVALID_NAMESPACE );
7676 parent::clickContinueButton();
77 - $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.",
 77+ $this->assertEquals( "The specified namespace \"\" is invalid. Specify a different project namespace.",
7878 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
7979
8080
@@ -82,7 +82,7 @@
8383 $this->click( "config__NamespaceType_other" );
8484 $this->type( "config_wgMetaNamespace" , "" );
8585 parent::clickContinueButton();
86 - $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.",
 86+ $this->assertEquals( "The specified namespace \"\" is invalid. Specify a different project namespace.",
8787 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
8888
8989
@@ -103,7 +103,7 @@
104104 $this->assertEquals( "Enter an administrator username.",
105105 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
106106
107 -
 107+ $this->type( "config_wgSitename", VALID_WIKI_NAME );
108108 // Verify warning message for blank 'Password'
109109 $this->type( "config__AdminName", VALID_YOUR_NAME );
110110 $this->type( "config__AdminPassword", " " );
Index: trunk/phase3/tests/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php
@@ -28,7 +28,7 @@
2929 */
3030
3131
32 -require_once 'MediaWikiInstallationCommonFunction.php';
 32+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3333
3434 /*
3535 * Test Case ID : 09 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -38,21 +38,22 @@
3939
4040 class MediaWikiErrorsConnectToDatabasePageTestCase extends MediaWikiInstallationCommonFunction {
4141
42 - function setUp(){
 42+ function setUp() {
4343 parent::setUp();
4444 }
4545
4646 // Verify warning messages for the 'Connet to database' page
47 - public function testErrorsConnectToDatabasePage(){
 47+ public function testErrorsConnectToDatabasePage() {
4848
4949 parent::navigateConnetToDatabasePage();
5050
5151 // Verify warning mesage for invalid database host
5252 $this->type( "mysql_wgDBserver", INVALID_DB_HOST );
5353 parent::clickContinueButton();
54 - $this->assertEquals( "DB connection error: php_network_getaddresses: getaddrinfo failed: No such host is known. (".INVALID_DB_HOST.").Check the host, username and password below and try again.",
55 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
56 -
 54+ $this->assertEquals( "DB connection error: php_network_getaddresses: getaddrinfo failed: No such host is known. (".INVALID_DB_HOST.").",
 55+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p[1]" ));
 56+ $this->assertEquals( "Check the host, username and password below and try again.",
 57+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p[2]" ));
5758 // Verify warning message for the blank database host
5859 $this->type( "mysql_wgDBserver", "" );
5960 parent::clickContinueButton();
@@ -65,8 +66,8 @@
6667 // Verify warning message for the invalid database name
6768 $this->type( "mysql_wgDBname", INVALID_DB_NAME );
6869 parent::clickContinueButton();
69 - $this->assertEquals( "Invalid database name \"".INVALID_DB_NAME."\".Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).",
70 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 70+ $this->assertEquals( "Invalid database name \"".INVALID_DB_NAME."\". Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).",
 71+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p" ));
7172
7273 // Verify warning message for the blank database name
7374 $this->type( "mysql_wgDBname", "");
@@ -80,7 +81,7 @@
8182 // Verify warning message for the invalid databaase prefix
8283 $this->type( "mysql_wgDBprefix", INVALID_DB_PREFIX );
8384 parent::clickContinueButton();
84 - $this->assertEquals( "Invalid database prefix \"".INVALID_DB_PREFIX."\".Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).",
 85+ $this->assertEquals( "Invalid database prefix \"".INVALID_DB_PREFIX."\". Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).",
8586 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
8687
8788 // Valid Database prefix
@@ -89,15 +90,18 @@
9091 // Verify warning message for the invalid database user name
9192 $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME );
9293 parent::clickContinueButton();
93 - $this->assertEquals( "DB connection error: Access denied for user '".INVALID_DB_USER_NAME."'@'localhost' (using password: NO) (localhost).Check the host, username and password below and try again.",
94 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 94+ $this->assertEquals( "DB connection error: Access denied for user '".INVALID_DB_USER_NAME."'@'localhost' (using password: NO) (localhost).",
 95+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p[1]" ));
 96+ $this->assertEquals( "Check the host, username and password below and try again.",
 97+ $this->getText("//div[@id='bodyContent']/div/div/div[2]/div[2]/p[2]"));
9598
96 -
97 - // Verify warning message for the invalid database user name
 99+ // Verify warning message for the blank database user name
98100 $this->type( "mysql__InstallUser", "" );
99101 parent::clickContinueButton();
100 - $this->assertEquals( "DB connection error: Access denied for user 'SYSTEM'@'localhost' (using password: NO) (localhost).Check the host, username and password below and try again.",
101 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 102+ $this->assertEquals( "DB connection error: Access denied for user 'SYSTEM'@'localhost' (using password: NO) (localhost).",
 103+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p[1]" ));
 104+ $this->assertEquals( "Check the host, username and password below and try again.",
 105+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p[2]" ));
102106
103107 // Valid Database username
104108 $this->type( "mysql__InstallUser", VALID_DB_USER_NAME );
@@ -105,15 +109,20 @@
106110 // Verify warning message for the invalid password
107111 $this->type( "mysql__InstallPassword", INVALID_DB_PASSWORD );
108112 parent::clickContinueButton();
109 - $this->assertEquals( "DB connection error: Access denied for user 'root'@'localhost' (using password: YES) (localhost).Check the host, username and password below and try again.",
110 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
111113
 114+ $this->assertEquals( "DB connection error: Access denied for user 'root'@'localhost' (using password: YES) (localhost).",
 115+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p[1]" ));
 116+ $this->assertEquals( "Check the host, username and password below and try again.",
 117+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p[2]" ));
 118+
112119 // Verify warning message for the invalid username and password
113120 $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME );
114121 $this->type( "mysql__InstallPassword", INVALID_DB_PASSWORD );
115122 parent::clickContinueButton();
116 - $this->assertEquals( "DB connection error: Access denied for user '".INVALID_DB_USER_NAME."'@'localhost' (using password: YES) (localhost).Check the host, username and password below and try again.",
117 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 123+ $this->assertEquals( "DB connection error: Access denied for user '".INVALID_DB_USER_NAME."'@'localhost' (using password: YES) (localhost).",
 124+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p[1]" ));
 125+ $this->assertEquals( "Check the host, username and password below and try again.",
 126+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]/p[2]" ));
118127
119128 // Valid username and valid password
120129 $this->type( "mysql__InstallUser", VALID_DB_USER_NAME );
Index: trunk/phase3/tests/installer/MediaWikiInstallerTestSuite.php
@@ -30,19 +30,20 @@
3131 require_once 'PHPUnit/Framework.php';
3232 require_once 'PHPUnit/Framework/TestSuite.php';
3333
34 -require_once 'MediaWikiUserInterfaceTestCase.php';
35 -require_once 'MediaWikiButtonsAvailabilityTestCase.php';
36 -require_once 'MediaWikiHelpFieldHintTestCase.php';
37 -require_once 'MediaWikiRightFrameworkLinksTestCase.php';
38 -require_once 'MediaWikiRestartInstallationTestCase.php';
39 -require_once 'MediaWikiErrorsConnectToDatabasePageTestCase.php';
40 -require_once 'MediaWikiErrorsNamepageTestCase.php';
41 -require_once 'MediaWikiMySQLDataBaseTestCase.php';
42 -require_once 'MediaWikiMySQLiteDataBaseTestCase.php';
43 -require_once 'MediaWikiUpgradeExistingDatabaseTestCase.php';
44 -require_once 'MediaWikiDifferntDatabasePrefixTestCase.php';
45 -require_once 'MediaWikiDifferentDatabaseAccountTestCase.php';
 34+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiUserInterfaceTestCase.php');
 35+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiButtonsAvailabilityTestCase.php');
 36+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiHelpFieldHintTestCase.php');
 37+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiRightFrameworkLinksTestCase.php');
 38+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiRestartInstallationTestCase.php');
 39+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiErrorsConnectToDatabasePageTestCase.php');
 40+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiErrorsNamepageTestCase.php');
 41+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiMySQLDataBaseTestCase.php');
 42+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiMySQLiteDataBaseTestCase.php');
 43+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiUpgradeExistingDatabaseTestCase.php');
 44+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiDifferntDatabasePrefixTestCase.php');
 45+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiDifferentDatabaseAccountTestCase.php');
4646
 47+
4748 $suite = new PHPUnit_Framework_TestSuite('ArrayTest');
4849 $result = new PHPUnit_Framework_TestResult;
4950
Index: trunk/phase3/tests/installer/MediaWikiOnAlreadyInstalledTestCase.php
@@ -28,7 +28,7 @@
2929 */
3030
3131
32 -require_once 'MediaWikiInstallationCommonFunction.php';
 32+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3333
3434
3535 /*
@@ -64,10 +64,7 @@
6565
6666 // Complete page
6767 parent::clickContinueButton();
68 -
69 - // Clicking in the 'Continue' button should display the 'Complete' page with 'Congratulations!' text.
70 - $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
71 - $this->assertEquals( "Congratulations!", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
 68+ parent::completePageSuccessfull();
7269 $this->chooseCancelOnNextConfirmation();
7370 parent::restartInstallation();
7471 }
Index: trunk/phase3/tests/installer/MediaWikiHelpFieldHintTestCase.php
@@ -33,17 +33,17 @@
3434 * Version : MediaWiki 1.18alpha
3535 */
3636
37 -require_once 'MediaWikiInstallationCommonFunction.php';
 37+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3838
3939 class MediaWikiHelpFieldHintTestCase extends MediaWikiInstallationCommonFunction {
4040
41 - function setUp(){
 41+ function setUp() {
4242 parent::setUp();
4343 }
4444
4545
4646 // Verify help field availability for the fields
47 - public function testMySQLConnectToDatabaseFieldHint(){
 47+ public function testMySQLConnectToDatabaseFieldHint() {
4848
4949 parent::navigateConnetToDatabasePage();
5050
@@ -75,7 +75,7 @@
7676 }
7777
7878
79 - public function testSQLiteConnectToDatabaseFieldHint(){
 79+ public function testSQLiteConnectToDatabaseFieldHint() {
8080
8181 parent::navigateConnetToDatabasePage();
8282 $this->click( "DBType_sqlite" );
@@ -91,7 +91,7 @@
9292 }
9393
9494
95 - public function testDatabaseSettingsFieldHint(){
 95+ public function testDatabaseSettingsFieldHint() {
9696
9797 $databaseName = DB_NAME_PREFIX."_db_field";
9898 parent::navigateDatabaseSettingsPage($databaseName);
@@ -109,7 +109,7 @@
110110 }
111111
112112
113 - public function testNameFieldHint(){
 113+ public function testNameFieldHint() {
114114
115115 $databaseName = DB_NAME_PREFIX."_name_field";
116116 parent::navigateNamePage( $databaseName );
Index: trunk/phase3/tests/installer/MediaWikiInstallationCommonFunction.php
@@ -27,38 +27,41 @@
2828 */
2929
3030 require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
31 -include 'MediaWikiInstallationConfig.php';
 31+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationConfig.php');
 32+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationMessage.php');
 33+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationVariables.php');
3234
 35+
3336 class MediaWikiInstallationCommonFunction extends PHPUnit_Extensions_SeleniumTestCase {
3437
3538 function setUp() {
36 - $this->setBrowser("*chrome");
37 - $this->setBrowserUrl("http://localhost:".PORT."/".DIRECTORY_NAME."/");
 39+ $this->setBrowser( TEST_BROWSER );
 40+ $this->setBrowserUrl("http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/");
3841 }
3942
40 -
41 - public function navigateInitialpage(){
42 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/" );
 43+
 44+ public function navigateInitialpage() {
 45+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/" );
4346 }
4447
4548
4649 // Navigate to the 'Language' page
47 - public function navigateLanguagePage(){
48 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 50+ public function navigateLanguagePage() {
 51+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
4952 }
5053
5154
5255 // Navigate to the 'Welcome to MediaWiki' page
53 - public function navigateWelcometoMediaWikiPage(){
54 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 56+ public function navigateWelcometoMediaWikiPage() {
 57+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
5558 $this->click( "submit-continue ");
5659 $this->waitForPageToLoad( PAGE_LOAD_TIME );
5760 }
5861
5962
6063 // Navigate yo 'Connect to Database' page
61 - public function navigateConnetToDatabasePage(){
62 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 64+ public function navigateConnetToDatabasePage() {
 65+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
6366
6467 // 'Welcome to MediaWiki!' page
6568 $this->click( "submit-continue" );
@@ -71,9 +74,9 @@
7275
7376
7477 // Navigate to the 'Database Settings' page
75 - public function navigateDatabaseSettingsPage( $databaseName ){
 78+ public function navigateDatabaseSettingsPage( $databaseName ) {
7679
77 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 80+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
7881
7982 // 'Welcome to MediaWiki!' page
8083 $this->click("submit-continue");
@@ -90,8 +93,8 @@
9194
9295
9396 // Navigate to the 'Name' page
94 - public function navigateNamePage( $databaseName ){
95 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 97+ public function navigateNamePage( $databaseName ) {
 98+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
9699
97100 // 'Welcome to MediaWiki!' page
98101 $this->click( "submit-continue" );
@@ -112,10 +115,9 @@
113116
114117
115118 // Navigate 'Options' page
116 - public function navigateOptionsPage( $databaseName ){
 119+ public function navigateOptionsPage( $databaseName ) {
117120
118 - $upgradeExisting = false;
119 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 121+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
120122
121123 // 'Welcome to MediaWiki!' page
122124 $this->click( "submit-continue" );
@@ -146,10 +148,10 @@
147149
148150
149151 // Navigate 'Install' page
150 - public function navigateInstallPage( $databaseName ){
151 -
152 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 152+ public function navigateInstallPage( $databaseName ) {
153153
 154+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
 155+
154156 // 'Welcome to MediaWiki!' page
155157 $this->click( "submit-continue" );
156158 $this->waitForPageToLoad( PAGE_LOAD_TIME );
@@ -183,8 +185,8 @@
184186
185187
186188 // Navigate to 'Complete' page
187 - public function navigateCompletePage( $databaseName ){
188 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 189+ public function navigateCompletePage( $databaseName ) {
 190+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
189191
190192 // 'Welcome to MediaWiki!' page
191193 $this->click( "submit-continue" );
@@ -224,7 +226,7 @@
225227
226228
227229 // Complete the Name page fields
228 - public function completeNamePage(){
 230+ public function completeNamePage() {
229231 $this->type( "config_wgSitename", NAME_OF_WIKI );
230232 $this->type( "config__AdminName", ADMIN_USER_NAME);
231233 $this->type( "config__AdminPassword", ADMIN_PASSWORD );
@@ -236,21 +238,21 @@
237239
238240
239241 // Clicking on the 'Continue' button in any MediaWiki page
240 - public function clickContinueButton(){
 242+ public function clickContinueButton() {
241243 $this->click( "submit-continue" );
242244 $this->waitForPageToLoad( PAGE_LOAD_TIME );
243245 }
244246
245247
246248 // Clicking on the 'Back' button in any MediaWiki page
247 - public function clickBackButton(){
 249+ public function clickBackButton() {
248250 $this->click( "submit-back" );
249251 $this->waitForPageToLoad( PAGE_LOAD_TIME );
250252 }
251253
252254
253255 // Restarting the installation
254 - public function restartInstallation(){
 256+ public function restartInstallation() {
255257 $this->click( "link=Restart installation" );
256258 $this->waitForPageToLoad( PAGE_LOAD_TIME );
257259 $this->click( "submit-restart" );
@@ -259,13 +261,23 @@
260262
261263
262264 // Verify 'MediaWiki' logo available in the initial screen
263 - public function mediaWikiLogoPresentInitialScreen(){
264 - $this->assertTrue($this->isElementPresent("//img[@alt='The MediaWiki logo']"));
 265+ public function mediaWikiLogoPresentInitialScreen() {
 266+ $this->assertTrue( $this->isElementPresent( "//img[@alt='The MediaWiki logo']" ));
265267 }
266268
267269
268270 // Verify 'MediaWiki' logo available
269 - public function mediaWikiLogoPresent(){
270 - $this->assertTrue($this->isElementPresent("//div[@id='p-logo']/a"));
 271+ public function mediaWikiLogoPresent() {
 272+ $this->assertTrue( $this->isElementPresent( "//div[@id='p-logo']/a" ));
271273 }
 274+
 275+
 276+ public function completePageSuccessfull() {
 277+ $this->assertEquals( "Complete!",
 278+ $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 279+
 280+ // 'Congratulations!' text should be available in the 'Complete!' page.
 281+ $this->assertEquals( "Congratulations!",
 282+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/p[1]/b" ));
 283+ }
272284 }
Index: trunk/phase3/tests/installer/MediaWikiUpgradeExistingDatabaseTestCase.php
@@ -28,7 +28,7 @@
2929 */
3030
3131
32 -require_once 'MediaWikiInstallationCommonFunction.php';
 32+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3333
3434 /*
3535 * Test Case ID : 05 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -39,19 +39,19 @@
4040
4141 class MediaWikiUpgradeExistingDatabaseTestCase extends MediaWikiInstallationCommonFunction {
4242
43 - function setUp(){
 43+ function setUp() {
4444 parent::setUp();
4545 }
4646
4747 // Install Mediawiki using 'MySQL' database type.
48 - public function testUpgradeExistingDatabase(){
 48+ public function testUpgradeExistingDatabase() {
4949
5050 $databaseName = DB_NAME_PREFIX."_upgrade_existing";
5151 parent::navigateInstallPage( $databaseName );
5252
5353 $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
5454 $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
55 - $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.",
 55+ $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
5656 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
5757
5858 // 'Optionis' page
@@ -72,7 +72,7 @@
7373 $this->assertEquals( "Upgrade existing installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
7474
7575 // Warning message displayed.
76 - $this->assertEquals( "There are MediaWiki tables in this database.To upgrade them to MediaWiki 1.18alpha, click Continue.",
 76+ $this->assertEquals( "There are MediaWiki tables in this database. To upgrade them to MediaWiki 1.18alpha, click Continue.",
7777 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
7878
7979 parent::clickContinueButton();
@@ -80,8 +80,10 @@
8181 $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
8282
8383 // 'Upgrade complete.' text display
84 - $this->assertEquals( "Upgrade complete.You can now start using your wiki. \nIf you want to regenerate your LocalSettings.php file, click the button below. This is not recommended unless you are having problems with your wiki.",
85 - $this->getText( "//div[@id='bodyContent']/div/div/div[4]/form/div[1]/div[2]"));
 84+ $this->assertEquals("Upgrade complete.",
 85+ $this->getText("//div[@id='bodyContent']/div/div/div[4]/form/div[1]/div[2]/p[1]"));
 86+ $this->assertEquals("You can now start using your wiki.",
 87+ $this->getText("//div[@id='bodyContent']/div/div/div[4]/form/div[1]/div[2]/p[2]"));
8688
8789 $this->assertTrue($this->isElementPresent( "submit-regenerate" ));
8890 $this->click( "submit-regenerate" );
@@ -99,14 +101,12 @@
100102 parent::clickContinueButton();
101103
102104 // Install page
103 - $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.",
 105+ $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
104106 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
105107 parent::clickContinueButton();
106108
107109 // complete
108 - $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
109 - $this->assertEquals( "Congratulations!",
110 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
 110+ parent::completePageSuccessfull();
111111 $this->chooseCancelOnNextConfirmation();
112112 parent::restartInstallation();
113113 }
Index: trunk/phase3/tests/installer/MediaWikiButtonsAvailabilityTestCase.php
@@ -28,7 +28,7 @@
2929 */
3030
3131
32 -require_once 'MediaWikiInstallationCommonFunction.php';
 32+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3333
3434 /*
3535 * Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -36,6 +36,7 @@
3737 * Version : MediaWiki 1.18alpha
3838 */
3939
 40+
4041 class MediaWikiButtonsAvailabilityTestCase extends MediaWikiInstallationCommonFunction {
4142
4243 function setUp() {
Index: trunk/phase3/tests/installer/MediaWikiMySQLDataBaseTestCase.php
@@ -28,7 +28,7 @@
2929 */
3030
3131
32 -require_once 'MediaWikiInstallationCommonFunction.php';
 32+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3333
3434 /*
3535 * Test Case ID : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -38,12 +38,12 @@
3939
4040 class MediaWikiMySQLDataBaseTestCase extends MediaWikiInstallationCommonFunction {
4141
42 - function setUp(){
 42+ function setUp() {
4343 parent::setUp();
4444 }
4545
4646 // Verify MediaWiki installation using 'MySQL' database type
47 - public function testMySQLDatabaseSuccess(){
 47+ public function testMySQLDatabaseSuccess() {
4848
4949 $databaseName = DB_NAME_PREFIX."_sql_db";
5050
@@ -72,12 +72,7 @@
7373 parent::clickContinueButton();
7474
7575 // 'Complete' page
76 - $this->assertEquals( "Complete!",
77 - $this->getText("//div[@id='bodyContent']/div/div/h2" ));
78 -
79 - // 'Congratulations!' text should be available in the 'Complete!' page.
80 - $this->assertEquals( "Congratulations!",
81 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
 76+ parent::completePageSuccessfull();
8277 parent::restartInstallation();
8378 }
8479 }
Index: trunk/phase3/tests/installer/MediaWikiInstallationConfig.php
@@ -33,79 +33,17 @@
3434 * with current value of the 'DB_NAME_PREFIX'.
3535 * If you wish to run the suite more than one time, you need to change
3636 * the value of the 'DB_NAME_PREFIX'.
37 - */
38 -define('DB_NAME_PREFIX', "database_name_d" );
 37+*/
 38+define('DB_NAME_PREFIX', "database_name" );
 39+define('DIRECTORY_NAME', "mediawiki" );
 40+define ('PORT', "8080" );
 41+define( 'HOST_NAME', "localhost" );
3942
40 -// Directory name should be change
41 -define('DIRECTORY_NAME', "installertesting");
42 -
43 -
44 -// Port should be change
45 -define ('PORT', "8080");
46 -
47 -// Common variables
48 -define('PAGE_LOAD_TIME', "80000" );
49 -
50 -
51 -// 'MySQL' database type help field hint
52 -define('MYSQL_DATABASE_HOST_HELP', "If your database server is on different server, enter the host name or IP address here. \nIf you are using shared web hosting, your hosting provider should give you the correct host name in their documentation. \nIf you are installing on a Windows server and using MySQL, using \"localhost\" may not work for the server name. If it does not, try \"127.0.0.1\" for the local IP address.");
53 -define('MYSQL_DATABASE_NAME_HELP', "Choose a name that identifies your wiki. It should not contain spaces or hyphens. \nIf you are using shared web hosting, your hosting provider will either give you a specific database name to use or let you create databases via a control panel.");
54 -define('MYSQL_DATABASE_TABLE_PREFIX_HELP', "Choose a name that identifies your wiki. It should not contain spaces or hyphens.");
55 -define('MYSQL_DATBASE_USERNAME_HELP', "Enter the username that will be used to connect to the database during the installation process. This is not the username of the MediaWiki account; this is the username for your database.");
56 -define('MYSQL_DATABASE_PASSWORD_HELP', "Enter the password that will be used to connect to the database during the installation process. This is not the password for the MediaWiki account; this is the password for your database.");
57 -
58 -// 'SQLite' database type help field hint
59 -define('SQLITE_DATA_DIRECTORY_HELP', "SQLite stores all data in a single file. \nThe directory you provide must be writable by the webserver during installation. \nIt should not be accessible via the web, this is why we're not putting it where your PHP files are. \nThe installer will write a .htaccess file along with it, but if that fails someone can gain access to your raw database. That includes raw user data (e-mail addresses, hashed passwords) as well as deleted revisions and other restricted data on the wiki. \nConsider putting the database somewhere else altogether, for example in /var/lib/mediawiki/yourwiki.");
60 -define('SQLITE_DATABASE_NAME_HELP', "Choose a name that identifies your wiki. Do not use spaces or hyphens. This will be used for the SQLite data file name.");
61 -
62 -// 'Database settings' page hel0p field hint
63 -define('SEARCH_ENGINE_HELP', "InnoDB is almost always the best option, since it has good concurrency support. \nMyISAM may be faster in single-user or read-only installations. MyISAM databases tend to get corrupted more often than InnoDB databases.");
64 -define('DATABASE_CHARACTER_SET_HELP', "In binary mode, MediaWiki stores UTF-8 text to the database in binary fields. This is more efficient than MySQL's UTF-8 mode, and allows you to use the full range of Unicode characters. \nIn UTF-8 mode, MySQL will know what character set your data is in, and can present and convert it appropriately, but it will not let you store characters above the Basic Multilingual Plane.");
65 -
66 -// 'Name' page help field hint
67 -define('NAME_OF_WIKI_HELP', "This will appear in the title bar of the browser and in various other places.");
68 -define('PROJECT_NAMESPACE_HELP', "Following Wikipedia's example, many wikis keep their policy pages separate from their content pages, in a \"project namespace\". All page titles in this namespace start with a certain prefix, which you can specify here. Traditionally, this prefix is derived from the name of the wiki, but it cannot contain punctuation characters such as \"#\" or \":\".");
69 -define('USER_NAME_HELP', "Enter your preferred username here, for example \"Joe Bloggs\". This is the name you will use to log in to the wiki.");
70 -define('EMAIL_ADDRESS_HELP', "Enter an e-mail address here to allow you to receive e-mail from other users on the wiki, reset your password, and be notified of changes to pages on your watchlist.");
71 -define('SUBSCRIBE_MAILING_LIST_HELP', "This is a low-volume mailing list used for release announcements, including important security announcements. You should subscribe to it and update your MediaWiki installation when new versions come out.");
72 -
73 -
74 -// 'Name' page input values
75 -define( 'NAME_OF_WIKI', "Site Name");
76 -define( 'ADMIN_USER_NAME', "My Name" );
77 -define( 'ADMIN_PASSWORD', "12345" );
78 -define ( 'ADMIN_RETYPE_PASSWORD', "12345" );
79 -define ( 'ADMIN_EMAIL_ADDRESS', "nadeesha@calcey.com" );
80 -
81 -
82 -// 'Name' page input values for warning messages
83 -define( 'VALID_WIKI_NAME', "MyWiki" );
84 -define( 'VALID_YOUR_NAME', "Nadeesha Weerasinghe" );
85 -define( 'VALID_PASSWORD', "12345" );
86 -define( 'VALID_PASSWORD_AGAIN', "12345" );
87 -define( 'INVALID_PASSWORD_AGAIN', "123" );
88 -define( 'VALID_NAMESPACE', "Mynamespace" );
89 -define( 'INVALID_NAMESPACE', "##..##" );
90 -
91 -
92 -// 'Database settings' page input values
93 -define( 'DB_WEB_USER', "different" );
94 -define('DB_WEB_USER_PASSWORD', "12345" );
95 -
96 -
97 -// 'Connet to database' page input values
98 -define( 'DATABASE_PREFIX',"databaseprefix" );
99 -
100 -
101 -// 'Connet to database' page input values for warning messages
102 -define( 'VALID_DB_HOST', "localhost" );
103 -define( 'INVALID_DB_HOST', "local" );
104 -define( 'INVALID_DB_NAME', "my-wiki" );
105 -define ( 'VALID_DB_NAME', "my_wiki1");
106 -define( 'INVALID_DB_PREFIX', "database prefix" );
107 -define( 'VALID_DB_PREFIX', "database_prefix");
108 -define( 'INVALID_DB_USER_NAME', "roots" );
109 -define( 'VALID_DB_USER_NAME', "root");
110 -define( 'INVALID_DB_PASSWORD', "12345" );
111 -
112 -
 43+/*
 44+ * Use the followings to run the test suite in different browsers.
 45+ * Firefox : *firefox
 46+ * IE : *iexplore
 47+ * Google chrome : *googlechrome
 48+ * Opera : *opera
 49+*/
 50+define ( 'TEST_BROWSER', "*firefox" );
Index: trunk/phase3/tests/installer/MediaWikiMySQLiteDataBaseTestCase.php
@@ -28,7 +28,7 @@
2929 */
3030
3131
32 -require_once 'MediaWikiInstallationCommonFunction.php';
 32+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3333
3434 /*
3535 * Test Case ID : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -52,7 +52,7 @@
5353
5454 // Select 'SQLite' database type
5555 $this->assertEquals( "SQLite settings", $this->getText( "//div[@id='DB_wrapper_sqlite']/h3" ));
56 -
 56+
5757 // Change database name
5858 $defaultDbName = $this->getText( "sqlite_wgDBname" );
5959 $this->type( "sqlite_wgDBname", " ");
@@ -73,12 +73,7 @@
7474 parent::clickContinueButton();
7575
7676 // 'Complete' page
77 - $this->assertEquals( "Complete!",
78 - $this->getText("//div[@id='bodyContent']/div/div/h2" ));
79 -
80 - // 'Congratulations!' text should be available in the 'Complete!' page.
81 - $this->assertEquals( "Congratulations!",
82 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
 77+ parent::completePageSuccessfull();
8378 parent::restartInstallation();
8479 }
8580 }
Index: trunk/phase3/tests/installer/MediaWikiRightFrameworkLinksTestCase.php
@@ -28,7 +28,7 @@
2929 */
3030
3131
32 -require_once 'MediaWikiInstallationCommonFunction.php';
 32+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3333
3434 /*
3535 * Test Case ID : 14, 15, 16, 17 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -40,16 +40,16 @@
4141 */
4242
4343
44 -class MediaWikiRightFrameworkLinksTestCase extends MediaWikiInstallationCommonFunction{
 44+class MediaWikiRightFrameworkLinksTestCase extends MediaWikiInstallationCommonFunction {
4545
46 - function setUp(){
 46+ function setUp() {
4747 parent::setUp();
4848 }
4949
50 - public function testLinksAvailability(){
51 -
52 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 50+ public function testLinksAvailability() {
5351
 52+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
 53+
5454 // Verify 'Read me' link availability
5555 $this->assertTrue($this->isElementPresent( "link=Read me" ));
5656
@@ -60,9 +60,9 @@
6161 $this->assertTrue($this->isElementPresent( "link=Copying" ));
6262 }
6363
64 - public function testPageNavigation(){
 64+ public function testPageNavigation() {
6565
66 - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
 66+ $this->open( "http://".HOST_NAME.":".PORT."/".DIRECTORY_NAME."/config/index.php" );
6767
6868 // Navigate to the 'Read me' page
6969 $this->click( "link=Read me" );
Index: trunk/phase3/tests/installer/MediaWikiUserInterfaceTestCase.php
@@ -27,7 +27,7 @@
2828 *
2929 */
3030
31 -require_once 'MediaWikiInstallationCommonFunction.php';
 31+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3232
3333 /*
3434 * Test Case ID : 18 - 27 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -40,13 +40,12 @@
4141 class MediaWikiUserInterfaceTestCase extends MediaWikiInstallationCommonFunction {
4242
4343 function setUp() {
44 - $this->setBrowser("*chrome");
45 - $this->setBrowserUrl("http://localhost:".PORT."/".DIRECTORY_NAME."/");
 44+ parent::setUp();
4645 }
4746
48 -
49 - public function testInitialPageUI(){
5047
 48+ public function testInitialPageUI() {
 49+
5150 parent::navigateInitialpage();
5251
5352 // MediaWiki logo available
@@ -66,7 +65,7 @@
6766 }
6867
6968
70 - public function testlanguagePageUI(){
 69+ public function testlanguagePageUI() {
7170
7271 parent::navigateLanguagePage();
7372
@@ -89,7 +88,7 @@
9089 }
9190
9291
93 - public function testWelcometoMediaWikiUI(){
 92+ public function testWelcometoMediaWikiUI() {
9493
9594 parent::navigateWelcometoMediaWikiPage();
9695
@@ -103,7 +102,7 @@
104103 }
105104
106105
107 - public function testConnectToDatabaseUI(){
 106+ public function testConnectToDatabaseUI() {
108107
109108 parent::navigateConnetToDatabasePage();
110109
@@ -159,7 +158,7 @@
160159
161160
162161
163 - public function testDatabaseSettingsUI(){
 162+ public function testDatabaseSettingsUI() {
164163
165164 $databaseName = DB_NAME_PREFIX."_db_settings_UI";
166165 parent::navigateDatabaseSettingsPage( $databaseName );
@@ -245,7 +244,7 @@
246245 $this->assertEquals( "on", $this->getValue( "mysql__MysqlCharset_binary" ));
247246 }
248247
249 - public function testNamePageUI(){
 248+ public function testNamePageUI() {
250249
251250 $databaseName = DB_NAME_PREFIX."_name_UI";
252251 parent::navigateNamePage($databaseName);
@@ -330,7 +329,7 @@
331330 $this->assertTrue( $this->isElementPresent( "link=release announcements mailing list" ));
332331
333332 // Message displayed
334 - $this->assertEquals( "You are almost done!You can now skip the remaining configuration and install the wiki right now.",
 333+ $this->assertEquals( "You are almost done! You can now skip the remaining configuration and install the wiki right now.",
335334 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[4]/div[2]" ));
336335
337336 // 'Ask me more questions.' radio button available
@@ -352,9 +351,9 @@
353352 }
354353
355354
356 -
357 - public function testOptionPageUI(){
358355
 356+ public function testOptionPageUI() {
 357+
359358 $databaseName = DB_NAME_PREFIX."_options_UI";
360359 parent::navigateOptionsPage($databaseName);
361360
@@ -405,34 +404,40 @@
406405
407406
408407
409 - public function testInstallPageUI(){
 408+ public function testInstallPageUI() {
410409
411410 $databaseName = DB_NAME_PREFIX."_install_UI";
412411 parent::navigateInstallPage( $databaseName );
413412
414413 // Verify installation done messages display
415 - $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
416 - $this->assertEquals( "Setting up database... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[1]" ));
417 - $this->assertEquals( "Creating database user... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" ));
418 - $this->assertEquals( "Creating tables... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[3]" ));
419 - $this->assertEquals( "Populating default interwiki table... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[4]" ));
420 - $this->assertEquals( "Generating secret key... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[5]" ));
421 - $this->assertEquals( "Generating default upgrade key... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[6]" ));
422 - $this->assertEquals( "Creating administrator user account... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[7]" ));
423 - $this->assertEquals( "Creating main page with default content... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[8]" ));
 414+ $this->assertEquals( "Setting up database... done",
 415+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[1]" ));
 416+ $this->assertEquals( "Creating tables... done",
 417+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" ));
 418+ $this->assertEquals( "Creating database user... done",
 419+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[3]" ));
 420+ $this->assertEquals( "Populating default interwiki table... done",
 421+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[4]" ));
 422+ $this->assertEquals( "Generating secret key... done",
 423+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[5]" ));
 424+ $this->assertEquals( "Generating default upgrade key... done",
 425+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[6]" ));
 426+ $this->assertEquals( "Creating administrator user account... done",
 427+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[7]" ));
 428+ $this->assertEquals( "Creating main page with default content... done",
 429+ $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[8]" ));
424430 }
425431
426432
427433
428 - public function testCompletePageUI(){
 434+ public function testCompletePageUI() {
429435
430436 $databaseName = DB_NAME_PREFIX."_complete_UI";
431437 parent::navigateCompletePage( $databaseName );
432438
433439 // 'Congratulations!' text display
434 - $this->assertEquals( "Congratulations!",
435 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
436 -
 440+ $this->assertEquals("Congratulations!",
 441+ $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/p[1]/b"));
437442 // 'LocalSettings.php' generated message display
438443 $this->assertEquals( "The installer has generated a LocalSettings.php file. It contains all your configuration.",
439444 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/p[2]" ));
@@ -446,12 +451,12 @@
447452
448453
449454
450 - public function testRestartInstallation(){
451 -
 455+ public function testRestartInstallation() {
 456+
452457 parent::navigateConnetToDatabasePage();
453458 $this->click( "link=Restart installation" );
454459 $this->waitForPageToLoad( PAGE_LOAD_TIME );
455 -
 460+
456461 // Restart installation' label should be available.
457462 $this->assertEquals( "Restart installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
458463
@@ -467,7 +472,7 @@
468473
469474
470475
471 - public function testMediaWikiLogoAvailability(){
 476+ public function testMediaWikiLogoAvailability() {
472477
473478 $databaseName = DB_NAME_PREFIX."_mediawiki_logo";
474479 parent::navigateInitialpage();
@@ -506,17 +511,29 @@
507512 }
508513
509514
510 - public function testRightFramework(){
 515+ public function testRightFramework() {
511516
512517 parent::navigateLanguagePage();
513 - $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[1]/span" ));
514 - $this->assertEquals( "Welcome to MediaWiki!", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[2]/span" ));
515 - $this->assertEquals( "Connect to database", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[3]/span" ));
516 - $this->assertEquals( "Upgrade existing installation", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[4]" ));
517 - $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[5]/span" ));
518 - $this->assertEquals( "Name", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[6]/span" ));
519 - $this->assertEquals( "Options", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[7]/span" ));
520 - $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[8]/span" ));
521 - $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[9]/span" ));
 518+ // Verfy right framework texts display
 519+ $this->assertEquals( "Language",
 520+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[1]" ));
 521+ $this->assertEquals( "Existing wiki",
 522+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[2]" ));
 523+ $this->assertEquals( "Welcome to MediaWiki!",
 524+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[3]" ));
 525+ $this->assertEquals( "Connect to database",
 526+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[4]" ));
 527+ $this->assertEquals( "Upgrade existing installation",
 528+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[5]" ));
 529+ $this->assertEquals( "Database settings",
 530+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[6]" ));
 531+ $this->assertEquals( "Name",
 532+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[7]" ));
 533+ $this->assertEquals( "Options",
 534+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[8]" ));
 535+ $this->assertEquals( "Install",
 536+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[9]" ));
 537+ $this->assertEquals( "Complete!",
 538+ $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[10]/span" ));
522539 }
523540 }
Index: trunk/phase3/tests/installer/MediaWikiDifferntDatabasePrefixTestCase.php
@@ -27,7 +27,7 @@
2828 *
2929 */
3030
31 -require_once 'MediaWikiInstallationCommonFunction.php';
 31+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3232
3333 /*
3434 * Test Case ID : 02 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -38,16 +38,16 @@
3939
4040 class MediaWikiDifferntDatabasePrefixTestCase extends MediaWikiInstallationCommonFunction {
4141
42 - function setUp(){
 42+ function setUp() {
4343 parent::setUp();
4444 }
4545
4646 // Install Mediawiki using 'MySQL' database type.
47 - public function testDifferentDatabasePrefix(){
 47+ public function testDifferentDatabasePrefix() {
4848
4949 $databaseName = DB_NAME_PREFIX."_db_prefix";
5050 parent::navigateInstallPage( $databaseName );
51 -
 51+
5252 // To 'Options' page
5353 parent::clickBackButton();
5454
@@ -84,9 +84,11 @@
8585 // Verify already installed warning message
8686 $this->assertEquals( "Install",
8787 $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
88 - $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.",
 88+ $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
8989 $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]" ));
 90+
9091 parent::clickContinueButton();
 92+ parent::completePageSuccessfull();
9193 $this->chooseCancelOnNextConfirmation();
9294 parent::restartInstallation();
9395 }
Index: trunk/phase3/tests/installer/MediaWikiRestartInstallationTestCase.php
@@ -29,7 +29,7 @@
3030
3131
3232
33 -require_once 'MediaWikiInstallationCommonFunction.php';
 33+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3434
3535 /*
3636 * Test Case ID : 11, 12 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -82,7 +82,7 @@
8383
8484
8585 // Verify cancelling restart
86 - public function testCancelRestartInstallation(){
 86+ public function testCancelRestartInstallation() {
8787
8888 $dbNameBeforeRestart = DB_NAME_PREFIX."_cancel_restart";
8989
@@ -103,7 +103,8 @@
104104 parent::clickBackButton();
105105
106106 // Navigates to the previous page
107 - $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));;
 107+ $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 108+ ;
108109
109110 // 'Connect to database' page
110111 parent::clickBackButton();
Index: trunk/phase3/tests/installer/MediaWikiDifferentDatabaseAccountTestCase.php
@@ -28,7 +28,7 @@
2929 */
3030
3131
32 -require_once 'MediaWikiInstallationCommonFunction.php';
 32+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php');
3333
3434 /*
3535 * Test Case ID : 04 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
@@ -38,13 +38,13 @@
3939
4040 class MediaWikiDifferentDatabaseAccountTestCase extends MediaWikiInstallationCommonFunction {
4141
42 - function setUp(){
 42+ function setUp() {
4343 parent::setUp();
4444 }
4545
4646
4747 // Install Mediawiki using 'MySQL' database type.
48 - public function testDifferentDatabaseAccount(){
 48+ public function testDifferentDatabaseAccount() {
4949
5050 $databaseName = DB_NAME_PREFIX."_dif_accounts";
5151
@@ -71,14 +71,12 @@
7272 parent::clickContinueButton();
7373
7474 // 'Install' page
75 - $this->assertEquals( "Creating database user... done",
76 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" ));
 75+ $this->assertEquals("Creating database user... done",
 76+ $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/ul/li[3]"));
7777 parent::clickContinueButton();
7878
7979 // 'Complete' page
80 - $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
81 - $this->assertEquals( "Congratulations!",
82 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
 80+ parent::completePageSuccessfull();
8381 $this->chooseCancelOnNextConfirmation();
8482 }
8583 }

Comments

#Comment by Nikerabbit (talk | contribs)   13:08, 23 December 2010

+require_once( str_replace('//','/',dirname(__FILE__).'/') .'MediaWikiInstallationCommonFunction.php'); I don't understand what this code is trying to achieve.

#Comment by Zakgreant (talk | contribs)   16:56, 23 December 2010

Selectors like //div[@id='bodyContent']/div/div/div[2]/div[2] tend to be fragile. Can we use an id closer to the div (or put an id on the elements for the error messages?)

Status & tagging log