From 920f5fc032e2e82e25dd8dfa2c02cfe8be7f2a1a Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 22 Dec 2010 11:16:24 +0000 Subject: [PATCH] Followup r78775, svn:eol-style native SET UP YOUR AUTOPROPS --- .../MediaWikiButtonsAvailabilityTestCase.php | 236 ++-- ...iaWikiDifferentDatabaseAccountTestCase.php | 168 +-- ...ediaWikiDifferntDatabasePrefixTestCase.php | 186 +-- ...ikiErrorsConnectToDatabasePageTestCase.php | 254 ++-- .../MediaWikiErrorsNamepageTestCase.php | 264 ++--- .../MediaWikiHelpFieldHintTestCase.php | 288 ++--- .../MediaWikiMySQLDataBaseTestCase.php | 166 +-- .../MediaWikiMySQLiteDataBaseTestCase.php | 168 +-- .../MediaWikiOnAlreadyInstalledTestCase.php | 148 +-- .../MediaWikiRestartInstallationTestCase.php | 230 ++-- .../MediaWikiRightFrameworkLinksTestCase.php | 186 +-- ...diaWikiUpgradeExistingDatabaseTestCase.php | 226 ++-- .../MediaWikiUserInterfaceTestCase.php | 1044 ++++++++--------- 13 files changed, 1782 insertions(+), 1782 deletions(-) diff --git a/tests/installer/MediaWikiButtonsAvailabilityTestCase.php b/tests/installer/MediaWikiButtonsAvailabilityTestCase.php index a68281279d..398d950acb 100644 --- a/tests/installer/MediaWikiButtonsAvailabilityTestCase.php +++ b/tests/installer/MediaWikiButtonsAvailabilityTestCase.php @@ -1,118 +1,118 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name :'Back' and 'Continue' button availability - * Version : MediaWiki 1.18alpha -*/ - -class MediaWikiButtonsAvailabilityTestCase extends MediaWikiInstallationCommonFunction { - - function setUp() { - parent::setUp(); - } - - - // Verify only 'Continue' button available on 'Language' page - public function testOnlyContinueButtonAvailability() { - - parent::navigateLanguagePage(); - - // Verify only 'Continue' button avaialble - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - - // 'Back' button is not avaialble - $this->assertElementNotPresent( "submit-back" ); - } - - - // Verify 'Continue' and 'Back' buttons availability - public function testBothButtonsAvailability() { - - // Verify buttons availability on 'Welcome to MediaWiki' page - parent::navigateWelcometoMediaWikiPage(); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Connect to Database' page - parent::navigateConnetToDatabasePage(); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Database settings' page - $databaseName = DB_NAME_PREFIX."_db_settings"; - parent::navigateDatabaseSettingsPage( $databaseName ); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Name' page - $databaseName = DB_NAME_PREFIX."_name"; - parent::navigateNamePage( $databaseName ); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Options' page - $databaseName = DB_NAME_PREFIX."_options"; - parent::navigateOptionsPage( $databaseName ); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - parent::restartInstallation(); - - // Verify buttons availability on 'Install' page - $databaseName = DB_NAME_PREFIX."_install"; - parent::navigateInstallPage($databaseName); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - $this->assertTrue( $this->isElementPresent( "submit-continue" )); - } - - - // Verify only 'Back' button available on 'Complete' page - public function testOnlyBackButtonAvailability() { - - // Verify only 'Back' button available - $databaseName = DB_NAME_PREFIX."_back"; - parent::navigateCompletePage( $databaseName ); - - // Only 'Back' button available - $this->assertTrue( $this->isElementPresent( "submit-back" )); - - // 'Continue' button is not available - $this->assertElementNotPresent( "submit-continue" ); - parent::restartInstallation(); - } -} - + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name :'Back' and 'Continue' button availability + * Version : MediaWiki 1.18alpha +*/ + +class MediaWikiButtonsAvailabilityTestCase extends MediaWikiInstallationCommonFunction { + + function setUp() { + parent::setUp(); + } + + + // Verify only 'Continue' button available on 'Language' page + public function testOnlyContinueButtonAvailability() { + + parent::navigateLanguagePage(); + + // Verify only 'Continue' button avaialble + $this->assertTrue( $this->isElementPresent( "submit-continue" )); + + // 'Back' button is not avaialble + $this->assertElementNotPresent( "submit-back" ); + } + + + // Verify 'Continue' and 'Back' buttons availability + public function testBothButtonsAvailability() { + + // Verify buttons availability on 'Welcome to MediaWiki' page + parent::navigateWelcometoMediaWikiPage(); + $this->assertTrue( $this->isElementPresent( "submit-back" )); + $this->assertTrue( $this->isElementPresent( "submit-continue" )); + parent::restartInstallation(); + + // Verify buttons availability on 'Connect to Database' page + parent::navigateConnetToDatabasePage(); + $this->assertTrue( $this->isElementPresent( "submit-back" )); + $this->assertTrue( $this->isElementPresent( "submit-continue" )); + parent::restartInstallation(); + + // Verify buttons availability on 'Database settings' page + $databaseName = DB_NAME_PREFIX."_db_settings"; + parent::navigateDatabaseSettingsPage( $databaseName ); + $this->assertTrue( $this->isElementPresent( "submit-back" )); + $this->assertTrue( $this->isElementPresent( "submit-continue" )); + parent::restartInstallation(); + + // Verify buttons availability on 'Name' page + $databaseName = DB_NAME_PREFIX."_name"; + parent::navigateNamePage( $databaseName ); + $this->assertTrue( $this->isElementPresent( "submit-back" )); + $this->assertTrue( $this->isElementPresent( "submit-continue" )); + parent::restartInstallation(); + + // Verify buttons availability on 'Options' page + $databaseName = DB_NAME_PREFIX."_options"; + parent::navigateOptionsPage( $databaseName ); + $this->assertTrue( $this->isElementPresent( "submit-back" )); + $this->assertTrue( $this->isElementPresent( "submit-continue" )); + parent::restartInstallation(); + + // Verify buttons availability on 'Install' page + $databaseName = DB_NAME_PREFIX."_install"; + parent::navigateInstallPage($databaseName); + $this->assertTrue( $this->isElementPresent( "submit-back" )); + $this->assertTrue( $this->isElementPresent( "submit-continue" )); + } + + + // Verify only 'Back' button available on 'Complete' page + public function testOnlyBackButtonAvailability() { + + // Verify only 'Back' button available + $databaseName = DB_NAME_PREFIX."_back"; + parent::navigateCompletePage( $databaseName ); + + // Only 'Back' button available + $this->assertTrue( $this->isElementPresent( "submit-back" )); + + // 'Continue' button is not available + $this->assertElementNotPresent( "submit-continue" ); + parent::restartInstallation(); + } +} + diff --git a/tests/installer/MediaWikiDifferentDatabaseAccountTestCase.php b/tests/installer/MediaWikiDifferentDatabaseAccountTestCase.php index bb6ab1cc2b..9a9e49bd53 100644 --- a/tests/installer/MediaWikiDifferentDatabaseAccountTestCase.php +++ b/tests/installer/MediaWikiDifferentDatabaseAccountTestCase.php @@ -1,84 +1,84 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 04 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Install MediaWiki with different Database accounts for web access. - * Version : MediaWiki 1.18alpha -*/ - -class MediaWikiDifferentDatabaseAccountTestCase extends MediaWikiInstallationCommonFunction { - - function setUp(){ - parent::setUp(); - } - - - // Install Mediawiki using 'MySQL' database type. - public function testDifferentDatabaseAccount(){ - - $databaseName = DB_NAME_PREFIX."_dif_accounts"; - - // Navigate to the 'Database settings' page - parent::navigateDatabaseSettingsPage( $databaseName ); - - // Click on the 'Use the same account as for installation' check box - $this->click( "mysql__SameAccount" ); - - // Change the 'Database username' - $this->type( "mysql_wgDBuser", DB_WEB_USER ); - - // Enter 'Database password:' - $this->type( "mysql_wgDBpassword", DB_WEB_USER_PASSWORD ); - - // Select 'Create the account if it does not already exist' check box - $this->click( "mysql__CreateDBAccount" ); - parent::clickContinueButton(); - - // 'Name' page - parent::completeNamePage(); - - // 'Options' page - parent::clickContinueButton(); - - // 'Install' page - $this->assertEquals( "Creating database user... done", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" )); - parent::clickContinueButton(); - - // 'Complete' page - $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - $this->assertEquals( "Congratulations!", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); - $this->chooseCancelOnNextConfirmation(); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 04 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Install MediaWiki with different Database accounts for web access. + * Version : MediaWiki 1.18alpha +*/ + +class MediaWikiDifferentDatabaseAccountTestCase extends MediaWikiInstallationCommonFunction { + + function setUp(){ + parent::setUp(); + } + + + // Install Mediawiki using 'MySQL' database type. + public function testDifferentDatabaseAccount(){ + + $databaseName = DB_NAME_PREFIX."_dif_accounts"; + + // Navigate to the 'Database settings' page + parent::navigateDatabaseSettingsPage( $databaseName ); + + // Click on the 'Use the same account as for installation' check box + $this->click( "mysql__SameAccount" ); + + // Change the 'Database username' + $this->type( "mysql_wgDBuser", DB_WEB_USER ); + + // Enter 'Database password:' + $this->type( "mysql_wgDBpassword", DB_WEB_USER_PASSWORD ); + + // Select 'Create the account if it does not already exist' check box + $this->click( "mysql__CreateDBAccount" ); + parent::clickContinueButton(); + + // 'Name' page + parent::completeNamePage(); + + // 'Options' page + parent::clickContinueButton(); + + // 'Install' page + $this->assertEquals( "Creating database user... done", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" )); + parent::clickContinueButton(); + + // 'Complete' page + $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + $this->assertEquals( "Congratulations!", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); + $this->chooseCancelOnNextConfirmation(); + } +} diff --git a/tests/installer/MediaWikiDifferntDatabasePrefixTestCase.php b/tests/installer/MediaWikiDifferntDatabasePrefixTestCase.php index 1f6c05167e..51fb1bba6e 100644 --- a/tests/installer/MediaWikiDifferntDatabasePrefixTestCase.php +++ b/tests/installer/MediaWikiDifferntDatabasePrefixTestCase.php @@ -1,93 +1,93 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 02 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Install MediaWiki with the same database and the different - * database prefixes(Share one database between multiple wikis). - * Version : MediaWiki 1.18alpha -*/ - -class MediaWikiDifferntDatabasePrefixTestCase extends MediaWikiInstallationCommonFunction { - - function setUp(){ - parent::setUp(); - } - - // Install Mediawiki using 'MySQL' database type. - public function testDifferentDatabasePrefix(){ - - $databaseName = DB_NAME_PREFIX."_db_prefix"; - parent::navigateInstallPage( $databaseName ); - - // To 'Options' page - parent::clickBackButton(); - - // To 'Name' page - parent::clickBackButton(); - - // To 'Database settings' page - parent::clickBackButton(); - - // To 'Connect to database' page - parent::clickBackButton(); - - // From 'Connect to database' page without database prefix - parent::clickContinueButton(); - - // Verify upgrade existing message - $this->assertEquals( "Upgrade existing installation", - $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // To 'Connect to database' page - parent::clickBackButton(); - - // Input the database prefix - $this->type( "mysql_wgDBprefix", DATABASE_PREFIX ); - - // From 'Connect to database' page with database prefix - parent::clickContinueButton(); - - // To 'Complete' page - parent::clickContinueButton(); - parent::completeNamePage(); - parent::clickContinueButton(); - - // Verify already installed warning message - $this->assertEquals( "Install", - $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]" )); - parent::clickContinueButton(); - $this->chooseCancelOnNextConfirmation(); - parent::restartInstallation(); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 02 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Install MediaWiki with the same database and the different + * database prefixes(Share one database between multiple wikis). + * Version : MediaWiki 1.18alpha +*/ + +class MediaWikiDifferntDatabasePrefixTestCase extends MediaWikiInstallationCommonFunction { + + function setUp(){ + parent::setUp(); + } + + // Install Mediawiki using 'MySQL' database type. + public function testDifferentDatabasePrefix(){ + + $databaseName = DB_NAME_PREFIX."_db_prefix"; + parent::navigateInstallPage( $databaseName ); + + // To 'Options' page + parent::clickBackButton(); + + // To 'Name' page + parent::clickBackButton(); + + // To 'Database settings' page + parent::clickBackButton(); + + // To 'Connect to database' page + parent::clickBackButton(); + + // From 'Connect to database' page without database prefix + parent::clickContinueButton(); + + // Verify upgrade existing message + $this->assertEquals( "Upgrade existing installation", + $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // To 'Connect to database' page + parent::clickBackButton(); + + // Input the database prefix + $this->type( "mysql_wgDBprefix", DATABASE_PREFIX ); + + // From 'Connect to database' page with database prefix + parent::clickContinueButton(); + + // To 'Complete' page + parent::clickContinueButton(); + parent::completeNamePage(); + parent::clickContinueButton(); + + // Verify already installed warning message + $this->assertEquals( "Install", + $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]" )); + parent::clickContinueButton(); + $this->chooseCancelOnNextConfirmation(); + parent::restartInstallation(); + } +} diff --git a/tests/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php b/tests/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php index 388fd518e6..5d2b4abf06 100644 --- a/tests/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php +++ b/tests/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php @@ -1,127 +1,127 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 09 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Invalid/ blank values for fields in 'Connect to database' page. - * Version : MediaWiki 1.18alpha -*/ - -class MediaWikiErrorsConnectToDatabasePageTestCase extends MediaWikiInstallationCommonFunction { - - function setUp(){ - parent::setUp(); - } - - // Verify warning messages for the 'Connet to database' page - public function testErrorsConnectToDatabasePage(){ - - parent::navigateConnetToDatabasePage(); - - // Verify warning mesage for invalid database host - $this->type( "mysql_wgDBserver", INVALID_DB_HOST ); - parent::clickContinueButton(); - $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.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - // Verify warning message for the blank database host - $this->type( "mysql_wgDBserver", "" ); - parent::clickContinueButton(); - $this->assertEquals( "MySQL 4.0.14 or later is required, you have .", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - // Valid Database Host - $this->type( "mysql_wgDBserver", VALID_DB_HOST ); - - // Verify warning message for the invalid database name - $this->type( "mysql_wgDBname", INVALID_DB_NAME ); - parent::clickContinueButton(); - $this->assertEquals( "Invalid database name \"".INVALID_DB_NAME."\".Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - // Verify warning message for the blank database name - $this->type( "mysql_wgDBname", ""); - parent::clickContinueButton(); - $this->assertEquals( "You must enter a value for \"Database name\"", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - // valid Database name - $this->type( "mysql_wgDBname", VALID_DB_NAME); - - // Verify warning message for the invalid databaase prefix - $this->type( "mysql_wgDBprefix", INVALID_DB_PREFIX ); - parent::clickContinueButton(); - $this->assertEquals( "Invalid database prefix \"".INVALID_DB_PREFIX."\".Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - // Valid Database prefix - $this->type( "mysql_wgDBprefix", VALID_DB_PREFIX ); - - // Verify warning message for the invalid database user name - $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME ); - parent::clickContinueButton(); - $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.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - - // Verify warning message for the invalid database user name - $this->type( "mysql__InstallUser", "" ); - parent::clickContinueButton(); - $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.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - // Valid Database username - $this->type( "mysql__InstallUser", VALID_DB_USER_NAME ); - - // Verify warning message for the invalid password - $this->type( "mysql__InstallPassword", INVALID_DB_PASSWORD ); - parent::clickContinueButton(); - $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.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - // Verify warning message for the invalid username and password - $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME ); - $this->type( "mysql__InstallPassword", INVALID_DB_PASSWORD ); - parent::clickContinueButton(); - $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.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - // Valid username and valid password - $this->type( "mysql__InstallUser", VALID_DB_USER_NAME ); - $this->type( "mysql__InstallPassword", "" ); - parent::clickContinueButton(); - - // successfully completes the 'Connect to database' page - $this->assertEquals( "Database settings", - $this->getText("//div[@id='bodyContent']/div/div/h2" )); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 09 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Invalid/ blank values for fields in 'Connect to database' page. + * Version : MediaWiki 1.18alpha +*/ + +class MediaWikiErrorsConnectToDatabasePageTestCase extends MediaWikiInstallationCommonFunction { + + function setUp(){ + parent::setUp(); + } + + // Verify warning messages for the 'Connet to database' page + public function testErrorsConnectToDatabasePage(){ + + parent::navigateConnetToDatabasePage(); + + // Verify warning mesage for invalid database host + $this->type( "mysql_wgDBserver", INVALID_DB_HOST ); + parent::clickContinueButton(); + $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.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + // Verify warning message for the blank database host + $this->type( "mysql_wgDBserver", "" ); + parent::clickContinueButton(); + $this->assertEquals( "MySQL 4.0.14 or later is required, you have .", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + // Valid Database Host + $this->type( "mysql_wgDBserver", VALID_DB_HOST ); + + // Verify warning message for the invalid database name + $this->type( "mysql_wgDBname", INVALID_DB_NAME ); + parent::clickContinueButton(); + $this->assertEquals( "Invalid database name \"".INVALID_DB_NAME."\".Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + // Verify warning message for the blank database name + $this->type( "mysql_wgDBname", ""); + parent::clickContinueButton(); + $this->assertEquals( "You must enter a value for \"Database name\"", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + // valid Database name + $this->type( "mysql_wgDBname", VALID_DB_NAME); + + // Verify warning message for the invalid databaase prefix + $this->type( "mysql_wgDBprefix", INVALID_DB_PREFIX ); + parent::clickContinueButton(); + $this->assertEquals( "Invalid database prefix \"".INVALID_DB_PREFIX."\".Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + // Valid Database prefix + $this->type( "mysql_wgDBprefix", VALID_DB_PREFIX ); + + // Verify warning message for the invalid database user name + $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME ); + parent::clickContinueButton(); + $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.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + + // Verify warning message for the invalid database user name + $this->type( "mysql__InstallUser", "" ); + parent::clickContinueButton(); + $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.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + // Valid Database username + $this->type( "mysql__InstallUser", VALID_DB_USER_NAME ); + + // Verify warning message for the invalid password + $this->type( "mysql__InstallPassword", INVALID_DB_PASSWORD ); + parent::clickContinueButton(); + $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.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + // Verify warning message for the invalid username and password + $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME ); + $this->type( "mysql__InstallPassword", INVALID_DB_PASSWORD ); + parent::clickContinueButton(); + $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.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + // Valid username and valid password + $this->type( "mysql__InstallUser", VALID_DB_USER_NAME ); + $this->type( "mysql__InstallPassword", "" ); + parent::clickContinueButton(); + + // successfully completes the 'Connect to database' page + $this->assertEquals( "Database settings", + $this->getText("//div[@id='bodyContent']/div/div/h2" )); + } +} diff --git a/tests/installer/MediaWikiErrorsNamepageTestCase.php b/tests/installer/MediaWikiErrorsNamepageTestCase.php index b3de8203d6..2537d9ee69 100644 --- a/tests/installer/MediaWikiErrorsNamepageTestCase.php +++ b/tests/installer/MediaWikiErrorsNamepageTestCase.php @@ -1,132 +1,132 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - -/* - * Test Case ID : 10 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Invalid/ blank values for fields in 'Name' page. - * Version : MediaWiki 1.18alpha -*/ - -require_once 'MediaWikiInstallationCommonFunction.php'; - -class MediaWikiErrorsNamepageTestCase extends MediaWikiInstallationCommonFunction { - - function setUp() { - parent::setUp(); - } - - // Verify warning message for the 'Name' page - public function testErrorsNamePage(){ - - $databaseName = DB_NAME_PREFIX."_error_name"; - - parent::navigateNamePage( $databaseName ); - - // Verify warning message for all blank fields - parent::clickContinueButton(); - $this->assertEquals( "Enter a site name.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - $this->assertEquals( "Enter an administrator username.", - $this->getText( "//div[@id='bodyContent']/div/div/div[3]/div[2]" )); - $this->assertEquals( "Enter a password for the administrator account.", - $this->getText( "//div[@id='bodyContent']/div/div/div[4]/div[2]" )); - - // Verify warning message for the blank 'Site name' - $this->type( "config__AdminName", VALID_YOUR_NAME ); - $this->type( "config__AdminPassword", VALID_PASSWORD ); - $this->type( "config__AdminPassword2", VALID_PASSWORD_AGAIN ); - parent::clickContinueButton(); - $this->assertEquals( "Enter a site name.", - $this->getText(" //div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - // Input valid 'Site name' - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - - - // Verify warning message for the invalid "Project namespace' - $this->click( "config__NamespaceType_other" ); - $this->type( "config_wgMetaNamespace", INVALID_NAMESPACE ); - parent::clickContinueButton(); - $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - - // Verify warning message for the blank 'Project namespace' - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - $this->click( "config__NamespaceType_other" ); - $this->type( "config_wgMetaNamespace" , "" ); - parent::clickContinueButton(); - $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - - // Valid 'Project namespace' - $this->click( "config__NamespaceType_other" ); - $this->type( "config_wgMetaNamespace", VALID_NAMESPACE ); - parent::clickContinueButton(); - - - // Valid 'Site name' - $this->click( "config__NamespaceType_site-name" ); - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - - - // Verify warning message for blank 'Your name' - $this->type( "config__AdminName", " " ); - parent::clickContinueButton(); - $this->assertEquals( "Enter an administrator username.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - - // Verify warning message for blank 'Password' - $this->type( "config__AdminName", VALID_YOUR_NAME ); - $this->type( "config__AdminPassword", " " ); - parent::clickContinueButton(); - $this->assertEquals( "Enter a password for the administrator account.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - - // Verify warning message for the blank 'Password again' - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - $this->type( "config__AdminPassword", VALID_PASSWORD ); - $this->type( "config__AdminPassword2", " " ); - parent::clickContinueButton(); - $this->assertEquals( "The two passwords you entered do not match.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - - - // Verify warning message for the different'Password' and 'Password again' - $this->type( "config_wgSitename", VALID_WIKI_NAME ); - $this->type( "config__AdminPassword", VALID_PASSWORD ); - $this->type( "config__AdminPassword2", INVALID_PASSWORD_AGAIN ); - parent::clickContinueButton(); - $this->assertEquals( "The two passwords you entered do not match.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + +/* + * Test Case ID : 10 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Invalid/ blank values for fields in 'Name' page. + * Version : MediaWiki 1.18alpha +*/ + +require_once 'MediaWikiInstallationCommonFunction.php'; + +class MediaWikiErrorsNamepageTestCase extends MediaWikiInstallationCommonFunction { + + function setUp() { + parent::setUp(); + } + + // Verify warning message for the 'Name' page + public function testErrorsNamePage(){ + + $databaseName = DB_NAME_PREFIX."_error_name"; + + parent::navigateNamePage( $databaseName ); + + // Verify warning message for all blank fields + parent::clickContinueButton(); + $this->assertEquals( "Enter a site name.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + $this->assertEquals( "Enter an administrator username.", + $this->getText( "//div[@id='bodyContent']/div/div/div[3]/div[2]" )); + $this->assertEquals( "Enter a password for the administrator account.", + $this->getText( "//div[@id='bodyContent']/div/div/div[4]/div[2]" )); + + // Verify warning message for the blank 'Site name' + $this->type( "config__AdminName", VALID_YOUR_NAME ); + $this->type( "config__AdminPassword", VALID_PASSWORD ); + $this->type( "config__AdminPassword2", VALID_PASSWORD_AGAIN ); + parent::clickContinueButton(); + $this->assertEquals( "Enter a site name.", + $this->getText(" //div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + // Input valid 'Site name' + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + + + // Verify warning message for the invalid "Project namespace' + $this->click( "config__NamespaceType_other" ); + $this->type( "config_wgMetaNamespace", INVALID_NAMESPACE ); + parent::clickContinueButton(); + $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + + // Verify warning message for the blank 'Project namespace' + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + $this->click( "config__NamespaceType_other" ); + $this->type( "config_wgMetaNamespace" , "" ); + parent::clickContinueButton(); + $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + + // Valid 'Project namespace' + $this->click( "config__NamespaceType_other" ); + $this->type( "config_wgMetaNamespace", VALID_NAMESPACE ); + parent::clickContinueButton(); + + + // Valid 'Site name' + $this->click( "config__NamespaceType_site-name" ); + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + + + // Verify warning message for blank 'Your name' + $this->type( "config__AdminName", " " ); + parent::clickContinueButton(); + $this->assertEquals( "Enter an administrator username.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + + // Verify warning message for blank 'Password' + $this->type( "config__AdminName", VALID_YOUR_NAME ); + $this->type( "config__AdminPassword", " " ); + parent::clickContinueButton(); + $this->assertEquals( "Enter a password for the administrator account.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + + // Verify warning message for the blank 'Password again' + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + $this->type( "config__AdminPassword", VALID_PASSWORD ); + $this->type( "config__AdminPassword2", " " ); + parent::clickContinueButton(); + $this->assertEquals( "The two passwords you entered do not match.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + + + // Verify warning message for the different'Password' and 'Password again' + $this->type( "config_wgSitename", VALID_WIKI_NAME ); + $this->type( "config__AdminPassword", VALID_PASSWORD ); + $this->type( "config__AdminPassword2", INVALID_PASSWORD_AGAIN ); + parent::clickContinueButton(); + $this->assertEquals( "The two passwords you entered do not match.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" )); + } +} diff --git a/tests/installer/MediaWikiHelpFieldHintTestCase.php b/tests/installer/MediaWikiHelpFieldHintTestCase.php index eab2f44d8b..fcc0fffcb9 100644 --- a/tests/installer/MediaWikiHelpFieldHintTestCase.php +++ b/tests/installer/MediaWikiHelpFieldHintTestCase.php @@ -1,144 +1,144 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - -/* - * Test Case ID : 29 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Help field hint availability for the fields. - * Version : MediaWiki 1.18alpha -*/ - -require_once 'MediaWikiInstallationCommonFunction.php'; - -class MediaWikiHelpFieldHintTestCase extends MediaWikiInstallationCommonFunction { - - function setUp(){ - parent::setUp(); - } - - - // Verify help field availability for the fields - public function testMySQLConnectToDatabaseFieldHint(){ - - parent::navigateConnetToDatabasePage(); - - // Verify help field for 'Database host' - $this->click( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[1]" ); - $this->assertEquals( MYSQL_DATABASE_HOST_HELP, - $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[2]" ) ); - - // Verify help field for 'Database name' - $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[1]" ); - $this->assertEquals( MYSQL_DATABASE_NAME_HELP, - $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]" )); - - - // Verify help field for 'Database table prefix' - $this->click("//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/div/span[1]" ); - $this->assertEquals(MYSQL_DATABASE_TABLE_PREFIX_HELP, - $this->getText("//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]/p[1]" )); - - // Verify help field for 'Database username' - $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[1]" ); - $this->assertEquals( MYSQL_DATBASE_USERNAME_HELP, - $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[2]" )); - - // Verify help field for 'Database password' - $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[1]" ); - $this->assertEquals( MYSQL_DATABASE_PASSWORD_HELP, - $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[2]/p" )); - } - - - public function testSQLiteConnectToDatabaseFieldHint(){ - - parent::navigateConnetToDatabasePage(); - $this->click( "DBType_sqlite" ); - - // Verify help field for 'SQLite data directory' - $this->click( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[1]" ); - $this->assertEquals( SQLITE_DATA_DIRECTORY_HELP, - $this->getText( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[2]" )); - - // Verify help field for 'Database name' - $this->click( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[1]" ); - $this->assertEquals( SQLITE_DATABASE_NAME_HELP , $this->getText( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[2]/p" )); - } - - - public function testDatabaseSettingsFieldHint(){ - - $databaseName = DB_NAME_PREFIX."_db_field"; - parent::navigateDatabaseSettingsPage($databaseName); - - // Verify help field for 'Search engine' - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/span[1]" ); - $this->assertEquals( SEARCH_ENGINE_HELP, - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/span[2]" )); - - // Verify help field for 'Database character set' - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[4]/span[1]" ); - $this->assertEquals( DATABASE_CHARACTER_SET_HELP, - $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[4]/span[2]")); - parent::restartInstallation(); - } - - - public function testNameFieldHint(){ - - $databaseName = DB_NAME_PREFIX."_name_field"; - parent::navigateNamePage( $databaseName ); - - // Verify help field for 'Name of Wiki' - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/div/span[1]" ); - $this->assertEquals( NAME_OF_WIKI_HELP, - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/div/span[2]/p" )); - - // Verify help field for 'Project namespace' - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/div/span[1]" ); - $this->assertEquals( PROJECT_NAMESPACE_HELP, - $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/div/span[2]/p")); - - // Verify help field for 'Your Name' - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/div/span[1]" ); - $this->assertEquals( USER_NAME_HELP, - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/div/span[2]/p" )); - - // Verify help field for 'E mail address' - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/div/span[1]" ); - $this->assertEquals( EMAIL_ADDRESS_HELP, - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/div/span[2]/p" )); - - // Verify help field for 'Subscribe to the release announcements mailing list' - $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/div/span[1]" ); - $this->assertEquals( SUBSCRIBE_MAILING_LIST_HELP, - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/div/span[2]/p" )); - parent::restartInstallation(); - } -} - + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + +/* + * Test Case ID : 29 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Help field hint availability for the fields. + * Version : MediaWiki 1.18alpha +*/ + +require_once 'MediaWikiInstallationCommonFunction.php'; + +class MediaWikiHelpFieldHintTestCase extends MediaWikiInstallationCommonFunction { + + function setUp(){ + parent::setUp(); + } + + + // Verify help field availability for the fields + public function testMySQLConnectToDatabaseFieldHint(){ + + parent::navigateConnetToDatabasePage(); + + // Verify help field for 'Database host' + $this->click( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[1]" ); + $this->assertEquals( MYSQL_DATABASE_HOST_HELP, + $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[2]" ) ); + + // Verify help field for 'Database name' + $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[1]" ); + $this->assertEquals( MYSQL_DATABASE_NAME_HELP, + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]" )); + + + // Verify help field for 'Database table prefix' + $this->click("//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/div/span[1]" ); + $this->assertEquals(MYSQL_DATABASE_TABLE_PREFIX_HELP, + $this->getText("//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]/p[1]" )); + + // Verify help field for 'Database username' + $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[1]" ); + $this->assertEquals( MYSQL_DATBASE_USERNAME_HELP, + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[2]" )); + + // Verify help field for 'Database password' + $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[1]" ); + $this->assertEquals( MYSQL_DATABASE_PASSWORD_HELP, + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[2]/p" )); + } + + + public function testSQLiteConnectToDatabaseFieldHint(){ + + parent::navigateConnetToDatabasePage(); + $this->click( "DBType_sqlite" ); + + // Verify help field for 'SQLite data directory' + $this->click( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[1]" ); + $this->assertEquals( SQLITE_DATA_DIRECTORY_HELP, + $this->getText( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[2]" )); + + // Verify help field for 'Database name' + $this->click( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[1]" ); + $this->assertEquals( SQLITE_DATABASE_NAME_HELP , $this->getText( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[2]/p" )); + } + + + public function testDatabaseSettingsFieldHint(){ + + $databaseName = DB_NAME_PREFIX."_db_field"; + parent::navigateDatabaseSettingsPage($databaseName); + + // Verify help field for 'Search engine' + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/span[1]" ); + $this->assertEquals( SEARCH_ENGINE_HELP, + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/span[2]" )); + + // Verify help field for 'Database character set' + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[4]/span[1]" ); + $this->assertEquals( DATABASE_CHARACTER_SET_HELP, + $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[4]/span[2]")); + parent::restartInstallation(); + } + + + public function testNameFieldHint(){ + + $databaseName = DB_NAME_PREFIX."_name_field"; + parent::navigateNamePage( $databaseName ); + + // Verify help field for 'Name of Wiki' + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/div/span[1]" ); + $this->assertEquals( NAME_OF_WIKI_HELP, + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/div/span[2]/p" )); + + // Verify help field for 'Project namespace' + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/div/span[1]" ); + $this->assertEquals( PROJECT_NAMESPACE_HELP, + $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/div/span[2]/p")); + + // Verify help field for 'Your Name' + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/div/span[1]" ); + $this->assertEquals( USER_NAME_HELP, + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/div/span[2]/p" )); + + // Verify help field for 'E mail address' + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/div/span[1]" ); + $this->assertEquals( EMAIL_ADDRESS_HELP, + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/div/span[2]/p" )); + + // Verify help field for 'Subscribe to the release announcements mailing list' + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/div/span[1]" ); + $this->assertEquals( SUBSCRIBE_MAILING_LIST_HELP, + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/div/span[2]/p" )); + parent::restartInstallation(); + } +} + diff --git a/tests/installer/MediaWikiMySQLDataBaseTestCase.php b/tests/installer/MediaWikiMySQLDataBaseTestCase.php index 1d82545f38..91d22a4abe 100644 --- a/tests/installer/MediaWikiMySQLDataBaseTestCase.php +++ b/tests/installer/MediaWikiMySQLDataBaseTestCase.php @@ -1,83 +1,83 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Install Mediawiki using 'MySQL' database type successfully - * Version : MediaWiki 1.18alpha -*/ - -class MediaWikiMySQLDataBaseTestCase extends MediaWikiInstallationCommonFunction { - - function setUp(){ - parent::setUp(); - } - - // Verify MediaWiki installation using 'MySQL' database type - public function testMySQLDatabaseSuccess(){ - - $databaseName = DB_NAME_PREFIX."_sql_db"; - - parent::navigateConnetToDatabasePage(); - - // Verify 'MySQL" is selected as the default database type - $this->assertEquals( "MySQL settings", $this->getText( "//div[@id='DB_wrapper_mysql']/h3" )); - - // Change 'Database name' - $defaultDbName = $this->getText( "mysql_wgDBname" ); - $this->type( "mysql_wgDBname", " "); - $this->type( "mysql_wgDBname", $databaseName ); - $this->assertNotEquals( $defaultDbName, $databaseName ); - - // 'Database settings' page - parent::clickContinueButton(); - - // 'Name' page - parent::clickContinueButton(); - parent::completeNamePage(); - - // 'Options page - parent::clickContinueButton(); - - // 'Install' page - parent::clickContinueButton(); - - // 'Complete' page - $this->assertEquals( "Complete!", - $this->getText("//div[@id='bodyContent']/div/div/h2" )); - - // 'Congratulations!' text should be available in the 'Complete!' page. - $this->assertEquals( "Congratulations!", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); - parent::restartInstallation(); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Install Mediawiki using 'MySQL' database type successfully + * Version : MediaWiki 1.18alpha +*/ + +class MediaWikiMySQLDataBaseTestCase extends MediaWikiInstallationCommonFunction { + + function setUp(){ + parent::setUp(); + } + + // Verify MediaWiki installation using 'MySQL' database type + public function testMySQLDatabaseSuccess(){ + + $databaseName = DB_NAME_PREFIX."_sql_db"; + + parent::navigateConnetToDatabasePage(); + + // Verify 'MySQL" is selected as the default database type + $this->assertEquals( "MySQL settings", $this->getText( "//div[@id='DB_wrapper_mysql']/h3" )); + + // Change 'Database name' + $defaultDbName = $this->getText( "mysql_wgDBname" ); + $this->type( "mysql_wgDBname", " "); + $this->type( "mysql_wgDBname", $databaseName ); + $this->assertNotEquals( $defaultDbName, $databaseName ); + + // 'Database settings' page + parent::clickContinueButton(); + + // 'Name' page + parent::clickContinueButton(); + parent::completeNamePage(); + + // 'Options page + parent::clickContinueButton(); + + // 'Install' page + parent::clickContinueButton(); + + // 'Complete' page + $this->assertEquals( "Complete!", + $this->getText("//div[@id='bodyContent']/div/div/h2" )); + + // 'Congratulations!' text should be available in the 'Complete!' page. + $this->assertEquals( "Congratulations!", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); + parent::restartInstallation(); + } +} diff --git a/tests/installer/MediaWikiMySQLiteDataBaseTestCase.php b/tests/installer/MediaWikiMySQLiteDataBaseTestCase.php index 6e7f0ad8a3..9a0f272908 100644 --- a/tests/installer/MediaWikiMySQLiteDataBaseTestCase.php +++ b/tests/installer/MediaWikiMySQLiteDataBaseTestCase.php @@ -1,84 +1,84 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Install Mediawiki using 'MySQL' database type successfully - * Version : MediaWiki 1.18alpha -*/ - -class MediaWikiMySQLiteDataBaseTestCase extends MediaWikiInstallationCommonFunction { - - function setUp() { - parent::setUp(); - } - - // Verify MediaWiki installation using 'MySQL' database type - public function testMySQLDatabaseSuccess() { - - $databaseName = DB_NAME_PREFIX."_sqlite_db"; - - parent::navigateConnetToDatabasePage(); - $this->click( "DBType_sqlite" ); - - // Select 'SQLite' database type - $this->assertEquals( "SQLite settings", $this->getText( "//div[@id='DB_wrapper_sqlite']/h3" )); - - // Change database name - $defaultDbName = $this->getText( "sqlite_wgDBname" ); - $this->type( "sqlite_wgDBname", " "); - $this->type( "sqlite_wgDBname", $databaseName ); - $this->assertNotEquals( $defaultDbName, $databaseName ); - - // 'Database settings' page - parent::clickContinueButton(); - - // 'Name' page - parent::clickContinueButton(); - parent::completeNamePage(); - - // 'Options page - parent::clickContinueButton(); - - // 'Install' page - parent::clickContinueButton(); - - // 'Complete' page - $this->assertEquals( "Complete!", - $this->getText("//div[@id='bodyContent']/div/div/h2" )); - - // 'Congratulations!' text should be available in the 'Complete!' page. - $this->assertEquals( "Congratulations!", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); - parent::restartInstallation(); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Install Mediawiki using 'MySQL' database type successfully + * Version : MediaWiki 1.18alpha +*/ + +class MediaWikiMySQLiteDataBaseTestCase extends MediaWikiInstallationCommonFunction { + + function setUp() { + parent::setUp(); + } + + // Verify MediaWiki installation using 'MySQL' database type + public function testMySQLDatabaseSuccess() { + + $databaseName = DB_NAME_PREFIX."_sqlite_db"; + + parent::navigateConnetToDatabasePage(); + $this->click( "DBType_sqlite" ); + + // Select 'SQLite' database type + $this->assertEquals( "SQLite settings", $this->getText( "//div[@id='DB_wrapper_sqlite']/h3" )); + + // Change database name + $defaultDbName = $this->getText( "sqlite_wgDBname" ); + $this->type( "sqlite_wgDBname", " "); + $this->type( "sqlite_wgDBname", $databaseName ); + $this->assertNotEquals( $defaultDbName, $databaseName ); + + // 'Database settings' page + parent::clickContinueButton(); + + // 'Name' page + parent::clickContinueButton(); + parent::completeNamePage(); + + // 'Options page + parent::clickContinueButton(); + + // 'Install' page + parent::clickContinueButton(); + + // 'Complete' page + $this->assertEquals( "Complete!", + $this->getText("//div[@id='bodyContent']/div/div/h2" )); + + // 'Congratulations!' text should be available in the 'Complete!' page. + $this->assertEquals( "Congratulations!", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); + parent::restartInstallation(); + } +} diff --git a/tests/installer/MediaWikiOnAlreadyInstalledTestCase.php b/tests/installer/MediaWikiOnAlreadyInstalledTestCase.php index b3807881b9..d657264e4d 100644 --- a/tests/installer/MediaWikiOnAlreadyInstalledTestCase.php +++ b/tests/installer/MediaWikiOnAlreadyInstalledTestCase.php @@ -1,74 +1,74 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - - -require_once 'MediaWikiInstallationCommonFunction.php'; - - -/* - * Test Case ID : 03 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Install mediawiki on a already installed Mediawiki.] - * Version : MediaWiki 1.18alpha -*/ - -class MediaWikiOnAlreadyInstalledTestCase extends MediaWikiInstallationCommonFunction { - - function setUp() { - parent::setUp(); - } - - // Install Mediawiki using 'MySQL' database type. - public function testInstallOnAlreadyInstalled() { - - $databaseName = DB_NAME_PREFIX."_already_installed"; - parent::navigateInstallPage( $databaseName ); - - // 'Options' page - parent::clickBackButton(); - - // Install page - parent::clickContinueButton(); - - // 'Install' page should display after the 'Option' page - $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // Verify warning text displayed - $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); - - // Complete page - parent::clickContinueButton(); - - // Clicking in the 'Continue' button should display the 'Complete' page with 'Congratulations!' text. - $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - $this->assertEquals( "Congratulations!", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); - $this->chooseCancelOnNextConfirmation(); - parent::restartInstallation(); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + + +require_once 'MediaWikiInstallationCommonFunction.php'; + + +/* + * Test Case ID : 03 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Install mediawiki on a already installed Mediawiki.] + * Version : MediaWiki 1.18alpha +*/ + +class MediaWikiOnAlreadyInstalledTestCase extends MediaWikiInstallationCommonFunction { + + function setUp() { + parent::setUp(); + } + + // Install Mediawiki using 'MySQL' database type. + public function testInstallOnAlreadyInstalled() { + + $databaseName = DB_NAME_PREFIX."_already_installed"; + parent::navigateInstallPage( $databaseName ); + + // 'Options' page + parent::clickBackButton(); + + // Install page + parent::clickContinueButton(); + + // 'Install' page should display after the 'Option' page + $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // Verify warning text displayed + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); + + // Complete page + parent::clickContinueButton(); + + // Clicking in the 'Continue' button should display the 'Complete' page with 'Congratulations!' text. + $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + $this->assertEquals( "Congratulations!", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); + $this->chooseCancelOnNextConfirmation(); + parent::restartInstallation(); + } +} diff --git a/tests/installer/MediaWikiRestartInstallationTestCase.php b/tests/installer/MediaWikiRestartInstallationTestCase.php index 3d7e385f54..5102307f58 100644 --- a/tests/installer/MediaWikiRestartInstallationTestCase.php +++ b/tests/installer/MediaWikiRestartInstallationTestCase.php @@ -1,115 +1,115 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - - - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 11, 12 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Install mediawiki on a already installed Mediawiki. - * Version : MediaWiki 1.18alpha -*/ - -class MediaWikiRestartInstallationTestCase extends MediaWikiInstallationCommonFunction { - - function setUp() { - parent::setUp(); - } - - // Verify restarting the installation - public function testSuccessRestartInstallation() { - - $dbNameBeforeRestart = DB_NAME_PREFIX."_db_before"; - parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart ); - - // Verify 'Restart installation' link available - $this->assertTrue($this->isElementPresent( "link=Restart installation" )); - - // Click 'Restart installation' - $this->click( "link=Restart installation "); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - - // 'Restart Installation' page displayed - $this->assertEquals( "Restart installation", $this->getText("//div[@id='bodyContent']/div/div/h2")); - - // Restart warning message displayed - $this->assertTrue($this->isTextPresent( "exact:Do you want to clear all saved data that you have entered and restart the installation process?" )); - - // Click on the 'Yes, restart' button - $this->click( "submit-restart" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - - // Navigate to the initial installation page(Language). - $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // 'Welcome to MediaWiki!' page - parent::clickContinueButton(); - - // 'Connect to database' page - parent::clickContinueButton(); - - // saved data should be deleted - $dbNameAfterRestart = $this->getValue("mysql_wgDBname"); - $this->assertNotEquals($dbNameBeforeRestart, $dbNameAfterRestart); - } - - - // Verify cancelling restart - public function testCancelRestartInstallation(){ - - $dbNameBeforeRestart = DB_NAME_PREFIX."_cancel_restart"; - - parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart); - // Verify 'Restart installation' link available - $this->assertTrue($this->isElementPresent( "link=Restart installation" )); - - $this->click( "link=Restart installation" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - - // 'Restart Installation' page displayed - $this->assertEquals( "Restart installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // Restart warning message displayed - $this->assertTrue( $this->isTextPresent( "Do you want to clear all saved data that you have entered and restart the installation process?")); - - // Click on the 'Back' button - parent::clickBackButton(); - - // Navigates to the previous page - $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));; - - // 'Connect to database' page - parent::clickBackButton(); - - // Saved data remain on the page. - $dbNameAfterRestart = $this->getValue( "mysql_wgDBname" ); - $this->assertEquals( $dbNameBeforeRestart, $dbNameAfterRestart ); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + + + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 11, 12 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Install mediawiki on a already installed Mediawiki. + * Version : MediaWiki 1.18alpha +*/ + +class MediaWikiRestartInstallationTestCase extends MediaWikiInstallationCommonFunction { + + function setUp() { + parent::setUp(); + } + + // Verify restarting the installation + public function testSuccessRestartInstallation() { + + $dbNameBeforeRestart = DB_NAME_PREFIX."_db_before"; + parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart ); + + // Verify 'Restart installation' link available + $this->assertTrue($this->isElementPresent( "link=Restart installation" )); + + // Click 'Restart installation' + $this->click( "link=Restart installation "); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + + // 'Restart Installation' page displayed + $this->assertEquals( "Restart installation", $this->getText("//div[@id='bodyContent']/div/div/h2")); + + // Restart warning message displayed + $this->assertTrue($this->isTextPresent( "exact:Do you want to clear all saved data that you have entered and restart the installation process?" )); + + // Click on the 'Yes, restart' button + $this->click( "submit-restart" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + + // Navigate to the initial installation page(Language). + $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // 'Welcome to MediaWiki!' page + parent::clickContinueButton(); + + // 'Connect to database' page + parent::clickContinueButton(); + + // saved data should be deleted + $dbNameAfterRestart = $this->getValue("mysql_wgDBname"); + $this->assertNotEquals($dbNameBeforeRestart, $dbNameAfterRestart); + } + + + // Verify cancelling restart + public function testCancelRestartInstallation(){ + + $dbNameBeforeRestart = DB_NAME_PREFIX."_cancel_restart"; + + parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart); + // Verify 'Restart installation' link available + $this->assertTrue($this->isElementPresent( "link=Restart installation" )); + + $this->click( "link=Restart installation" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + + // 'Restart Installation' page displayed + $this->assertEquals( "Restart installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // Restart warning message displayed + $this->assertTrue( $this->isTextPresent( "Do you want to clear all saved data that you have entered and restart the installation process?")); + + // Click on the 'Back' button + parent::clickBackButton(); + + // Navigates to the previous page + $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));; + + // 'Connect to database' page + parent::clickBackButton(); + + // Saved data remain on the page. + $dbNameAfterRestart = $this->getValue( "mysql_wgDBname" ); + $this->assertEquals( $dbNameBeforeRestart, $dbNameAfterRestart ); + } +} diff --git a/tests/installer/MediaWikiRightFrameworkLinksTestCase.php b/tests/installer/MediaWikiRightFrameworkLinksTestCase.php index a491405d8b..63576851c2 100644 --- a/tests/installer/MediaWikiRightFrameworkLinksTestCase.php +++ b/tests/installer/MediaWikiRightFrameworkLinksTestCase.php @@ -1,93 +1,93 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 14, 15, 16, 17 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : User selects 'Read me' link. - * User selects 'Release notes' link. - * User selects 'Copying' link. - * User selects 'Upgrading' link. - * Version : MediaWiki 1.18alpha -*/ - - -class MediaWikiRightFrameworkLinksTestCase extends MediaWikiInstallationCommonFunction{ - - function setUp(){ - parent::setUp(); - } - - public function testLinksAvailability(){ - - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); - - // Verify 'Read me' link availability - $this->assertTrue($this->isElementPresent( "link=Read me" )); - - // Verify 'Release notes' link availability - $this->assertTrue($this->isElementPresent( "link=Release notes" )); - - // Verify 'Copying' link availability - $this->assertTrue($this->isElementPresent( "link=Copying" )); - } - - public function testPageNavigation(){ - - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); - - // Navigate to the 'Read me' page - $this->click( "link=Read me" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - $this->assertEquals( "Read me", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" )); - $this->assertTrue($this->isElementPresent( "submit-back" )); - parent::clickBackButton(); - - // Navigate to the 'Release notes' page - $this->click( "link=Release notes" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME); - $this->assertEquals( "Release notes", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" )); - $this->assertTrue( $this->isElementPresent( "submit-back" )); - parent::clickBackButton(); - - // Navigate to the 'Copying' page - $this->click( "link=Copying" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - $this->assertEquals( "Copying", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" )); - $this->assertTrue($this->isElementPresent( "submit-back" )); - parent::clickBackButton(); - - // Navigate to the 'Upgrading' page - $this->click( "link=Upgrading" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - $this->assertEquals( "Upgrading", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" )); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 14, 15, 16, 17 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : User selects 'Read me' link. + * User selects 'Release notes' link. + * User selects 'Copying' link. + * User selects 'Upgrading' link. + * Version : MediaWiki 1.18alpha +*/ + + +class MediaWikiRightFrameworkLinksTestCase extends MediaWikiInstallationCommonFunction{ + + function setUp(){ + parent::setUp(); + } + + public function testLinksAvailability(){ + + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); + + // Verify 'Read me' link availability + $this->assertTrue($this->isElementPresent( "link=Read me" )); + + // Verify 'Release notes' link availability + $this->assertTrue($this->isElementPresent( "link=Release notes" )); + + // Verify 'Copying' link availability + $this->assertTrue($this->isElementPresent( "link=Copying" )); + } + + public function testPageNavigation(){ + + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); + + // Navigate to the 'Read me' page + $this->click( "link=Read me" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + $this->assertEquals( "Read me", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" )); + $this->assertTrue($this->isElementPresent( "submit-back" )); + parent::clickBackButton(); + + // Navigate to the 'Release notes' page + $this->click( "link=Release notes" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME); + $this->assertEquals( "Release notes", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" )); + $this->assertTrue( $this->isElementPresent( "submit-back" )); + parent::clickBackButton(); + + // Navigate to the 'Copying' page + $this->click( "link=Copying" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + $this->assertEquals( "Copying", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" )); + $this->assertTrue($this->isElementPresent( "submit-back" )); + parent::clickBackButton(); + + // Navigate to the 'Upgrading' page + $this->click( "link=Upgrading" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + $this->assertEquals( "Upgrading", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" )); + } +} diff --git a/tests/installer/MediaWikiUpgradeExistingDatabaseTestCase.php b/tests/installer/MediaWikiUpgradeExistingDatabaseTestCase.php index 5e9e97de92..13214d6797 100644 --- a/tests/installer/MediaWikiUpgradeExistingDatabaseTestCase.php +++ b/tests/installer/MediaWikiUpgradeExistingDatabaseTestCase.php @@ -1,113 +1,113 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 05 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : Install Mediawiki by updating the existing database. - * Version : MediaWiki 1.18alpha -*/ - - -class MediaWikiUpgradeExistingDatabaseTestCase extends MediaWikiInstallationCommonFunction { - - function setUp(){ - parent::setUp(); - } - - // Install Mediawiki using 'MySQL' database type. - public function testUpgradeExistingDatabase(){ - - $databaseName = DB_NAME_PREFIX."_upgrade_existing"; - parent::navigateInstallPage( $databaseName ); - - $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); - $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); - - // 'Optionis' page - parent::clickBackButton(); - - // 'Name' page - parent::clickBackButton(); - - // 'Database settings' page - parent::clickBackButton(); - - // 'Connect to database' page - parent::clickBackButton(); - $this->type( "mysql_wgDBname", $databaseName ); - parent::clickContinueButton(); - - // 'Upgrade existing installation' page displayed next to the 'Connect to database' page. - $this->assertEquals( "Upgrade existing installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // Warning message displayed. - $this->assertEquals( "There are MediaWiki tables in this database.To upgrade them to MediaWiki 1.18alpha, click Continue.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); - - parent::clickContinueButton(); - $this->assertEquals( "Upgrade existing installation", - $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // 'Upgrade complete.' text display - $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.", - $this->getText( "//div[@id='bodyContent']/div/div/div[4]/form/div[1]/div[2]")); - - $this->assertTrue($this->isElementPresent( "submit-regenerate" )); - $this->click( "submit-regenerate" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - $this->assertEquals( "Database settings", - $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // 'Database settings' page - parent::clickContinueButton(); - - // Name page - parent::completeNamePage(); - - // Options page - parent::clickContinueButton(); - - // Install page - $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); - parent::clickContinueButton(); - - // complete - $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - $this->assertEquals( "Congratulations!", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); - $this->chooseCancelOnNextConfirmation(); - parent::restartInstallation(); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 05 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : Install Mediawiki by updating the existing database. + * Version : MediaWiki 1.18alpha +*/ + + +class MediaWikiUpgradeExistingDatabaseTestCase extends MediaWikiInstallationCommonFunction { + + function setUp(){ + parent::setUp(); + } + + // Install Mediawiki using 'MySQL' database type. + public function testUpgradeExistingDatabase(){ + + $databaseName = DB_NAME_PREFIX."_upgrade_existing"; + parent::navigateInstallPage( $databaseName ); + + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); + $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); + + // 'Optionis' page + parent::clickBackButton(); + + // 'Name' page + parent::clickBackButton(); + + // 'Database settings' page + parent::clickBackButton(); + + // 'Connect to database' page + parent::clickBackButton(); + $this->type( "mysql_wgDBname", $databaseName ); + parent::clickContinueButton(); + + // 'Upgrade existing installation' page displayed next to the 'Connect to database' page. + $this->assertEquals( "Upgrade existing installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // Warning message displayed. + $this->assertEquals( "There are MediaWiki tables in this database.To upgrade them to MediaWiki 1.18alpha, click Continue.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); + + parent::clickContinueButton(); + $this->assertEquals( "Upgrade existing installation", + $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // 'Upgrade complete.' text display + $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.", + $this->getText( "//div[@id='bodyContent']/div/div/div[4]/form/div[1]/div[2]")); + + $this->assertTrue($this->isElementPresent( "submit-regenerate" )); + $this->click( "submit-regenerate" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + $this->assertEquals( "Database settings", + $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // 'Database settings' page + parent::clickContinueButton(); + + // Name page + parent::completeNamePage(); + + // Options page + parent::clickContinueButton(); + + // Install page + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); + parent::clickContinueButton(); + + // complete + $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + $this->assertEquals( "Congratulations!", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); + $this->chooseCancelOnNextConfirmation(); + parent::restartInstallation(); + } +} diff --git a/tests/installer/MediaWikiUserInterfaceTestCase.php b/tests/installer/MediaWikiUserInterfaceTestCase.php index bd718c5e9f..9cf2fcac35 100644 --- a/tests/installer/MediaWikiUserInterfaceTestCase.php +++ b/tests/installer/MediaWikiUserInterfaceTestCase.php @@ -1,522 +1,522 @@ - - * http://citizendium.org/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * http://www.gnu.org/copyleft/gpl.html - * - * @addtogroup Maintenance - * - */ - -require_once 'MediaWikiInstallationCommonFunction.php'; - -/* - * Test Case ID : 18 - 27 (http://www.mediawiki.org/wiki/New_installer/Test_plan) - * Test Case Name : UI of MediaWiki initial/ Language/ Welcome to MediaWiki!/ Connect to database/ - * Database settings/ Name/ Options/ Install/ Complete/ Restart Inslation pages - * Version : MediaWiki 1.18alpha -*/ - - -class MediaWikiUserInterfaceTestCase extends MediaWikiInstallationCommonFunction { - - function setUp() { - $this->setBrowser("*chrome"); - $this->setBrowserUrl("http://localhost:".PORT."/".DIRECTORY_NAME."/"); - } - - - public function testInitialPageUI(){ - - parent::navigateInitialpage(); - - // MediaWiki logo available - $this->assertTrue( $this->isElementPresent( "//img[@alt='The MediaWiki logo']" )); - - // 'MediaWiki 1.18alpha' text available - $this->assertEquals( "MediaWiki 1.18alpha", $this->getText( "//h1" )); - - // 'LocalSettings.php not found.' text available - $this->assertEquals( "LocalSettings.php not found.", $this->getText( "//p[1]" )); - - // 'Please set up the wiki first' text available - $this->assertEquals( "Please set up the wiki first.", $this->getText( "//p[2]" )); - - // 'set up the wiki' link available - $this->assertTrue($this->isElementPresent( "link=set up the wiki" )); - } - - - public function testlanguagePageUI(){ - - parent::navigateLanguagePage(); - - // Verify 'Language' heading - $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // 'Your language' label available - $this->assertEquals( "Your language:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label" )); - - // 'Your language' dropdown available - $this->assertTrue( $this->isElementPresent( "UserLang" )); - - // 'Wiki language' label available - $this->assertEquals( "Wiki language:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/label" )); - - // 'Wiki language' dropdown available - $this->assertTrue($this->isElementPresent( "ContLang" )); - } - - - public function testWelcometoMediaWikiUI(){ - - parent::navigateWelcometoMediaWikiPage(); - - // Verify 'Welcome to MediaWiki!' heading - $this->assertEquals( "Welcome to MediaWiki!", - $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // Verify environment ok text displayed. - $this->assertEquals( "The environment has been checked.You can install MediaWiki.", - $this->getText( "//div[@id='bodyContent']/div/div/div[7]/span" )); - } - - - public function testConnectToDatabaseUI(){ - - parent::navigateConnetToDatabasePage(); - - // 'MYSQL radio button available - $this->assertEquals( "MySQL", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]/label" )); - $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]" )); - - // 'SQLite' radio button available - $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]" )); - $this->assertEquals( "SQLite", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]/label ")); - - // 'Database host' label available - $this->assertEquals( "Database host:", $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/label" )); - - // 'Database host' text box default to 'localhost' - $this->assertEquals( "localhost", $this->getValue( "mysql_wgDBserver" )); - - // 'Identify this wiki' section available - $this->assertTrue( $this->isElementPresent( "//div[@id='DB_wrapper_mysql']/fieldset[1]/legend" )); - - // 'Identify this wiki' label available - $this->assertEquals( "Identify this wiki", $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/legend" )); - - // 'Database name' lable available - $this->assertEquals( "Database name:", - $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/label" )); - - // Verify 'Database name:' text box is default to 'my_wiki' - $this->assertEquals( "my_wiki", $this->getValue( "mysql_wgDBname" )); - - // Verify 'Database table prefix:' label available - $this->assertEquals( "Database table prefix:", - $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/label" )); - - // 'User account for installation' section available - $this->assertTrue( $this->isElementPresent( "//div[@id='DB_wrapper_mysql']/fieldset[2]/legend" )); - - // 'User account for installation' label available - $this->assertEquals( "User account for installation", $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/legend" )); - - // 'Database username' label available - $this->assertEquals( "Database username:", - $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/label" )); - - // 'Database username' text box defaults to 'root' - $this->assertEquals("root", $this->getValue( "mysql__InstallUser" )); - - // 'Database password' label available - $this->assertEquals( "Database password:", - $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/label" )); - } - - - - public function testDatabaseSettingsUI(){ - - $databaseName = DB_NAME_PREFIX."_db_settings_UI"; - parent::navigateDatabaseSettingsPage( $databaseName ); - - // 'Database settings' text available. - $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - // 'Database account for web access' section available - $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset" )); - - // 'Database account for web access' label available - $this->assertEquals( "Database account for web access", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/legend" )); - - // 'Use the same account as for installation' check box available - $this->assertEquals( "Use the same account as for installation", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/label" )); - - // 'Use the same account as for installation' check box is selected by default - $this->assertEquals( "on", $this->getValue( "mysql__SameAccount" )); - - // 'Use the same account as for installation' check box deselected - $this->click( "mysql__SameAccount" ); - - // verify 'Use the same account as for installation' check box is not selected - $this->assertEquals( "off", $this->getValue( "mysql__SameAccount" )); - - // 'Database username' label available - $this->assertEquals( "Database username:", $this->getText( "//div[@id='dbOtherAccount']/div[1]/div[1]/label" )); - - // 'Database username' text box is default to the 'wikiuser' - $this->assertEquals( "wikiuser", $this->getValue( "mysql_wgDBuser" )); - - // 'Database password' label available - $this->assertEquals( "Database password:", $this->getText( "//div[@id='dbOtherAccount']/div[2]/div[1]/label" )); - - // 'Create the account if it does not already exist' label available - $this->assertEquals( "Create the account if it does not already exist", $this->getText( "//div[@id='dbOtherAccount']/div[4]/label" )); - - // 'Create the account if it does not already exist' check box is not selected by default - $this->assertEquals( "off" , $this->getValue( "mysql__CreateDBAccount" )); - - // 'Create the account if it does not already exist' check box selected - $this->click( "mysql__CreateDBAccount" ); - - // Verify 'Create the account if it does not already exist' check box is selected - $this->assertEquals( "on" , $this->getValue( "mysql__CreateDBAccount" )); - $this->click( "mysql__SameAccount" ); - $this->assertEquals( "on", $this->getValue( "mysql__SameAccount" )); - - // 'Storage engine' label available - $this->assertEquals( "Storage engine:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label")); - - // 'InnoDB' label available - $this->assertEquals( "InnoDB", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/ul/li[1]/label" )); - - // 'InnoDB' radio button available - $this->assertTrue( $this->isElementPresent( "mysql__MysqlEngine_InnoDB" )); - - // 'MyISAM' label available - $this->assertEquals( "MyISAM", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/ul/li[2]/label" )); - - // 'MyISAM' radio button available - $this->assertTrue($this->isElementPresent( "mysql__MysqlEngine_MyISAM" )); - - // 'Database character set' label available - $this->assertEquals( "Database character set:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[1]/label" )); - - // 'Binary' radio button available - $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_binary" )); - - // 'Binary' radio button available - $this->assertEquals( "Binary", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[2]/ul/li[1]/label" )); - - // 'UTF-8' radio button available - $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_utf8" )); - - // 'UTF-8' label available - $this->assertEquals( "UTF-8", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[2]/ul/li[2]/label" )); - - // 'Binary' radio button is selected - $this->assertEquals( "on", $this->getValue( "mysql__MysqlCharset_binary" )); - } - - public function testNamePageUI(){ - - $databaseName = DB_NAME_PREFIX."_name_UI"; - parent::navigateNamePage($databaseName); - - // 'Name of wiki' text box available - $this->assertEquals( "Name of wiki:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label" )); - - $this->assertTrue( $this->isElementPresent( "config_wgSitename" )); - - // 'Project namespace' label available - $this->assertEquals( "Project namespace:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/label" )); - - // 'Same as the wiki name' radio button available - $this->assertTrue( $this->isElementPresent( "config__NamespaceType_site-name" )); - - // 'Project' radio button available - $this->assertTrue( $this->isElementPresent( "config__NamespaceType_generic" )); - - // 'Project' radio button available - $this->assertTrue( $this->isElementPresent( "config__NamespaceType_other" )); - - // 'Same as the wiki name' label available - $this->assertEquals( "Same as the wiki name:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]/label" )); - - // 'Project' label available - $this->assertEquals("Project", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]/label" )); - - // 'Project' label available - $this->assertEquals( "Other (specify)", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[3]/label" )); - - // 'Same as the wiki name' radio button selected by default - $this->assertEquals( "on", $this->getValue( "config__NamespaceType_site-name" )); - - // 'Administrator account' section available - $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset" )); - - // 'Administrator account' label available - $this->assertEquals( "Administrator account", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/legend" )); - - // 'Your Name' label available - $this->assertEquals( "Your name:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/label" )); - - // 'Your Name' text box available - $this->assertTrue( $this->isElementPresent( "config__AdminName" )); - - // 'Password' label available - $this->assertEquals( "Password:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[2]/div[1]/label" )); - - // 'Password' text box available - $this->assertTrue( $this->isElementPresent( "config__AdminPassword" )); - - // 'Password again' label available - $this->assertEquals( "Password again:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[3]/div[1]/label" )); - - // 'Password again' text box available - $this->assertTrue( $this->isElementPresent( "config__AdminPassword2" )); - - // 'Email address' label avaialble - $this->assertEquals( "E-mail address:", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/label" )); - - // 'Email address' text box available - $this->assertTrue( $this->isElementPresent( "config__AdminEmail" )); - - // 'Subscribe to the release announcements mailing list. ' check box available - $this->assertTrue( $this->isElementPresent( "config__Subscribe" )); - - // 'Subscribe to the release announcements mailing list. ' label avaialble - $this->assertEquals( "Subscribe to the release announcements mailing list.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/label" )); - - // 'release announcements mailing list' link available - $this->assertTrue( $this->isElementPresent( "link=release announcements mailing list" )); - - // Message displayed - $this->assertEquals( "You are almost done!You can now skip the remaining configuration and install the wiki right now.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[4]/div[2]" )); - - // 'Ask me more questions.' radio button available - $this->assertTrue( $this->isElementPresent( "config__SkipOptional_continue" )); - - // 'Ask me more questions.' label available - $this->assertEquals( "Ask me more questions.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[5]/div[2]/ul/li[1]/label" )); - - // 'I'm bored already, just install the wiki' radio button is avaiable - $this->assertTrue( $this->isElementPresent( "config__SkipOptional_skip" )); - - // 'I'm bored already, just install the wiki' label available - $this->assertEquals( "I'm bored already, just install the wiki.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[5]/div[2]/ul/li[2]/label" )); - - // 'Ask me more questions.' radio button is default selected - $this->assertEquals( "on", $this->getValue( "config__SkipOptional_continue" )); - } - - - - public function testOptionPageUI(){ - - $databaseName = DB_NAME_PREFIX."_options_UI"; - parent::navigateOptionsPage($databaseName); - - // 'Options' label available - $this->assertEquals( "Options", $this->getText("//div[@id='bodyContent']/div/div/h2")); - - // 'Return e-mail address' label available - $this->assertEquals( "Return e-mail address:", $this->getText( "//div[@id='emailwrapper']/div[1]/div[1]/label" )); - - // 'Return e-mail address' text box available - $this->assertTrue( $this->isElementPresent( "config_wgPasswordSender" )); - - // Text 'apache@localhost' is default value of the 'Return e-mail address' text box - $this->assertEquals( "apache@localhost", $this->getValue( "config_wgPasswordSender" )); - - // 'Logo URL' label available - $this->assertEquals( "Logo URL:", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset[2]/div[3]/div[1]/label" )); - - // 'Logo URL' text box available - $this->assertTrue( $this->isElementPresent( "config_wgLogo" )); - - // Correct path available in the 'Logo URL' text box - $this->assertEquals( "/wiki/skins/common/images/wiki.png", $this->getValue( "config_wgLogo" )); - - // 'Enable file uploads' radio button available - $this->assertTrue( $this->isElementPresent( "config_wgEnableUploads" )); - - // 'Enable file uploads' label available - $this->assertEquals( "Enable file uploads", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset[2]/div[1]/label" )); - - // 'Enable file uploads' check box is not selected - $this->assertEquals( "off", $this->getValue( "config_wgEnableUploads" )); - - $this->click( "config_wgEnableUploads" ); - - // 'Directory for deleted files' label available - $this->assertEquals( "Directory for deleted files:", - $this->getText( "//div[@id='uploadwrapper']/div/div[1]/label" )); - - // 'Directory for deleted files' text box available - $this->assertTrue( $this->isElementPresent( "config_wgDeletedDirectory" )); - - // Correct path available in the 'Directory for deleted files' text box - $this->assertEquals( "C:\\wamp\\www\\".DIRECTORY_NAME."/images/deleted", - $this->getValue( "config_wgDeletedDirectory" )); - } - - - - public function testInstallPageUI(){ - - $databaseName = DB_NAME_PREFIX."_install_UI"; - parent::navigateInstallPage( $databaseName ); - - // Verify installation done messages display - $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - $this->assertEquals( "Setting up database... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[1]" )); - $this->assertEquals( "Creating database user... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" )); - $this->assertEquals( "Creating tables... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[3]" )); - $this->assertEquals( "Populating default interwiki table... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[4]" )); - $this->assertEquals( "Generating secret key... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[5]" )); - $this->assertEquals( "Generating default upgrade key... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[6]" )); - $this->assertEquals( "Creating administrator user account... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[7]" )); - $this->assertEquals( "Creating main page with default content... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[8]" )); - } - - - - public function testCompletePageUI(){ - - $databaseName = DB_NAME_PREFIX."_complete_UI"; - parent::navigateCompletePage( $databaseName ); - - // 'Congratulations!' text display - $this->assertEquals( "Congratulations!", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); - - // 'LocalSettings.php' generated message display - $this->assertEquals( "The installer has generated a LocalSettings.php file. It contains all your configuration.", - $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/p[2]" )); - - // 'Download LocalSettings.php'' link available - $this->assertTrue( $this->isElementPresent( "link=Download LocalSettings.php" )); - - // 'enter your wiki' link available - $this->assertTrue( $this->isElementPresent( "link=enter your wiki" )); - } - - - - public function testRestartInstallation(){ - - parent::navigateConnetToDatabasePage(); - $this->click( "link=Restart installation" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - - // Restart installation' label should be available. - $this->assertEquals( "Restart installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); - - //'Do you want to clear all saved data that you have entered and restart the installation process?' label available - $this->assertEquals( "Do you want to clear all saved data that you have entered and restart the installation process?", - $this->getText( "//*[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); - // 'Back' button available - $this->assertTrue($this->isElementPresent( "submit-back" )); - - // 'Restart' button available - $this->assertTrue($this->isElementPresent( "submit-restart" )); - } - - - - public function testMediaWikiLogoAvailability(){ - - $databaseName = DB_NAME_PREFIX."_mediawiki_logo"; - parent::navigateInitialpage(); - parent::mediaWikiLogoPresentInitialScreen(); - $this->click( "link=set up the wiki" ); - $this->waitForPageToLoad( PAGE_LOAD_TIME ); - - // 'Language' page - parent::mediaWikiLogoPresent(); - parent::clickContinueButton(); - - // 'Welcome to MediaWiki' page - parent::mediaWikiLogoPresent(); - parent::clickContinueButton(); - - // 'Connet to database' page - parent::mediaWikiLogoPresent(); - $this->type("mysql_wgDBname", $databaseName ); - parent::clickContinueButton(); - - // 'Database setting' page - parent::mediaWikiLogoPresent(); - parent::clickContinueButton(); - - // 'Name' page - parent::mediaWikiLogoPresent(); - parent::completeNamePage(); - parent::clickContinueButton(); - - // 'Options' page - parent::mediaWikiLogoPresent(); - parent::clickContinueButton(); - - // 'Install' page - parent::mediaWikiLogoPresent(); - } - - - public function testRightFramework(){ - - parent::navigateLanguagePage(); - $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[1]/span" )); - $this->assertEquals( "Welcome to MediaWiki!", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[2]/span" )); - $this->assertEquals( "Connect to database", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[3]/span" )); - $this->assertEquals( "Upgrade existing installation", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[4]" )); - $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[5]/span" )); - $this->assertEquals( "Name", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[6]/span" )); - $this->assertEquals( "Options", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[7]/span" )); - $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[8]/span" )); - $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[9]/span" )); - } -} + + * http://citizendium.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @addtogroup Maintenance + * + */ + +require_once 'MediaWikiInstallationCommonFunction.php'; + +/* + * Test Case ID : 18 - 27 (http://www.mediawiki.org/wiki/New_installer/Test_plan) + * Test Case Name : UI of MediaWiki initial/ Language/ Welcome to MediaWiki!/ Connect to database/ + * Database settings/ Name/ Options/ Install/ Complete/ Restart Inslation pages + * Version : MediaWiki 1.18alpha +*/ + + +class MediaWikiUserInterfaceTestCase extends MediaWikiInstallationCommonFunction { + + function setUp() { + $this->setBrowser("*chrome"); + $this->setBrowserUrl("http://localhost:".PORT."/".DIRECTORY_NAME."/"); + } + + + public function testInitialPageUI(){ + + parent::navigateInitialpage(); + + // MediaWiki logo available + $this->assertTrue( $this->isElementPresent( "//img[@alt='The MediaWiki logo']" )); + + // 'MediaWiki 1.18alpha' text available + $this->assertEquals( "MediaWiki 1.18alpha", $this->getText( "//h1" )); + + // 'LocalSettings.php not found.' text available + $this->assertEquals( "LocalSettings.php not found.", $this->getText( "//p[1]" )); + + // 'Please set up the wiki first' text available + $this->assertEquals( "Please set up the wiki first.", $this->getText( "//p[2]" )); + + // 'set up the wiki' link available + $this->assertTrue($this->isElementPresent( "link=set up the wiki" )); + } + + + public function testlanguagePageUI(){ + + parent::navigateLanguagePage(); + + // Verify 'Language' heading + $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // 'Your language' label available + $this->assertEquals( "Your language:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label" )); + + // 'Your language' dropdown available + $this->assertTrue( $this->isElementPresent( "UserLang" )); + + // 'Wiki language' label available + $this->assertEquals( "Wiki language:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/label" )); + + // 'Wiki language' dropdown available + $this->assertTrue($this->isElementPresent( "ContLang" )); + } + + + public function testWelcometoMediaWikiUI(){ + + parent::navigateWelcometoMediaWikiPage(); + + // Verify 'Welcome to MediaWiki!' heading + $this->assertEquals( "Welcome to MediaWiki!", + $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // Verify environment ok text displayed. + $this->assertEquals( "The environment has been checked.You can install MediaWiki.", + $this->getText( "//div[@id='bodyContent']/div/div/div[7]/span" )); + } + + + public function testConnectToDatabaseUI(){ + + parent::navigateConnetToDatabasePage(); + + // 'MYSQL radio button available + $this->assertEquals( "MySQL", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]/label" )); + $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]" )); + + // 'SQLite' radio button available + $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]" )); + $this->assertEquals( "SQLite", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]/label ")); + + // 'Database host' label available + $this->assertEquals( "Database host:", $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/label" )); + + // 'Database host' text box default to 'localhost' + $this->assertEquals( "localhost", $this->getValue( "mysql_wgDBserver" )); + + // 'Identify this wiki' section available + $this->assertTrue( $this->isElementPresent( "//div[@id='DB_wrapper_mysql']/fieldset[1]/legend" )); + + // 'Identify this wiki' label available + $this->assertEquals( "Identify this wiki", $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/legend" )); + + // 'Database name' lable available + $this->assertEquals( "Database name:", + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/label" )); + + // Verify 'Database name:' text box is default to 'my_wiki' + $this->assertEquals( "my_wiki", $this->getValue( "mysql_wgDBname" )); + + // Verify 'Database table prefix:' label available + $this->assertEquals( "Database table prefix:", + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/label" )); + + // 'User account for installation' section available + $this->assertTrue( $this->isElementPresent( "//div[@id='DB_wrapper_mysql']/fieldset[2]/legend" )); + + // 'User account for installation' label available + $this->assertEquals( "User account for installation", $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/legend" )); + + // 'Database username' label available + $this->assertEquals( "Database username:", + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/label" )); + + // 'Database username' text box defaults to 'root' + $this->assertEquals("root", $this->getValue( "mysql__InstallUser" )); + + // 'Database password' label available + $this->assertEquals( "Database password:", + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/label" )); + } + + + + public function testDatabaseSettingsUI(){ + + $databaseName = DB_NAME_PREFIX."_db_settings_UI"; + parent::navigateDatabaseSettingsPage( $databaseName ); + + // 'Database settings' text available. + $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + // 'Database account for web access' section available + $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset" )); + + // 'Database account for web access' label available + $this->assertEquals( "Database account for web access", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/legend" )); + + // 'Use the same account as for installation' check box available + $this->assertEquals( "Use the same account as for installation", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/label" )); + + // 'Use the same account as for installation' check box is selected by default + $this->assertEquals( "on", $this->getValue( "mysql__SameAccount" )); + + // 'Use the same account as for installation' check box deselected + $this->click( "mysql__SameAccount" ); + + // verify 'Use the same account as for installation' check box is not selected + $this->assertEquals( "off", $this->getValue( "mysql__SameAccount" )); + + // 'Database username' label available + $this->assertEquals( "Database username:", $this->getText( "//div[@id='dbOtherAccount']/div[1]/div[1]/label" )); + + // 'Database username' text box is default to the 'wikiuser' + $this->assertEquals( "wikiuser", $this->getValue( "mysql_wgDBuser" )); + + // 'Database password' label available + $this->assertEquals( "Database password:", $this->getText( "//div[@id='dbOtherAccount']/div[2]/div[1]/label" )); + + // 'Create the account if it does not already exist' label available + $this->assertEquals( "Create the account if it does not already exist", $this->getText( "//div[@id='dbOtherAccount']/div[4]/label" )); + + // 'Create the account if it does not already exist' check box is not selected by default + $this->assertEquals( "off" , $this->getValue( "mysql__CreateDBAccount" )); + + // 'Create the account if it does not already exist' check box selected + $this->click( "mysql__CreateDBAccount" ); + + // Verify 'Create the account if it does not already exist' check box is selected + $this->assertEquals( "on" , $this->getValue( "mysql__CreateDBAccount" )); + $this->click( "mysql__SameAccount" ); + $this->assertEquals( "on", $this->getValue( "mysql__SameAccount" )); + + // 'Storage engine' label available + $this->assertEquals( "Storage engine:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label")); + + // 'InnoDB' label available + $this->assertEquals( "InnoDB", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/ul/li[1]/label" )); + + // 'InnoDB' radio button available + $this->assertTrue( $this->isElementPresent( "mysql__MysqlEngine_InnoDB" )); + + // 'MyISAM' label available + $this->assertEquals( "MyISAM", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/ul/li[2]/label" )); + + // 'MyISAM' radio button available + $this->assertTrue($this->isElementPresent( "mysql__MysqlEngine_MyISAM" )); + + // 'Database character set' label available + $this->assertEquals( "Database character set:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[1]/label" )); + + // 'Binary' radio button available + $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_binary" )); + + // 'Binary' radio button available + $this->assertEquals( "Binary", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[2]/ul/li[1]/label" )); + + // 'UTF-8' radio button available + $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_utf8" )); + + // 'UTF-8' label available + $this->assertEquals( "UTF-8", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[2]/ul/li[2]/label" )); + + // 'Binary' radio button is selected + $this->assertEquals( "on", $this->getValue( "mysql__MysqlCharset_binary" )); + } + + public function testNamePageUI(){ + + $databaseName = DB_NAME_PREFIX."_name_UI"; + parent::navigateNamePage($databaseName); + + // 'Name of wiki' text box available + $this->assertEquals( "Name of wiki:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label" )); + + $this->assertTrue( $this->isElementPresent( "config_wgSitename" )); + + // 'Project namespace' label available + $this->assertEquals( "Project namespace:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/label" )); + + // 'Same as the wiki name' radio button available + $this->assertTrue( $this->isElementPresent( "config__NamespaceType_site-name" )); + + // 'Project' radio button available + $this->assertTrue( $this->isElementPresent( "config__NamespaceType_generic" )); + + // 'Project' radio button available + $this->assertTrue( $this->isElementPresent( "config__NamespaceType_other" )); + + // 'Same as the wiki name' label available + $this->assertEquals( "Same as the wiki name:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]/label" )); + + // 'Project' label available + $this->assertEquals("Project", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]/label" )); + + // 'Project' label available + $this->assertEquals( "Other (specify)", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[3]/label" )); + + // 'Same as the wiki name' radio button selected by default + $this->assertEquals( "on", $this->getValue( "config__NamespaceType_site-name" )); + + // 'Administrator account' section available + $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset" )); + + // 'Administrator account' label available + $this->assertEquals( "Administrator account", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/legend" )); + + // 'Your Name' label available + $this->assertEquals( "Your name:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/label" )); + + // 'Your Name' text box available + $this->assertTrue( $this->isElementPresent( "config__AdminName" )); + + // 'Password' label available + $this->assertEquals( "Password:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[2]/div[1]/label" )); + + // 'Password' text box available + $this->assertTrue( $this->isElementPresent( "config__AdminPassword" )); + + // 'Password again' label available + $this->assertEquals( "Password again:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[3]/div[1]/label" )); + + // 'Password again' text box available + $this->assertTrue( $this->isElementPresent( "config__AdminPassword2" )); + + // 'Email address' label avaialble + $this->assertEquals( "E-mail address:", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/label" )); + + // 'Email address' text box available + $this->assertTrue( $this->isElementPresent( "config__AdminEmail" )); + + // 'Subscribe to the release announcements mailing list. ' check box available + $this->assertTrue( $this->isElementPresent( "config__Subscribe" )); + + // 'Subscribe to the release announcements mailing list. ' label avaialble + $this->assertEquals( "Subscribe to the release announcements mailing list.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/label" )); + + // 'release announcements mailing list' link available + $this->assertTrue( $this->isElementPresent( "link=release announcements mailing list" )); + + // Message displayed + $this->assertEquals( "You are almost done!You can now skip the remaining configuration and install the wiki right now.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[4]/div[2]" )); + + // 'Ask me more questions.' radio button available + $this->assertTrue( $this->isElementPresent( "config__SkipOptional_continue" )); + + // 'Ask me more questions.' label available + $this->assertEquals( "Ask me more questions.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[5]/div[2]/ul/li[1]/label" )); + + // 'I'm bored already, just install the wiki' radio button is avaiable + $this->assertTrue( $this->isElementPresent( "config__SkipOptional_skip" )); + + // 'I'm bored already, just install the wiki' label available + $this->assertEquals( "I'm bored already, just install the wiki.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[5]/div[2]/ul/li[2]/label" )); + + // 'Ask me more questions.' radio button is default selected + $this->assertEquals( "on", $this->getValue( "config__SkipOptional_continue" )); + } + + + + public function testOptionPageUI(){ + + $databaseName = DB_NAME_PREFIX."_options_UI"; + parent::navigateOptionsPage($databaseName); + + // 'Options' label available + $this->assertEquals( "Options", $this->getText("//div[@id='bodyContent']/div/div/h2")); + + // 'Return e-mail address' label available + $this->assertEquals( "Return e-mail address:", $this->getText( "//div[@id='emailwrapper']/div[1]/div[1]/label" )); + + // 'Return e-mail address' text box available + $this->assertTrue( $this->isElementPresent( "config_wgPasswordSender" )); + + // Text 'apache@localhost' is default value of the 'Return e-mail address' text box + $this->assertEquals( "apache@localhost", $this->getValue( "config_wgPasswordSender" )); + + // 'Logo URL' label available + $this->assertEquals( "Logo URL:", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset[2]/div[3]/div[1]/label" )); + + // 'Logo URL' text box available + $this->assertTrue( $this->isElementPresent( "config_wgLogo" )); + + // Correct path available in the 'Logo URL' text box + $this->assertEquals( "/wiki/skins/common/images/wiki.png", $this->getValue( "config_wgLogo" )); + + // 'Enable file uploads' radio button available + $this->assertTrue( $this->isElementPresent( "config_wgEnableUploads" )); + + // 'Enable file uploads' label available + $this->assertEquals( "Enable file uploads", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset[2]/div[1]/label" )); + + // 'Enable file uploads' check box is not selected + $this->assertEquals( "off", $this->getValue( "config_wgEnableUploads" )); + + $this->click( "config_wgEnableUploads" ); + + // 'Directory for deleted files' label available + $this->assertEquals( "Directory for deleted files:", + $this->getText( "//div[@id='uploadwrapper']/div/div[1]/label" )); + + // 'Directory for deleted files' text box available + $this->assertTrue( $this->isElementPresent( "config_wgDeletedDirectory" )); + + // Correct path available in the 'Directory for deleted files' text box + $this->assertEquals( "C:\\wamp\\www\\".DIRECTORY_NAME."/images/deleted", + $this->getValue( "config_wgDeletedDirectory" )); + } + + + + public function testInstallPageUI(){ + + $databaseName = DB_NAME_PREFIX."_install_UI"; + parent::navigateInstallPage( $databaseName ); + + // Verify installation done messages display + $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + $this->assertEquals( "Setting up database... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[1]" )); + $this->assertEquals( "Creating database user... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" )); + $this->assertEquals( "Creating tables... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[3]" )); + $this->assertEquals( "Populating default interwiki table... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[4]" )); + $this->assertEquals( "Generating secret key... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[5]" )); + $this->assertEquals( "Generating default upgrade key... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[6]" )); + $this->assertEquals( "Creating administrator user account... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[7]" )); + $this->assertEquals( "Creating main page with default content... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[8]" )); + } + + + + public function testCompletePageUI(){ + + $databaseName = DB_NAME_PREFIX."_complete_UI"; + parent::navigateCompletePage( $databaseName ); + + // 'Congratulations!' text display + $this->assertEquals( "Congratulations!", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" )); + + // 'LocalSettings.php' generated message display + $this->assertEquals( "The installer has generated a LocalSettings.php file. It contains all your configuration.", + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/p[2]" )); + + // 'Download LocalSettings.php'' link available + $this->assertTrue( $this->isElementPresent( "link=Download LocalSettings.php" )); + + // 'enter your wiki' link available + $this->assertTrue( $this->isElementPresent( "link=enter your wiki" )); + } + + + + public function testRestartInstallation(){ + + parent::navigateConnetToDatabasePage(); + $this->click( "link=Restart installation" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + + // Restart installation' label should be available. + $this->assertEquals( "Restart installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" )); + + //'Do you want to clear all saved data that you have entered and restart the installation process?' label available + $this->assertEquals( "Do you want to clear all saved data that you have entered and restart the installation process?", + $this->getText( "//*[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" )); + // 'Back' button available + $this->assertTrue($this->isElementPresent( "submit-back" )); + + // 'Restart' button available + $this->assertTrue($this->isElementPresent( "submit-restart" )); + } + + + + public function testMediaWikiLogoAvailability(){ + + $databaseName = DB_NAME_PREFIX."_mediawiki_logo"; + parent::navigateInitialpage(); + parent::mediaWikiLogoPresentInitialScreen(); + $this->click( "link=set up the wiki" ); + $this->waitForPageToLoad( PAGE_LOAD_TIME ); + + // 'Language' page + parent::mediaWikiLogoPresent(); + parent::clickContinueButton(); + + // 'Welcome to MediaWiki' page + parent::mediaWikiLogoPresent(); + parent::clickContinueButton(); + + // 'Connet to database' page + parent::mediaWikiLogoPresent(); + $this->type("mysql_wgDBname", $databaseName ); + parent::clickContinueButton(); + + // 'Database setting' page + parent::mediaWikiLogoPresent(); + parent::clickContinueButton(); + + // 'Name' page + parent::mediaWikiLogoPresent(); + parent::completeNamePage(); + parent::clickContinueButton(); + + // 'Options' page + parent::mediaWikiLogoPresent(); + parent::clickContinueButton(); + + // 'Install' page + parent::mediaWikiLogoPresent(); + } + + + public function testRightFramework(){ + + parent::navigateLanguagePage(); + $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[1]/span" )); + $this->assertEquals( "Welcome to MediaWiki!", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[2]/span" )); + $this->assertEquals( "Connect to database", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[3]/span" )); + $this->assertEquals( "Upgrade existing installation", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[4]" )); + $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[5]/span" )); + $this->assertEquals( "Name", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[6]/span" )); + $this->assertEquals( "Options", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[7]/span" )); + $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[8]/span" )); + $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[9]/span" )); + } +} -- 2.20.1