r79242 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79241‎ | r79242 | r79243 >
Date:09:10, 30 December 2010
Author:nadeesha
Status:deferred
Tags:
Comment:
Replace the common xpaths with the 'LINK_DIV', 'LINK_FORM', 'LINK_RIGHT_FRAMEWORK' variables
Modified paths:
  • /trunk/phase3/tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiHelpFieldHintTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiRestartInstallationTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiUpgradeExistingDatabaseTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/installer/MediaWikiUserInterfaceTestCase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/selenium/installer/MediaWikiErrorsNamepageTestCase.php
@@ -51,11 +51,11 @@
5252 // Verify warning message for all blank fields
5353 parent::clickContinueButton();
5454 $this->assertEquals( "Enter a site name.",
55 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 55+ $this->getText( LINK_DIV."div[2]/div[2]" ));
5656 $this->assertEquals( "Enter an administrator username.",
57 - $this->getText( "//div[@id='bodyContent']/div/div/div[3]/div[2]" ));
 57+ $this->getText( LINK_DIV."div[3]/div[2]" ));
5858 $this->assertEquals( "Enter a password for the administrator account.",
59 - $this->getText( "//div[@id='bodyContent']/div/div/div[4]/div[2]" ));
 59+ $this->getText( LINK_DIV."div[4]/div[2]" ));
6060
6161 // Verify warning message for the blank 'Site name'
6262 $this->type( "config__AdminName", VALID_YOUR_NAME );
@@ -63,7 +63,7 @@
6464 $this->type( "config__AdminPassword2", VALID_PASSWORD_AGAIN );
6565 parent::clickContinueButton();
6666 $this->assertEquals( "Enter a site name.",
67 - $this->getText(" //div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 67+ $this->getText( LINK_DIV."div[2]/div[2]" ));
6868
6969 // Input valid 'Site name'
7070 $this->type( "config_wgSitename", VALID_WIKI_NAME );
@@ -74,7 +74,7 @@
7575 $this->type( "config_wgMetaNamespace", INVALID_NAMESPACE );
7676 parent::clickContinueButton();
7777 $this->assertEquals( "The specified namespace \"\" is invalid. Specify a different project namespace.",
78 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 78+ $this->getText( LINK_DIV."div[2]/div[2]" ));
7979
8080
8181 // Verify warning message for the blank 'Project namespace'
@@ -83,7 +83,7 @@
8484 $this->type( "config_wgMetaNamespace" , "" );
8585 parent::clickContinueButton();
8686 $this->assertEquals( "The specified namespace \"\" is invalid. Specify a different project namespace.",
87 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 87+ $this->getText( LINK_DIV."div[2]/div[2]" ));
8888
8989
9090 // Valid 'Project namespace'
@@ -101,7 +101,7 @@
102102 $this->type( "config__AdminName", " " );
103103 parent::clickContinueButton();
104104 $this->assertEquals( "Enter an administrator username.",
105 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 105+ $this->getText( LINK_DIV."div[2]/div[2]" ));
106106
107107 $this->type( "config_wgSitename", VALID_WIKI_NAME );
108108 // Verify warning message for blank 'Password'
@@ -109,7 +109,7 @@
110110 $this->type( "config__AdminPassword", " " );
111111 parent::clickContinueButton();
112112 $this->assertEquals( "Enter a password for the administrator account.",
113 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 113+ $this->getText( LINK_DIV."div[2]/div[2]" ));
114114
115115
116116 // Verify warning message for the blank 'Password again'
@@ -118,7 +118,7 @@
119119 $this->type( "config__AdminPassword2", " " );
120120 parent::clickContinueButton();
121121 $this->assertEquals( "The two passwords you entered do not match.",
122 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 122+ $this->getText( LINK_DIV."div[2]/div[2]" ));
123123
124124
125125 // Verify warning message for the different'Password' and 'Password again'
@@ -127,6 +127,6 @@
128128 $this->type( "config__AdminPassword2", INVALID_PASSWORD_AGAIN );
129129 parent::clickContinueButton();
130130 $this->assertEquals( "The two passwords you entered do not match.",
131 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 131+ $this->getText( LINK_DIV."div[2]/div[2]" ));
132132 }
133133 }
Index: trunk/phase3/tests/selenium/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php
@@ -51,14 +51,14 @@
5252 $this->type( "mysql_wgDBserver", INVALID_DB_HOST );
5353 parent::clickContinueButton();
5454 $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]" ));
 55+ $this->getText( LINK_DIV."div[2]/div[2]/p[1]" ));
5656 $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]" ));
 57+ $this->getText( LINK_DIV."div[2]/div[2]/p[2]" ));
5858 // Verify warning message for the blank database host
5959 $this->type( "mysql_wgDBserver", "" );
6060 parent::clickContinueButton();
6161 $this->assertEquals( "MySQL 4.0.14 or later is required, you have .",
62 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 62+ $this->getText( LINK_DIV."div[2]/div[2]" ));
6363
6464 // Valid Database Host
6565 $this->type( "mysql_wgDBserver", VALID_DB_HOST );
@@ -67,13 +67,13 @@
6868 $this->type( "mysql_wgDBname", INVALID_DB_NAME );
6969 parent::clickContinueButton();
7070 $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" ));
 71+ $this->getText( LINK_DIV."div[2]/div[2]/p" ));
7272
7373 // Verify warning message for the blank database name
7474 $this->type( "mysql_wgDBname", "");
7575 parent::clickContinueButton();
7676 $this->assertEquals( "You must enter a value for \"Database name\"",
77 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 77+ $this->getText( LINK_DIV."div[2]/div[2]" ));
7878
7979 // valid Database name
8080 $this->type( "mysql_wgDBname", VALID_DB_NAME);
@@ -82,7 +82,7 @@
8383 $this->type( "mysql_wgDBprefix", INVALID_DB_PREFIX );
8484 parent::clickContinueButton();
8585 $this->assertEquals( "Invalid database prefix \"".INVALID_DB_PREFIX."\". Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).",
86 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
 86+ $this->getText( LINK_DIV."div[2]/div[2]" ));
8787
8888 // Valid Database prefix
8989 $this->type( "mysql_wgDBprefix", VALID_DB_PREFIX );
@@ -91,17 +91,17 @@
9292 $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME );
9393 parent::clickContinueButton();
9494 $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]" ));
 95+ $this->getText( LINK_DIV."div[2]/div[2]/p[1]" ));
9696 $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]"));
 97+ $this->getText( LINK_DIV."div[2]/div[2]/p[2]"));
9898
9999 // Verify warning message for the blank database user name
100100 $this->type( "mysql__InstallUser", "" );
101101 parent::clickContinueButton();
102102 $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]" ));
 103+ $this->getText( LINK_DIV."div[2]/div[2]/p[1]" ));
104104 $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]" ));
 105+ $this->getText( LINK_DIV."div[2]/div[2]/p[2]" ));
106106
107107 // Valid Database username
108108 $this->type( "mysql__InstallUser", VALID_DB_USER_NAME );
@@ -111,18 +111,18 @@
112112 parent::clickContinueButton();
113113
114114 $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]" ));
 115+ $this->getText( LINK_DIV."div[2]/div[2]/p[1]" ));
116116 $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]" ));
 117+ $this->getText( LINK_DIV."div[2]/div[2]/p[2]" ));
118118
119119 // Verify warning message for the invalid username and password
120120 $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME );
121121 $this->type( "mysql__InstallPassword", INVALID_DB_PASSWORD );
122122 parent::clickContinueButton();
123123 $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]" ));
 124+ $this->getText( LINK_DIV."div[2]/div[2]/p[1]" ));
125125 $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]" ));
 126+ $this->getText( LINK_DIV."div[2]/div[2]/p[2]" ));
127127
128128 // Valid username and valid password
129129 $this->type( "mysql__InstallUser", VALID_DB_USER_NAME );
@@ -131,6 +131,6 @@
132132
133133 // successfully completes the 'Connect to database' page
134134 $this->assertEquals( "Database settings",
135 - $this->getText("//div[@id='bodyContent']/div/div/h2" ));
 135+ $this->getText( LINK_DIV."h2" ));
136136 }
137137 }
Index: trunk/phase3/tests/selenium/installer/MediaWikiOnAlreadyInstalledTestCase.php
@@ -56,11 +56,11 @@
5757 parent::clickContinueButton();
5858
5959 // 'Install' page should display after the 'Option' page
60 - $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 60+ $this->assertEquals( "Install", $this->getText( LINK_DIV."h2" ));
6161
6262 // Verify warning text displayed
6363 $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
64 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
 64+ $this->getText( LINK_FORM."div[1]/div[2]" ));
6565
6666 // Complete page
6767 parent::clickContinueButton();
Index: trunk/phase3/tests/selenium/installer/MediaWikiHelpFieldHintTestCase.php
@@ -97,14 +97,14 @@
9898 parent::navigateDatabaseSettingsPage($databaseName);
9999
100100 // Verify help field for 'Search engine'
101 - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/span[1]" );
 101+ $this->click( LINK_FORM."div[2]/span[1]" );
102102 $this->assertEquals( SEARCH_ENGINE_HELP,
103 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/span[2]" ));
 103+ $this->getText( LINK_FORM."div[2]/span[2]" ));
104104
105105 // Verify help field for 'Database character set'
106 - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[4]/span[1]" );
 106+ $this->click( LINK_FORM."div[4]/span[1]" );
107107 $this->assertEquals( DATABASE_CHARACTER_SET_HELP,
108 - $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[4]/span[2]"));
 108+ $this->getText( LINK_FORM."div[4]/span[2]"));
109109 parent::restartInstallation();
110110 }
111111
@@ -115,29 +115,29 @@
116116 parent::navigateNamePage( $databaseName );
117117
118118 // Verify help field for 'Name of Wiki'
119 - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/div/span[1]" );
 119+ $this->click( LINK_FORM."div[1]/div[1]/div/span[1]" );
120120 $this->assertEquals( NAME_OF_WIKI_HELP,
121 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/div/span[2]/p" ));
 121+ $this->getText( LINK_FORM."div[1]/div[1]/div/span[2]/p" ));
122122
123123 // Verify help field for 'Project namespace'
124 - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/div/span[1]" );
 124+ $this->click( LINK_FORM."div[2]/div[1]/div/span[1]" );
125125 $this->assertEquals( PROJECT_NAMESPACE_HELP,
126 - $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/div/span[2]/p"));
 126+ $this->getText( LINK_FORM."div[2]/div[1]/div/span[2]/p"));
127127
128128 // Verify help field for 'Your Name'
129 - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/div/span[1]" );
 129+ $this->click( LINK_FORM."fieldset/div[1]/div[1]/div/span[1]" );
130130 $this->assertEquals( USER_NAME_HELP,
131 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/div/span[2]/p" ));
 131+ $this->getText( LINK_FORM."fieldset/div[1]/div[1]/div/span[2]/p" ));
132132
133133 // Verify help field for 'E mail address'
134 - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/div/span[1]" );
 134+ $this->click( LINK_FORM."fieldset/div[4]/div[1]/div/span[1]" );
135135 $this->assertEquals( EMAIL_ADDRESS_HELP,
136 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/div/span[2]/p" ));
 136+ $this->getText( LINK_FORM."fieldset/div[4]/div[1]/div/span[2]/p" ));
137137
138138 // Verify help field for 'Subscribe to the release announcements mailing list'
139 - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/div/span[1]" );
 139+ $this->click( LINK_FORM."fieldset/div[5]/div/span[1]" );
140140 $this->assertEquals( SUBSCRIBE_MAILING_LIST_HELP,
141 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/div/span[2]/p" ));
 141+ $this->getText( LINK_FORM."fieldset/div[5]/div/span[2]/p" ));
142142 parent::restartInstallation();
143143 }
144144 }
Index: trunk/phase3/tests/selenium/installer/MediaWikiUpgradeExistingDatabaseTestCase.php
@@ -50,9 +50,9 @@
5151 parent::navigateInstallPage( $databaseName );
5252
5353 $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
54 - $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 54+ $this->assertEquals( "Install", $this->getText( LINK_DIV."h2" ));
5555 $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
56 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
 56+ $this->getText( LINK_DIV."div[2]/form/div[1]/div[2]" ));
5757
5858 // 'Optionis' page
5959 parent::clickBackButton();
@@ -69,27 +69,27 @@
7070 parent::clickContinueButton();
7171
7272 // 'Upgrade existing installation' page displayed next to the 'Connect to database' page.
73 - $this->assertEquals( "Upgrade existing installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 73+ $this->assertEquals( "Upgrade existing installation", $this->getText( LINK_DIV."h2" ));
7474
7575 // Warning message displayed.
7676 $this->assertEquals( "There are MediaWiki tables in this database. To upgrade them to MediaWiki 1.18alpha, click Continue.",
77 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
 77+ $this->getText( LINK_DIV."div[2]/form/div[1]/div[2]" ));
7878
7979 parent::clickContinueButton();
8080 $this->assertEquals( "Upgrade existing installation",
81 - $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 81+ $this->getText( LINK_DIV."h2" ));
8282
8383 // 'Upgrade complete.' text display
8484 $this->assertEquals("Upgrade complete.",
85 - $this->getText("//div[@id='bodyContent']/div/div/div[4]/form/div[1]/div[2]/p[1]"));
 85+ $this->getText( LINK_FORM."div[1]/div[2]/p[1]"));
8686 $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]"));
 87+ $this->getText( LINK_FORM."div[1]/div[2]/p[2]"));
8888
8989 $this->assertTrue($this->isElementPresent( "submit-regenerate" ));
9090 $this->click( "submit-regenerate" );
9191 $this->waitForPageToLoad( PAGE_LOAD_TIME );
9292 $this->assertEquals( "Database settings",
93 - $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 93+ $this->getText( LINK_DIV."h2" ));
9494
9595 // 'Database settings' page
9696 parent::clickContinueButton();
@@ -102,7 +102,7 @@
103103
104104 // Install page
105105 $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
106 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
 106+ $this->getText( LINK_FORM."div[1]/div[2]" ));
107107 parent::clickContinueButton();
108108
109109 // complete
Index: trunk/phase3/tests/selenium/installer/MediaWikiRightFrameworkLinksTestCase.php
@@ -67,27 +67,27 @@
6868 // Navigate to the 'Read me' page
6969 $this->click( "link=Read me" );
7070 $this->waitForPageToLoad( PAGE_LOAD_TIME );
71 - $this->assertEquals( "Read me", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" ));
 71+ $this->assertEquals( "Read me", $this->getText( LINK_DIV."h2[1]" ));
7272 $this->assertTrue($this->isElementPresent( "submit-back" ));
7373 parent::clickBackButton();
7474
7575 // Navigate to the 'Release notes' page
7676 $this->click( "link=Release notes" );
7777 $this->waitForPageToLoad( PAGE_LOAD_TIME);
78 - $this->assertEquals( "Release notes", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" ));
 78+ $this->assertEquals( "Release notes", $this->getText( LINK_DIV."h2[1]" ));
7979 $this->assertTrue( $this->isElementPresent( "submit-back" ));
8080 parent::clickBackButton();
8181
8282 // Navigate to the 'Copying' page
8383 $this->click( "link=Copying" );
8484 $this->waitForPageToLoad( PAGE_LOAD_TIME );
85 - $this->assertEquals( "Copying", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" ));
 85+ $this->assertEquals( "Copying", $this->getText( LINK_DIV."h2[1]" ));
8686 $this->assertTrue($this->isElementPresent( "submit-back" ));
8787 parent::clickBackButton();
8888
8989 // Navigate to the 'Upgrading' page
9090 $this->click( "link=Upgrading" );
9191 $this->waitForPageToLoad( PAGE_LOAD_TIME );
92 - $this->assertEquals( "Upgrading", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" ));
 92+ $this->assertEquals( "Upgrading", $this->getText( LINK_DIV."h2[1]" ));
9393 }
9494 }
Index: trunk/phase3/tests/selenium/installer/MediaWikiUserInterfaceTestCase.php
@@ -70,18 +70,18 @@
7171 parent::navigateLanguagePage();
7272
7373 // Verify 'Language' heading
74 - $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 74+ $this->assertEquals( "Language", $this->getText( LINK_DIV."h2" ));
7575
7676 // 'Your language' label available
7777 $this->assertEquals( "Your language:",
78 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label" ));
 78+ $this->getText( LINK_FORM."div[1]/div[1]/label" ));
7979
8080 // 'Your language' dropdown available
8181 $this->assertTrue( $this->isElementPresent( "UserLang" ));
8282
8383 // 'Wiki language' label available
8484 $this->assertEquals( "Wiki language:",
85 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/label" ));
 85+ $this->getText( LINK_FORM."div[2]/div[1]/label" ));
8686
8787 // 'Wiki language' dropdown available
8888 $this->assertTrue($this->isElementPresent( "ContLang" ));
@@ -94,11 +94,11 @@
9595
9696 // Verify 'Welcome to MediaWiki!' heading
9797 $this->assertEquals( "Welcome to MediaWiki!",
98 - $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 98+ $this->getText( LINK_DIV."h2" ));
9999
100100 // Verify environment ok text displayed.
101101 $this->assertEquals( "The environment has been checked.You can install MediaWiki.",
102 - $this->getText( "//div[@id='bodyContent']/div/div/div[7]/span" ));
 102+ $this->getText( LINK_DIV."div[7]/span" ));
103103 }
104104
105105
@@ -108,12 +108,12 @@
109109
110110 // 'MYSQL radio button available
111111 $this->assertEquals( "MySQL",
112 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]/label" ));
113 - $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]" ));
 112+ $this->getText( LINK_FORM."div[2]/div[2]/ul/li[1]/label" ));
 113+ $this->assertTrue( $this->isElementPresent( LINK_FORM."div[2]/div[2]/ul/li[1]" ));
114114
115115 // 'SQLite' radio button available
116 - $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]" ));
117 - $this->assertEquals( "SQLite", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]/label "));
 116+ $this->assertTrue( $this->isElementPresent( LINK_FORM."div[2]/div[2]/ul/li[2]" ));
 117+ $this->assertEquals( "SQLite", $this->getText( LINK_FORM."div[2]/div[2]/ul/li[2]/label "));
118118
119119 // 'Database host' label available
120120 $this->assertEquals( "Database host:", $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/label" ));
@@ -164,16 +164,16 @@
165165 parent::navigateDatabaseSettingsPage( $databaseName );
166166
167167 // 'Database settings' text available.
168 - $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 168+ $this->assertEquals( "Database settings", $this->getText( LINK_DIV."h2" ));
169169
170170 // 'Database account for web access' section available
171 - $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset" ));
 171+ $this->assertTrue( $this->isElementPresent( LINK_FORM."fieldset" ));
172172
173173 // 'Database account for web access' label available
174 - $this->assertEquals( "Database account for web access", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/legend" ));
 174+ $this->assertEquals( "Database account for web access", $this->getText( LINK_FORM."fieldset/legend" ));
175175
176176 // 'Use the same account as for installation' check box available
177 - $this->assertEquals( "Use the same account as for installation", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/label" ));
 177+ $this->assertEquals( "Use the same account as for installation", $this->getText( LINK_FORM."fieldset/div[1]/label" ));
178178
179179 // 'Use the same account as for installation' check box is selected by default
180180 $this->assertEquals( "on", $this->getValue( "mysql__SameAccount" ));
@@ -209,41 +209,43 @@
210210
211211 // 'Storage engine' label available
212212 $this->assertEquals( "Storage engine:",
213 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label"));
 213+ $this->getText( LINK_FORM."div[1]/div[1]/label"));
214214
215215 // 'InnoDB' label available
216216 $this->assertEquals( "InnoDB",
217 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/ul/li[1]/label" ));
 217+ $this->getText( LINK_FORM."div[1]/div[2]/ul/li[1]/label" ));
218218
219219 // 'InnoDB' radio button available
220220 $this->assertTrue( $this->isElementPresent( "mysql__MysqlEngine_InnoDB" ));
221221
222222 // 'MyISAM' label available
223 - $this->assertEquals( "MyISAM", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/ul/li[2]/label" ));
 223+ $this->assertEquals( "MyISAM", $this->getText( LINK_FORM."div[1]/div[2]/ul/li[2]/label" ));
224224
225225 // 'MyISAM' radio button available
226226 $this->assertTrue($this->isElementPresent( "mysql__MysqlEngine_MyISAM" ));
227227
228228 // 'Database character set' label available
229229 $this->assertEquals( "Database character set:",
230 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[1]/label" ));
 230+ $this->getText( LINK_FORM."div[3]/div[1]/label" ));
231231
232232 // 'Binary' radio button available
233233 $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_binary" ));
234234
235235 // 'Binary' radio button available
236 - $this->assertEquals( "Binary", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[2]/ul/li[1]/label" ));
 236+ $this->assertEquals( "Binary", $this->getText( LINK_FORM."div[3]/div[2]/ul/li[1]/label" ));
237237
238238 // 'UTF-8' radio button available
239239 $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_utf8" ));
240240
241241 // 'UTF-8' label available
242 - $this->assertEquals( "UTF-8", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[2]/ul/li[2]/label" ));
 242+ $this->assertEquals( "UTF-8", $this->getText( LINK_FORM."div[3]/div[2]/ul/li[2]/label" ));
243243
244244 // 'Binary' radio button is selected
245245 $this->assertEquals( "on", $this->getValue( "mysql__MysqlCharset_binary" ));
246246 }
247247
 248+
 249+
248250 public function testNamePageUI() {
249251
250252 $databaseName = DB_NAME_PREFIX."_name_UI";
@@ -251,13 +253,13 @@
252254
253255 // 'Name of wiki' text box available
254256 $this->assertEquals( "Name of wiki:",
255 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label" ));
 257+ $this->getText( LINK_FORM."div[1]/div[1]/label" ));
256258
257259 $this->assertTrue( $this->isElementPresent( "config_wgSitename" ));
258260
259261 // 'Project namespace' label available
260262 $this->assertEquals( "Project namespace:",
261 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/label" ));
 263+ $this->getText( LINK_FORM."div[2]/div[1]/label" ));
262264
263265 // 'Same as the wiki name' radio button available
264266 $this->assertTrue( $this->isElementPresent( "config__NamespaceType_site-name" ));
@@ -270,50 +272,50 @@
271273
272274 // 'Same as the wiki name' label available
273275 $this->assertEquals( "Same as the wiki name:",
274 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]/label" ));
 276+ $this->getText( LINK_FORM."div[2]/div[2]/ul/li[1]/label" ));
275277
276278 // 'Project' label available
277279 $this->assertEquals("Project",
278 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]/label" ));
 280+ $this->getText( LINK_FORM."div[2]/div[2]/ul/li[2]/label" ));
279281
280282 // 'Project' label available
281283 $this->assertEquals( "Other (specify)",
282 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[3]/label" ));
 284+ $this->getText( LINK_FORM."div[2]/div[2]/ul/li[3]/label" ));
283285
284286 // 'Same as the wiki name' radio button selected by default
285287 $this->assertEquals( "on", $this->getValue( "config__NamespaceType_site-name" ));
286288
287289 // 'Administrator account' section available
288 - $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset" ));
 290+ $this->assertTrue( $this->isElementPresent( LINK_FORM."fieldset" ));
289291
290292 // 'Administrator account' label available
291293 $this->assertEquals( "Administrator account",
292 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/legend" ));
 294+ $this->getText( LINK_FORM."fieldset/legend" ));
293295
294296 // 'Your Name' label available
295297 $this->assertEquals( "Your name:",
296 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/label" ));
 298+ $this->getText( LINK_FORM."fieldset/div[1]/div[1]/label" ));
297299
298300 // 'Your Name' text box available
299301 $this->assertTrue( $this->isElementPresent( "config__AdminName" ));
300302
301303 // 'Password' label available
302304 $this->assertEquals( "Password:",
303 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[2]/div[1]/label" ));
 305+ $this->getText( LINK_FORM."fieldset/div[2]/div[1]/label" ));
304306
305307 // 'Password' text box available
306308 $this->assertTrue( $this->isElementPresent( "config__AdminPassword" ));
307309
308310 // 'Password again' label available
309311 $this->assertEquals( "Password again:",
310 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[3]/div[1]/label" ));
 312+ $this->getText( LINK_FORM."fieldset/div[3]/div[1]/label" ));
311313
312314 // 'Password again' text box available
313315 $this->assertTrue( $this->isElementPresent( "config__AdminPassword2" ));
314316
315317 // 'Email address' label avaialble
316318 $this->assertEquals( "E-mail address:",
317 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/label" ));
 319+ $this->getText( LINK_FORM."fieldset/div[4]/div[1]/label" ));
318320
319321 // 'Email address' text box available
320322 $this->assertTrue( $this->isElementPresent( "config__AdminEmail" ));
@@ -323,28 +325,28 @@
324326
325327 // 'Subscribe to the release announcements mailing list. ' label avaialble
326328 $this->assertEquals( "Subscribe to the release announcements mailing list.",
327 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/label" ));
 329+ $this->getText( LINK_FORM."fieldset/div[5]/label" ));
328330
329331 // 'release announcements mailing list' link available
330332 $this->assertTrue( $this->isElementPresent( "link=release announcements mailing list" ));
331333
332334 // Message displayed
333335 $this->assertEquals( "You are almost done! You can now skip the remaining configuration and install the wiki right now.",
334 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[4]/div[2]" ));
 336+ $this->getText( LINK_FORM."/div[4]/div[2]" ));
335337
336338 // 'Ask me more questions.' radio button available
337339 $this->assertTrue( $this->isElementPresent( "config__SkipOptional_continue" ));
338340
339341 // 'Ask me more questions.' label available
340342 $this->assertEquals( "Ask me more questions.",
341 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[5]/div[2]/ul/li[1]/label" ));
 343+ $this->getText( LINK_FORM."div[5]/div[2]/ul/li[1]/label" ));
342344
343345 // 'I'm bored already, just install the wiki' radio button is avaiable
344346 $this->assertTrue( $this->isElementPresent( "config__SkipOptional_skip" ));
345347
346348 // 'I'm bored already, just install the wiki' label available
347349 $this->assertEquals( "I'm bored already, just install the wiki.",
348 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[5]/div[2]/ul/li[2]/label" ));
 350+ $this->getText( LINK_FORM."div[5]/div[2]/ul/li[2]/label" ));
349351
350352 // 'Ask me more questions.' radio button is default selected
351353 $this->assertEquals( "on", $this->getValue( "config__SkipOptional_continue" ));
@@ -358,7 +360,7 @@
359361 parent::navigateOptionsPage($databaseName);
360362
361363 // 'Options' label available
362 - $this->assertEquals( "Options", $this->getText("//div[@id='bodyContent']/div/div/h2"));
 364+ $this->assertEquals( "Options", $this->getText( LINK_DIV."h2"));
363365
364366 // 'Return e-mail address' label available
365367 $this->assertEquals( "Return e-mail address:", $this->getText( "//div[@id='emailwrapper']/div[1]/div[1]/label" ));
@@ -370,7 +372,7 @@
371373 $this->assertEquals( "apache@localhost", $this->getValue( "config_wgPasswordSender" ));
372374
373375 // 'Logo URL' label available
374 - $this->assertEquals( "Logo URL:", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset[2]/div[3]/div[1]/label" ));
 376+ $this->assertEquals( "Logo URL:", $this->getText( LINK_FORM."fieldset[2]/div[3]/div[1]/label" ));
375377
376378 // 'Logo URL' text box available
377379 $this->assertTrue( $this->isElementPresent( "config_wgLogo" ));
@@ -383,7 +385,7 @@
384386
385387 // 'Enable file uploads' label available
386388 $this->assertEquals( "Enable file uploads",
387 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset[2]/div[1]/label" ));
 389+ $this->getText( LINK_FORM."fieldset[2]/div[1]/label" ));
388390
389391 // 'Enable file uploads' check box is not selected
390392 $this->assertEquals( "off", $this->getValue( "config_wgEnableUploads" ));
@@ -411,21 +413,21 @@
412414
413415 // Verify installation done messages display
414416 $this->assertEquals( "Setting up database... done",
415 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[1]" ));
 417+ $this->getText( LINK_FORM."ul/li[1]" ));
416418 $this->assertEquals( "Creating tables... done",
417 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" ));
 419+ $this->getText( LINK_FORM."ul/li[2]" ));
418420 $this->assertEquals( "Creating database user... done",
419 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[3]" ));
 421+ $this->getText( LINK_FORM."ul/li[3]" ));
420422 $this->assertEquals( "Populating default interwiki table... done",
421 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[4]" ));
 423+ $this->getText( LINK_FORM."ul/li[4]" ));
422424 $this->assertEquals( "Generating secret key... done",
423 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[5]" ));
 425+ $this->getText( LINK_FORM."ul/li[5]" ));
424426 $this->assertEquals( "Generating default upgrade key... done",
425 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[6]" ));
 427+ $this->getText( LINK_FORM."ul/li[6]" ));
426428 $this->assertEquals( "Creating administrator user account... done",
427 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[7]" ));
 429+ $this->getText( LINK_FORM."ul/li[7]" ));
428430 $this->assertEquals( "Creating main page with default content... done",
429 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[8]" ));
 431+ $this->getText( LINK_FORM."ul/li[8]" ));
430432 }
431433
432434
@@ -437,10 +439,10 @@
438440
439441 // 'Congratulations!' text display
440442 $this->assertEquals("Congratulations!",
441 - $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/p[1]/b"));
 443+ $this->getText( LINK_FORM."div[1]/div[2]/p[1]/b"));
442444 // 'LocalSettings.php' generated message display
443445 $this->assertEquals( "The installer has generated a LocalSettings.php file. It contains all your configuration.",
444 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/p[2]" ));
 446+ $this->getText( LINK_FORM."div[1]/div[2]/p[2]" ));
445447
446448 // 'Download LocalSettings.php'' link available
447449 $this->assertTrue( $this->isElementPresent( "link=Download LocalSettings.php" ));
@@ -458,7 +460,7 @@
459461 $this->waitForPageToLoad( PAGE_LOAD_TIME );
460462
461463 // Restart installation' label should be available.
462 - $this->assertEquals( "Restart installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 464+ $this->assertEquals( "Restart installation", $this->getText( LINK_DIV."h2" ));
463465
464466 //'Do you want to clear all saved data that you have entered and restart the installation process?' label available
465467 $this->assertEquals( "Do you want to clear all saved data that you have entered and restart the installation process?",
@@ -516,24 +518,24 @@
517519 parent::navigateLanguagePage();
518520 // Verfy right framework texts display
519521 $this->assertEquals( "Language",
520 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[1]" ));
 522+ $this->getText( LINK_RIGHT_FRAMEWORK."li[1]" ));
521523 $this->assertEquals( "Existing wiki",
522 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[2]" ));
 524+ $this->getText( LINK_RIGHT_FRAMEWORK."li[2]" ));
523525 $this->assertEquals( "Welcome to MediaWiki!",
524 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[3]" ));
 526+ $this->getText( LINK_RIGHT_FRAMEWORK."li[3]" ));
525527 $this->assertEquals( "Connect to database",
526 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[4]" ));
 528+ $this->getText( LINK_RIGHT_FRAMEWORK."li[4]" ));
527529 $this->assertEquals( "Upgrade existing installation",
528 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[5]" ));
 530+ $this->getText( LINK_RIGHT_FRAMEWORK."li[5]" ));
529531 $this->assertEquals( "Database settings",
530 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[6]" ));
 532+ $this->getText( LINK_RIGHT_FRAMEWORK."li[6]" ));
531533 $this->assertEquals( "Name",
532 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[7]" ));
 534+ $this->getText( LINK_RIGHT_FRAMEWORK."li[7]" ));
533535 $this->assertEquals( "Options",
534 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[8]" ));
 536+ $this->getText( LINK_RIGHT_FRAMEWORK."li[8]" ));
535537 $this->assertEquals( "Install",
536 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[9]" ));
 538+ $this->getText( LINK_RIGHT_FRAMEWORK."li[9]" ));
537539 $this->assertEquals( "Complete!",
538 - $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[10]/span" ));
539 - }
 540+ $this->getText( LINK_RIGHT_FRAMEWORK."li[10]/span" ));
 541+ }
540542 }
Index: trunk/phase3/tests/selenium/installer/MediaWikiDifferntDatabasePrefixTestCase.php
@@ -65,7 +65,7 @@
6666
6767 // Verify upgrade existing message
6868 $this->assertEquals( "Upgrade existing installation",
69 - $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 69+ $this->getText( LINK_DIV."h2" ));
7070
7171 // To 'Connect to database' page
7272 parent::clickBackButton();
@@ -83,9 +83,9 @@
8484
8585 // Verify already installed warning message
8686 $this->assertEquals( "Install",
87 - $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 87+ $this->getText( LINK_DIV."h2" ));
8888 $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.",
89 - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]" ));
 89+ $this->getText( LINK_FORM."div[1]" ));
9090
9191 parent::clickContinueButton();
9292 parent::completePageSuccessfull();
Index: trunk/phase3/tests/selenium/installer/MediaWikiRestartInstallationTestCase.php
@@ -57,7 +57,7 @@
5858 $this->waitForPageToLoad( PAGE_LOAD_TIME );
5959
6060 // 'Restart Installation' page displayed
61 - $this->assertEquals( "Restart installation", $this->getText("//div[@id='bodyContent']/div/div/h2"));
 61+ $this->assertEquals( "Restart installation", $this->getText( LINK_DIV."h2"));
6262
6363 // Restart warning message displayed
6464 $this->assertTrue($this->isTextPresent( "exact:Do you want to clear all saved data that you have entered and restart the installation process?" ));
@@ -67,7 +67,7 @@
6868 $this->waitForPageToLoad( PAGE_LOAD_TIME );
6969
7070 // Navigate to the initial installation page(Language).
71 - $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 71+ $this->assertEquals( "Language", $this->getText( LINK_DIV."h2" ));
7272
7373 // 'Welcome to MediaWiki!' page
7474 parent::clickContinueButton();
@@ -94,7 +94,7 @@
9595 $this->waitForPageToLoad( PAGE_LOAD_TIME );
9696
9797 // 'Restart Installation' page displayed
98 - $this->assertEquals( "Restart installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
 98+ $this->assertEquals( "Restart installation", $this->getText( LINK_DIV."h2" ));
9999
100100 // Restart warning message displayed
101101 $this->assertTrue( $this->isTextPresent( "Do you want to clear all saved data that you have entered and restart the installation process?"));
@@ -103,7 +103,7 @@
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( LINK_DIV."h2" ));
108108 ;
109109
110110 // 'Connect to database' page
Index: trunk/phase3/tests/selenium/installer/MediaWikiDifferentDatabaseAccountTestCase.php
@@ -72,7 +72,7 @@
7373
7474 // 'Install' page
7575 $this->assertEquals("Creating database user... done",
76 - $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/ul/li[3]"));
 76+ $this->getText( LINK_FORM."ul/li[3]"));
7777 parent::clickContinueButton();
7878
7979 // 'Complete' page

Status & tagging log