Index: trunk/phase3/tests/installer/MediaWikiErrorsNamepageTestCase.php |
— | — | @@ -0,0 +1,132 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiErrorsNamepageTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +/*
|
| 32 | + * Test Case ID : 10 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 33 | + * Test Case Name : Invalid/ blank values for fields in 'Name' page.
|
| 34 | + * Version : MediaWiki 1.18alpha
|
| 35 | +*/
|
| 36 | +
|
| 37 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 38 | +
|
| 39 | +class MediaWikiErrorsNamepageTestCase extends MediaWikiInstallationCommonFunction {
|
| 40 | +
|
| 41 | + function setUp() {
|
| 42 | + parent::setUp();
|
| 43 | + }
|
| 44 | +
|
| 45 | + // Verify warning message for the 'Name' page
|
| 46 | + public function testErrorsNamePage(){
|
| 47 | +
|
| 48 | + $databaseName = DB_NAME_PREFIX."_error_name";
|
| 49 | +
|
| 50 | + parent::navigateNamePage( $databaseName );
|
| 51 | +
|
| 52 | + // Verify warning message for all blank fields
|
| 53 | + parent::clickContinueButton();
|
| 54 | + $this->assertEquals( "Enter a site name.",
|
| 55 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 56 | + $this->assertEquals( "Enter an administrator username.",
|
| 57 | + $this->getText( "//div[@id='bodyContent']/div/div/div[3]/div[2]" ));
|
| 58 | + $this->assertEquals( "Enter a password for the administrator account.",
|
| 59 | + $this->getText( "//div[@id='bodyContent']/div/div/div[4]/div[2]" ));
|
| 60 | +
|
| 61 | + // Verify warning message for the blank 'Site name'
|
| 62 | + $this->type( "config__AdminName", VALID_YOUR_NAME );
|
| 63 | + $this->type( "config__AdminPassword", VALID_PASSWORD );
|
| 64 | + $this->type( "config__AdminPassword2", VALID_PASSWORD_AGAIN );
|
| 65 | + parent::clickContinueButton();
|
| 66 | + $this->assertEquals( "Enter a site name.",
|
| 67 | + $this->getText(" //div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 68 | +
|
| 69 | + // Input valid 'Site name'
|
| 70 | + $this->type( "config_wgSitename", VALID_WIKI_NAME );
|
| 71 | +
|
| 72 | +
|
| 73 | + // Verify warning message for the invalid "Project namespace'
|
| 74 | + $this->click( "config__NamespaceType_other" );
|
| 75 | + $this->type( "config_wgMetaNamespace", INVALID_NAMESPACE );
|
| 76 | + parent::clickContinueButton();
|
| 77 | + $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.",
|
| 78 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 79 | +
|
| 80 | +
|
| 81 | + // Verify warning message for the blank 'Project namespace'
|
| 82 | + $this->type( "config_wgSitename", VALID_WIKI_NAME );
|
| 83 | + $this->click( "config__NamespaceType_other" );
|
| 84 | + $this->type( "config_wgMetaNamespace" , "" );
|
| 85 | + parent::clickContinueButton();
|
| 86 | + $this->assertEquals( "The specified namespace \"\" is invalid.Specify a different project namespace.",
|
| 87 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 88 | +
|
| 89 | +
|
| 90 | + // Valid 'Project namespace'
|
| 91 | + $this->click( "config__NamespaceType_other" );
|
| 92 | + $this->type( "config_wgMetaNamespace", VALID_NAMESPACE );
|
| 93 | + parent::clickContinueButton();
|
| 94 | +
|
| 95 | +
|
| 96 | + // Valid 'Site name'
|
| 97 | + $this->click( "config__NamespaceType_site-name" );
|
| 98 | + $this->type( "config_wgSitename", VALID_WIKI_NAME );
|
| 99 | +
|
| 100 | +
|
| 101 | + // Verify warning message for blank 'Your name'
|
| 102 | + $this->type( "config__AdminName", " " );
|
| 103 | + parent::clickContinueButton();
|
| 104 | + $this->assertEquals( "Enter an administrator username.",
|
| 105 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 106 | +
|
| 107 | +
|
| 108 | + // Verify warning message for blank 'Password'
|
| 109 | + $this->type( "config__AdminName", VALID_YOUR_NAME );
|
| 110 | + $this->type( "config__AdminPassword", " " );
|
| 111 | + parent::clickContinueButton();
|
| 112 | + $this->assertEquals( "Enter a password for the administrator account.",
|
| 113 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 114 | +
|
| 115 | +
|
| 116 | + // Verify warning message for the blank 'Password again'
|
| 117 | + $this->type( "config_wgSitename", VALID_WIKI_NAME );
|
| 118 | + $this->type( "config__AdminPassword", VALID_PASSWORD );
|
| 119 | + $this->type( "config__AdminPassword2", " " );
|
| 120 | + parent::clickContinueButton();
|
| 121 | + $this->assertEquals( "The two passwords you entered do not match.",
|
| 122 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 123 | +
|
| 124 | +
|
| 125 | + // Verify warning message for the different'Password' and 'Password again'
|
| 126 | + $this->type( "config_wgSitename", VALID_WIKI_NAME );
|
| 127 | + $this->type( "config__AdminPassword", VALID_PASSWORD );
|
| 128 | + $this->type( "config__AdminPassword2", INVALID_PASSWORD_AGAIN );
|
| 129 | + parent::clickContinueButton();
|
| 130 | + $this->assertEquals( "The two passwords you entered do not match.",
|
| 131 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 132 | + }
|
| 133 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiErrorsConnectToDatabasePageTestCase.php |
— | — | @@ -0,0 +1,127 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiErrorsConnectToDatabasePageTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +
|
| 32 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 33 | +
|
| 34 | +/*
|
| 35 | + * Test Case ID : 09 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 36 | + * Test Case Name : Invalid/ blank values for fields in 'Connect to database' page.
|
| 37 | + * Version : MediaWiki 1.18alpha
|
| 38 | +*/
|
| 39 | +
|
| 40 | +class MediaWikiErrorsConnectToDatabasePageTestCase extends MediaWikiInstallationCommonFunction {
|
| 41 | +
|
| 42 | + function setUp(){
|
| 43 | + parent::setUp();
|
| 44 | + }
|
| 45 | +
|
| 46 | + // Verify warning messages for the 'Connet to database' page
|
| 47 | + public function testErrorsConnectToDatabasePage(){
|
| 48 | +
|
| 49 | + parent::navigateConnetToDatabasePage();
|
| 50 | +
|
| 51 | + // Verify warning mesage for invalid database host
|
| 52 | + $this->type( "mysql_wgDBserver", INVALID_DB_HOST );
|
| 53 | + parent::clickContinueButton();
|
| 54 | + $this->assertEquals( "DB connection error: php_network_getaddresses: getaddrinfo failed: No such host is known. (".INVALID_DB_HOST.").Check the host, username and password below and try again.",
|
| 55 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 56 | +
|
| 57 | + // Verify warning message for the blank database host
|
| 58 | + $this->type( "mysql_wgDBserver", "" );
|
| 59 | + parent::clickContinueButton();
|
| 60 | + $this->assertEquals( "MySQL 4.0.14 or later is required, you have .",
|
| 61 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 62 | +
|
| 63 | + // Valid Database Host
|
| 64 | + $this->type( "mysql_wgDBserver", VALID_DB_HOST );
|
| 65 | +
|
| 66 | + // Verify warning message for the invalid database name
|
| 67 | + $this->type( "mysql_wgDBname", INVALID_DB_NAME );
|
| 68 | + parent::clickContinueButton();
|
| 69 | + $this->assertEquals( "Invalid database name \"".INVALID_DB_NAME."\".Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).",
|
| 70 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 71 | +
|
| 72 | + // Verify warning message for the blank database name
|
| 73 | + $this->type( "mysql_wgDBname", "");
|
| 74 | + parent::clickContinueButton();
|
| 75 | + $this->assertEquals( "You must enter a value for \"Database name\"",
|
| 76 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 77 | +
|
| 78 | + // valid Database name
|
| 79 | + $this->type( "mysql_wgDBname", VALID_DB_NAME);
|
| 80 | +
|
| 81 | + // Verify warning message for the invalid databaase prefix
|
| 82 | + $this->type( "mysql_wgDBprefix", INVALID_DB_PREFIX );
|
| 83 | + parent::clickContinueButton();
|
| 84 | + $this->assertEquals( "Invalid database prefix \"".INVALID_DB_PREFIX."\".Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).",
|
| 85 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 86 | +
|
| 87 | + // Valid Database prefix
|
| 88 | + $this->type( "mysql_wgDBprefix", VALID_DB_PREFIX );
|
| 89 | +
|
| 90 | + // Verify warning message for the invalid database user name
|
| 91 | + $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME );
|
| 92 | + parent::clickContinueButton();
|
| 93 | + $this->assertEquals( "DB connection error: Access denied for user '".INVALID_DB_USER_NAME."'@'localhost' (using password: NO) (localhost).Check the host, username and password below and try again.",
|
| 94 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 95 | +
|
| 96 | +
|
| 97 | + // Verify warning message for the invalid database user name
|
| 98 | + $this->type( "mysql__InstallUser", "" );
|
| 99 | + parent::clickContinueButton();
|
| 100 | + $this->assertEquals( "DB connection error: Access denied for user 'SYSTEM'@'localhost' (using password: NO) (localhost).Check the host, username and password below and try again.",
|
| 101 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 102 | +
|
| 103 | + // Valid Database username
|
| 104 | + $this->type( "mysql__InstallUser", VALID_DB_USER_NAME );
|
| 105 | +
|
| 106 | + // Verify warning message for the invalid password
|
| 107 | + $this->type( "mysql__InstallPassword", INVALID_DB_PASSWORD );
|
| 108 | + parent::clickContinueButton();
|
| 109 | + $this->assertEquals( "DB connection error: Access denied for user 'root'@'localhost' (using password: YES) (localhost).Check the host, username and password below and try again.",
|
| 110 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 111 | +
|
| 112 | + // Verify warning message for the invalid username and password
|
| 113 | + $this->type( "mysql__InstallUser", INVALID_DB_USER_NAME );
|
| 114 | + $this->type( "mysql__InstallPassword", INVALID_DB_PASSWORD );
|
| 115 | + parent::clickContinueButton();
|
| 116 | + $this->assertEquals( "DB connection error: Access denied for user '".INVALID_DB_USER_NAME."'@'localhost' (using password: YES) (localhost).Check the host, username and password below and try again.",
|
| 117 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/div[2]" ));
|
| 118 | +
|
| 119 | + // Valid username and valid password
|
| 120 | + $this->type( "mysql__InstallUser", VALID_DB_USER_NAME );
|
| 121 | + $this->type( "mysql__InstallPassword", "" );
|
| 122 | + parent::clickContinueButton();
|
| 123 | +
|
| 124 | + // successfully completes the 'Connect to database' page
|
| 125 | + $this->assertEquals( "Database settings",
|
| 126 | + $this->getText("//div[@id='bodyContent']/div/div/h2" ));
|
| 127 | + }
|
| 128 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiInstallerTestSuite.php |
— | — | @@ -0,0 +1,49 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * MediaWikiInstallerTestSuite |
| 6 | + * |
| 7 | + * @file |
| 8 | + * @ingroup Maintenance |
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com> |
| 10 | + * http://citizendium.org/ |
| 11 | + * |
| 12 | + * This program is free software; you can redistribute it and/or modify |
| 13 | + * it under the terms of the GNU General Public License as published by |
| 14 | + * the Free Software Foundation; either version 2 of the License, or |
| 15 | + * (at your option) any later version. |
| 16 | + * |
| 17 | + * This program is distributed in the hope that it will be useful, |
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | + * GNU General Public License for more details. |
| 21 | + * |
| 22 | + * You should have received a copy of the GNU General Public License along |
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc., |
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 25 | + * http://www.gnu.org/copyleft/gpl.html |
| 26 | + * |
| 27 | + * @addtogroup Maintenance |
| 28 | + * |
| 29 | + */ |
| 30 | + |
| 31 | +require_once 'PHPUnit/Framework.php'; |
| 32 | +require_once 'PHPUnit/Framework/TestSuite.php'; |
| 33 | + |
| 34 | +require_once 'MediaWikiUserInterfaceTestCase.php'; |
| 35 | +require_once 'MediaWikiButtonsAvailabilityTestCase.php'; |
| 36 | +require_once 'MediaWikiHelpFieldHintTestCase.php'; |
| 37 | +require_once 'MediaWikiRightFrameworkLinksTestCase.php'; |
| 38 | +require_once 'MediaWikiRestartInstallationTestCase.php'; |
| 39 | +require_once 'MediaWikiErrorsConnectToDatabasePageTestCase.php'; |
| 40 | +require_once 'MediaWikiErrorsNamepageTestCase.php'; |
| 41 | +require_once 'MediaWikiMySQLDataBaseTestCase.php'; |
| 42 | +require_once 'MediaWikiMySQLiteDataBaseTestCase.php'; |
| 43 | +require_once 'MediaWikiUpgradeExistingDatabaseTestCase.php'; |
| 44 | +require_once 'MediaWikiDifferntDatabasePrefixTestCase.php'; |
| 45 | +require_once 'MediaWikiDifferentDatabaseAccountTestCase.php'; |
| 46 | + |
| 47 | +$suite = new PHPUnit_Framework_TestSuite('ArrayTest'); |
| 48 | +$result = new PHPUnit_Framework_TestResult; |
| 49 | + |
| 50 | +$suite->run($result); |
Index: trunk/phase3/tests/installer/MediaWikiOnAlreadyInstalledTestCase.php |
— | — | @@ -0,0 +1,74 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * Selenium server manager
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +
|
| 32 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 33 | +
|
| 34 | +
|
| 35 | +/*
|
| 36 | + * Test Case ID : 03 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 37 | + * Test Case Name : Install mediawiki on a already installed Mediawiki.]
|
| 38 | + * Version : MediaWiki 1.18alpha
|
| 39 | +*/
|
| 40 | +
|
| 41 | +class MediaWikiOnAlreadyInstalledTestCase extends MediaWikiInstallationCommonFunction {
|
| 42 | +
|
| 43 | + function setUp() {
|
| 44 | + parent::setUp();
|
| 45 | + }
|
| 46 | +
|
| 47 | + // Install Mediawiki using 'MySQL' database type.
|
| 48 | + public function testInstallOnAlreadyInstalled() {
|
| 49 | +
|
| 50 | + $databaseName = DB_NAME_PREFIX."_already_installed";
|
| 51 | + parent::navigateInstallPage( $databaseName );
|
| 52 | +
|
| 53 | + // 'Options' page
|
| 54 | + parent::clickBackButton();
|
| 55 | +
|
| 56 | + // Install page
|
| 57 | + parent::clickContinueButton();
|
| 58 | +
|
| 59 | + // 'Install' page should display after the 'Option' page
|
| 60 | + $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 61 | +
|
| 62 | + // Verify warning text displayed
|
| 63 | + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.",
|
| 64 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
|
| 65 | +
|
| 66 | + // Complete page
|
| 67 | + parent::clickContinueButton();
|
| 68 | +
|
| 69 | + // Clicking in the 'Continue' button should display the 'Complete' page with 'Congratulations!' text.
|
| 70 | + $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 71 | + $this->assertEquals( "Congratulations!", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
|
| 72 | + $this->chooseCancelOnNextConfirmation();
|
| 73 | + parent::restartInstallation();
|
| 74 | + }
|
| 75 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiHelpFieldHintTestCase.php |
— | — | @@ -0,0 +1,144 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiHelpFieldHintTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +/*
|
| 32 | + * Test Case ID : 29 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 33 | + * Test Case Name : Help field hint availability for the fields.
|
| 34 | + * Version : MediaWiki 1.18alpha
|
| 35 | +*/
|
| 36 | +
|
| 37 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 38 | +
|
| 39 | +class MediaWikiHelpFieldHintTestCase extends MediaWikiInstallationCommonFunction {
|
| 40 | +
|
| 41 | + function setUp(){
|
| 42 | + parent::setUp();
|
| 43 | + }
|
| 44 | +
|
| 45 | +
|
| 46 | + // Verify help field availability for the fields
|
| 47 | + public function testMySQLConnectToDatabaseFieldHint(){
|
| 48 | +
|
| 49 | + parent::navigateConnetToDatabasePage();
|
| 50 | +
|
| 51 | + // Verify help field for 'Database host'
|
| 52 | + $this->click( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[1]" );
|
| 53 | + $this->assertEquals( MYSQL_DATABASE_HOST_HELP,
|
| 54 | + $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[2]" ) );
|
| 55 | +
|
| 56 | + // Verify help field for 'Database name'
|
| 57 | + $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[1]" );
|
| 58 | + $this->assertEquals( MYSQL_DATABASE_NAME_HELP,
|
| 59 | + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]" ));
|
| 60 | +
|
| 61 | +
|
| 62 | + // Verify help field for 'Database table prefix'
|
| 63 | + $this->click("//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/div/span[1]" );
|
| 64 | + $this->assertEquals(MYSQL_DATABASE_TABLE_PREFIX_HELP,
|
| 65 | + $this->getText("//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]/p[1]" ));
|
| 66 | +
|
| 67 | + // Verify help field for 'Database username'
|
| 68 | + $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[1]" );
|
| 69 | + $this->assertEquals( MYSQL_DATBASE_USERNAME_HELP,
|
| 70 | + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[2]" ));
|
| 71 | +
|
| 72 | + // Verify help field for 'Database password'
|
| 73 | + $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[1]" );
|
| 74 | + $this->assertEquals( MYSQL_DATABASE_PASSWORD_HELP,
|
| 75 | + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[2]/p" ));
|
| 76 | + }
|
| 77 | +
|
| 78 | +
|
| 79 | + public function testSQLiteConnectToDatabaseFieldHint(){
|
| 80 | +
|
| 81 | + parent::navigateConnetToDatabasePage();
|
| 82 | + $this->click( "DBType_sqlite" );
|
| 83 | +
|
| 84 | + // Verify help field for 'SQLite data directory'
|
| 85 | + $this->click( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[1]" );
|
| 86 | + $this->assertEquals( SQLITE_DATA_DIRECTORY_HELP,
|
| 87 | + $this->getText( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[2]" ));
|
| 88 | +
|
| 89 | + // Verify help field for 'Database name'
|
| 90 | + $this->click( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[1]" );
|
| 91 | + $this->assertEquals( SQLITE_DATABASE_NAME_HELP , $this->getText( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[2]/p" ));
|
| 92 | + }
|
| 93 | +
|
| 94 | +
|
| 95 | + public function testDatabaseSettingsFieldHint(){
|
| 96 | +
|
| 97 | + $databaseName = DB_NAME_PREFIX."_db_field";
|
| 98 | + parent::navigateDatabaseSettingsPage($databaseName);
|
| 99 | +
|
| 100 | + // Verify help field for 'Search engine'
|
| 101 | + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/span[1]" );
|
| 102 | + $this->assertEquals( SEARCH_ENGINE_HELP,
|
| 103 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/span[2]" ));
|
| 104 | +
|
| 105 | + // Verify help field for 'Database character set'
|
| 106 | + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[4]/span[1]" );
|
| 107 | + $this->assertEquals( DATABASE_CHARACTER_SET_HELP,
|
| 108 | + $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[4]/span[2]"));
|
| 109 | + parent::restartInstallation();
|
| 110 | + }
|
| 111 | +
|
| 112 | +
|
| 113 | + public function testNameFieldHint(){
|
| 114 | +
|
| 115 | + $databaseName = DB_NAME_PREFIX."_name_field";
|
| 116 | + parent::navigateNamePage( $databaseName );
|
| 117 | +
|
| 118 | + // Verify help field for 'Name of Wiki'
|
| 119 | + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/div/span[1]" );
|
| 120 | + $this->assertEquals( NAME_OF_WIKI_HELP,
|
| 121 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/div/span[2]/p" ));
|
| 122 | +
|
| 123 | + // Verify help field for 'Project namespace'
|
| 124 | + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/div/span[1]" );
|
| 125 | + $this->assertEquals( PROJECT_NAMESPACE_HELP,
|
| 126 | + $this->getText("//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/div/span[2]/p"));
|
| 127 | +
|
| 128 | + // Verify help field for 'Your Name'
|
| 129 | + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/div/span[1]" );
|
| 130 | + $this->assertEquals( USER_NAME_HELP,
|
| 131 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/div/span[2]/p" ));
|
| 132 | +
|
| 133 | + // Verify help field for 'E mail address'
|
| 134 | + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/div/span[1]" );
|
| 135 | + $this->assertEquals( EMAIL_ADDRESS_HELP,
|
| 136 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/div/span[2]/p" ));
|
| 137 | +
|
| 138 | + // Verify help field for 'Subscribe to the release announcements mailing list'
|
| 139 | + $this->click( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/div/span[1]" );
|
| 140 | + $this->assertEquals( SUBSCRIBE_MAILING_LIST_HELP,
|
| 141 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/div/span[2]/p" ));
|
| 142 | + parent::restartInstallation();
|
| 143 | + }
|
| 144 | +}
|
| 145 | +
|
Index: trunk/phase3/tests/installer/MediaWikiInstallationCommonFunction.php |
— | — | @@ -0,0 +1,271 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * MediaWikiInstallationCommonFunction |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Maintenance |
| 8 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com> |
| 9 | + * http://citizendium.org/ |
| 10 | + * |
| 11 | + * This program is free software; you can redistribute it and/or modify |
| 12 | + * it under the terms of the GNU General Public License as published by |
| 13 | + * the Free Software Foundation; either version 2 of the License, or |
| 14 | + * (at your option) any later version. |
| 15 | + * |
| 16 | + * This program is distributed in the hope that it will be useful, |
| 17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | + * GNU General Public License for more details. |
| 20 | + * |
| 21 | + * You should have received a copy of the GNU General Public License along |
| 22 | + * with this program; if not, write to the Free Software Foundation, Inc., |
| 23 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 24 | + * http://www.gnu.org/copyleft/gpl.html |
| 25 | + * |
| 26 | + * @addtogroup Maintenance |
| 27 | + * |
| 28 | + */ |
| 29 | + |
| 30 | +require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; |
| 31 | +include 'MediaWikiInstallationConfig.php'; |
| 32 | + |
| 33 | +class MediaWikiInstallationCommonFunction extends PHPUnit_Extensions_SeleniumTestCase { |
| 34 | + |
| 35 | + function setUp() { |
| 36 | + $this->setBrowser("*chrome"); |
| 37 | + $this->setBrowserUrl("http://localhost:".PORT."/".DIRECTORY_NAME."/"); |
| 38 | + } |
| 39 | + |
| 40 | + |
| 41 | + public function navigateInitialpage(){ |
| 42 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/" ); |
| 43 | + } |
| 44 | + |
| 45 | + |
| 46 | + // Navigate to the 'Language' page |
| 47 | + public function navigateLanguagePage(){ |
| 48 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); |
| 49 | + } |
| 50 | + |
| 51 | + |
| 52 | + // Navigate to the 'Welcome to MediaWiki' page |
| 53 | + public function navigateWelcometoMediaWikiPage(){ |
| 54 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); |
| 55 | + $this->click( "submit-continue "); |
| 56 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 57 | + } |
| 58 | + |
| 59 | + |
| 60 | + // Navigate yo 'Connect to Database' page |
| 61 | + public function navigateConnetToDatabasePage(){ |
| 62 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); |
| 63 | + |
| 64 | + // 'Welcome to MediaWiki!' page |
| 65 | + $this->click( "submit-continue" ); |
| 66 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 67 | + |
| 68 | + // 'Connect to Database' page |
| 69 | + $this->click("submit-continue"); |
| 70 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 71 | + } |
| 72 | + |
| 73 | + |
| 74 | + // Navigate to the 'Database Settings' page |
| 75 | + public function navigateDatabaseSettingsPage( $databaseName ){ |
| 76 | + |
| 77 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); |
| 78 | + |
| 79 | + // 'Welcome to MediaWiki!' page |
| 80 | + $this->click("submit-continue"); |
| 81 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 82 | + |
| 83 | + // 'Connect to Database' page |
| 84 | + $this->click("submit-continue"); |
| 85 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 86 | + |
| 87 | + $this->type("mysql_wgDBname", $databaseName ); |
| 88 | + $this->click( "submit-continue" ); |
| 89 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 90 | + } |
| 91 | + |
| 92 | + |
| 93 | + // Navigate to the 'Name' page |
| 94 | + public function navigateNamePage( $databaseName ){ |
| 95 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); |
| 96 | + |
| 97 | + // 'Welcome to MediaWiki!' page |
| 98 | + $this->click( "submit-continue" ); |
| 99 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 100 | + |
| 101 | + // 'Connect to Database' page |
| 102 | + $this->click( "submit-continue" ); |
| 103 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 104 | + |
| 105 | + $this->type( "mysql_wgDBname", $databaseName ); |
| 106 | + $this->click( "submit-continue" ); |
| 107 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 108 | + |
| 109 | + // Database settings |
| 110 | + $this->click( "submit-continue" ); |
| 111 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 112 | + } |
| 113 | + |
| 114 | + |
| 115 | + // Navigate 'Options' page |
| 116 | + public function navigateOptionsPage( $databaseName ){ |
| 117 | + |
| 118 | + $upgradeExisting = false; |
| 119 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); |
| 120 | + |
| 121 | + // 'Welcome to MediaWiki!' page |
| 122 | + $this->click( "submit-continue" ); |
| 123 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 124 | + |
| 125 | + // 'Connect to Database' page |
| 126 | + $this->click( "submit-continue" ); |
| 127 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 128 | + |
| 129 | + $this->type( "mysql_wgDBname", $databaseName ); |
| 130 | + $this->click( "submit-continue" ); |
| 131 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 132 | + |
| 133 | + // Database settings |
| 134 | + $this->click( "submit-continue" ); |
| 135 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 136 | + |
| 137 | + // Name |
| 138 | + $this->type( "config_wgSitename", NAME_OF_WIKI ); |
| 139 | + $this->type( "config__AdminName", ADMIN_USER_NAME); |
| 140 | + $this->type( "config__AdminPassword", ADMIN_PASSWORD ); |
| 141 | + $this->type( "config__AdminPassword2", ADMIN_RETYPE_PASSWORD ); |
| 142 | + $this->type( "config__AdminEmail", ADMIN_EMAIL_ADDRESS ); |
| 143 | + |
| 144 | + $this->click( "submit-continue" ); |
| 145 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 146 | + } |
| 147 | + |
| 148 | + |
| 149 | + // Navigate 'Install' page |
| 150 | + public function navigateInstallPage( $databaseName ){ |
| 151 | + |
| 152 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); |
| 153 | + |
| 154 | + // 'Welcome to MediaWiki!' page |
| 155 | + $this->click( "submit-continue" ); |
| 156 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 157 | + |
| 158 | + // 'Connect to Database' page |
| 159 | + $this->click( "submit-continue" ); |
| 160 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 161 | + |
| 162 | + $this->type( "mysql_wgDBname", $databaseName ); |
| 163 | + $this->click( "submit-continue" ); |
| 164 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 165 | + |
| 166 | + // Database settings |
| 167 | + $this->click( "submit-continue" ); |
| 168 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 169 | + |
| 170 | + // Name |
| 171 | + $this->type( "config_wgSitename", NAME_OF_WIKI ); |
| 172 | + $this->type( "config__AdminName", ADMIN_USER_NAME); |
| 173 | + $this->type( "config__AdminPassword", ADMIN_PASSWORD ); |
| 174 | + $this->type( "config__AdminPassword2", ADMIN_RETYPE_PASSWORD ); |
| 175 | + $this->type( "config__AdminEmail", ADMIN_EMAIL_ADDRESS ); |
| 176 | + |
| 177 | + $this->click( "submit-continue" ); |
| 178 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 179 | + |
| 180 | + // Options page |
| 181 | + $this->click( "submit-continue" ); |
| 182 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 183 | + } |
| 184 | + |
| 185 | + |
| 186 | + // Navigate to 'Complete' page |
| 187 | + public function navigateCompletePage( $databaseName ){ |
| 188 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" ); |
| 189 | + |
| 190 | + // 'Welcome to MediaWiki!' page |
| 191 | + $this->click( "submit-continue" ); |
| 192 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 193 | + |
| 194 | + // 'Connect to Database' page |
| 195 | + $this->click( "submit-continue" ); |
| 196 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 197 | + |
| 198 | + $this->type( "mysql_wgDBname", $databaseName ); |
| 199 | + $this->click( "submit-continue" ); |
| 200 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 201 | + |
| 202 | + // Database settings |
| 203 | + $this->click( "submit-continue" ); |
| 204 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 205 | + |
| 206 | + // Name |
| 207 | + $this->type( "config_wgSitename", NAME_OF_WIKI ); |
| 208 | + $this->type( "config__AdminName", ADMIN_USER_NAME); |
| 209 | + $this->type( "config__AdminPassword", ADMIN_PASSWORD ); |
| 210 | + $this->type( "config__AdminPassword2", ADMIN_RETYPE_PASSWORD ); |
| 211 | + $this->type( "config__AdminEmail", ADMIN_EMAIL_ADDRESS ); |
| 212 | + |
| 213 | + $this->click( "submit-continue" ); |
| 214 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 215 | + |
| 216 | + // Options page |
| 217 | + $this->click( "submit-continue" ); |
| 218 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 219 | + |
| 220 | + // Install page |
| 221 | + $this->click( "submit-continue" ); |
| 222 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 223 | + $this->chooseCancelOnNextConfirmation(); |
| 224 | + } |
| 225 | + |
| 226 | + |
| 227 | + // Complete the Name page fields |
| 228 | + public function completeNamePage(){ |
| 229 | + $this->type( "config_wgSitename", NAME_OF_WIKI ); |
| 230 | + $this->type( "config__AdminName", ADMIN_USER_NAME); |
| 231 | + $this->type( "config__AdminPassword", ADMIN_PASSWORD ); |
| 232 | + $this->type( "config__AdminPassword2", ADMIN_RETYPE_PASSWORD ); |
| 233 | + $this->type( "config__AdminEmail", ADMIN_EMAIL_ADDRESS ); |
| 234 | + $this->click( "submit-continue" ); |
| 235 | + $this->waitForPageToLoad( PAGE_LOAD_TIME); |
| 236 | + } |
| 237 | + |
| 238 | + |
| 239 | + // Clicking on the 'Continue' button in any MediaWiki page |
| 240 | + public function clickContinueButton(){ |
| 241 | + $this->click( "submit-continue" ); |
| 242 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 243 | + } |
| 244 | + |
| 245 | + |
| 246 | + // Clicking on the 'Back' button in any MediaWiki page |
| 247 | + public function clickBackButton(){ |
| 248 | + $this->click( "submit-back" ); |
| 249 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 250 | + } |
| 251 | + |
| 252 | + |
| 253 | + // Restarting the installation |
| 254 | + public function restartInstallation(){ |
| 255 | + $this->click( "link=Restart installation" ); |
| 256 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 257 | + $this->click( "submit-restart" ); |
| 258 | + $this->waitForPageToLoad( PAGE_LOAD_TIME ); |
| 259 | + } |
| 260 | + |
| 261 | + |
| 262 | + // Verify 'MediaWiki' logo available in the initial screen |
| 263 | + public function mediaWikiLogoPresentInitialScreen(){ |
| 264 | + $this->assertTrue($this->isElementPresent("//img[@alt='The MediaWiki logo']")); |
| 265 | + } |
| 266 | + |
| 267 | + |
| 268 | + // Verify 'MediaWiki' logo available |
| 269 | + public function mediaWikiLogoPresent(){ |
| 270 | + $this->assertTrue($this->isElementPresent("//div[@id='p-logo']/a")); |
| 271 | + } |
| 272 | +} |
Index: trunk/phase3/tests/installer/MediaWikiUpgradeExistingDatabaseTestCase.php |
— | — | @@ -0,0 +1,113 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiUpgradeExistingDatabaseTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +
|
| 32 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 33 | +
|
| 34 | +/*
|
| 35 | + * Test Case ID : 05 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 36 | + * Test Case Name : Install Mediawiki by updating the existing database.
|
| 37 | + * Version : MediaWiki 1.18alpha
|
| 38 | +*/
|
| 39 | +
|
| 40 | +
|
| 41 | +class MediaWikiUpgradeExistingDatabaseTestCase extends MediaWikiInstallationCommonFunction {
|
| 42 | +
|
| 43 | + function setUp(){
|
| 44 | + parent::setUp();
|
| 45 | + }
|
| 46 | +
|
| 47 | + // Install Mediawiki using 'MySQL' database type.
|
| 48 | + public function testUpgradeExistingDatabase(){
|
| 49 | +
|
| 50 | + $databaseName = DB_NAME_PREFIX."_upgrade_existing";
|
| 51 | + parent::navigateInstallPage( $databaseName );
|
| 52 | +
|
| 53 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
|
| 54 | + $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 55 | + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.",
|
| 56 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
|
| 57 | +
|
| 58 | + // 'Optionis' page
|
| 59 | + parent::clickBackButton();
|
| 60 | +
|
| 61 | + // 'Name' page
|
| 62 | + parent::clickBackButton();
|
| 63 | +
|
| 64 | + // 'Database settings' page
|
| 65 | + parent::clickBackButton();
|
| 66 | +
|
| 67 | + // 'Connect to database' page
|
| 68 | + parent::clickBackButton();
|
| 69 | + $this->type( "mysql_wgDBname", $databaseName );
|
| 70 | + parent::clickContinueButton();
|
| 71 | +
|
| 72 | + // 'Upgrade existing installation' page displayed next to the 'Connect to database' page.
|
| 73 | + $this->assertEquals( "Upgrade existing installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 74 | +
|
| 75 | + // Warning message displayed.
|
| 76 | + $this->assertEquals( "There are MediaWiki tables in this database.To upgrade them to MediaWiki 1.18alpha, click Continue.",
|
| 77 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
|
| 78 | +
|
| 79 | + parent::clickContinueButton();
|
| 80 | + $this->assertEquals( "Upgrade existing installation",
|
| 81 | + $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 82 | +
|
| 83 | + // 'Upgrade complete.' text display
|
| 84 | + $this->assertEquals( "Upgrade complete.You can now start using your wiki. \nIf you want to regenerate your LocalSettings.php file, click the button below. This is not recommended unless you are having problems with your wiki.",
|
| 85 | + $this->getText( "//div[@id='bodyContent']/div/div/div[4]/form/div[1]/div[2]"));
|
| 86 | +
|
| 87 | + $this->assertTrue($this->isElementPresent( "submit-regenerate" ));
|
| 88 | + $this->click( "submit-regenerate" );
|
| 89 | + $this->waitForPageToLoad( PAGE_LOAD_TIME );
|
| 90 | + $this->assertEquals( "Database settings",
|
| 91 | + $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 92 | +
|
| 93 | + // 'Database settings' page
|
| 94 | + parent::clickContinueButton();
|
| 95 | +
|
| 96 | + // Name page
|
| 97 | + parent::completeNamePage();
|
| 98 | +
|
| 99 | + // Options page
|
| 100 | + parent::clickContinueButton();
|
| 101 | +
|
| 102 | + // Install page
|
| 103 | + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.",
|
| 104 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
|
| 105 | + parent::clickContinueButton();
|
| 106 | +
|
| 107 | + // complete
|
| 108 | + $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 109 | + $this->assertEquals( "Congratulations!",
|
| 110 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
|
| 111 | + $this->chooseCancelOnNextConfirmation();
|
| 112 | + parent::restartInstallation();
|
| 113 | + }
|
| 114 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiButtonsAvailabilityTestCase.php |
— | — | @@ -0,0 +1,118 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiButtonsAvailabilityTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +
|
| 32 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 33 | +
|
| 34 | +/*
|
| 35 | + * Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 36 | + * Test Case Name :'Back' and 'Continue' button availability
|
| 37 | + * Version : MediaWiki 1.18alpha
|
| 38 | +*/
|
| 39 | +
|
| 40 | +class MediaWikiButtonsAvailabilityTestCase extends MediaWikiInstallationCommonFunction {
|
| 41 | +
|
| 42 | + function setUp() {
|
| 43 | + parent::setUp();
|
| 44 | + }
|
| 45 | +
|
| 46 | +
|
| 47 | + // Verify only 'Continue' button available on 'Language' page
|
| 48 | + public function testOnlyContinueButtonAvailability() {
|
| 49 | +
|
| 50 | + parent::navigateLanguagePage();
|
| 51 | +
|
| 52 | + // Verify only 'Continue' button avaialble
|
| 53 | + $this->assertTrue( $this->isElementPresent( "submit-continue" ));
|
| 54 | +
|
| 55 | + // 'Back' button is not avaialble
|
| 56 | + $this->assertElementNotPresent( "submit-back" );
|
| 57 | + }
|
| 58 | +
|
| 59 | +
|
| 60 | + // Verify 'Continue' and 'Back' buttons availability
|
| 61 | + public function testBothButtonsAvailability() {
|
| 62 | +
|
| 63 | + // Verify buttons availability on 'Welcome to MediaWiki' page
|
| 64 | + parent::navigateWelcometoMediaWikiPage();
|
| 65 | + $this->assertTrue( $this->isElementPresent( "submit-back" ));
|
| 66 | + $this->assertTrue( $this->isElementPresent( "submit-continue" ));
|
| 67 | + parent::restartInstallation();
|
| 68 | +
|
| 69 | + // Verify buttons availability on 'Connect to Database' page
|
| 70 | + parent::navigateConnetToDatabasePage();
|
| 71 | + $this->assertTrue( $this->isElementPresent( "submit-back" ));
|
| 72 | + $this->assertTrue( $this->isElementPresent( "submit-continue" ));
|
| 73 | + parent::restartInstallation();
|
| 74 | +
|
| 75 | + // Verify buttons availability on 'Database settings' page
|
| 76 | + $databaseName = DB_NAME_PREFIX."_db_settings";
|
| 77 | + parent::navigateDatabaseSettingsPage( $databaseName );
|
| 78 | + $this->assertTrue( $this->isElementPresent( "submit-back" ));
|
| 79 | + $this->assertTrue( $this->isElementPresent( "submit-continue" ));
|
| 80 | + parent::restartInstallation();
|
| 81 | +
|
| 82 | + // Verify buttons availability on 'Name' page
|
| 83 | + $databaseName = DB_NAME_PREFIX."_name";
|
| 84 | + parent::navigateNamePage( $databaseName );
|
| 85 | + $this->assertTrue( $this->isElementPresent( "submit-back" ));
|
| 86 | + $this->assertTrue( $this->isElementPresent( "submit-continue" ));
|
| 87 | + parent::restartInstallation();
|
| 88 | +
|
| 89 | + // Verify buttons availability on 'Options' page
|
| 90 | + $databaseName = DB_NAME_PREFIX."_options";
|
| 91 | + parent::navigateOptionsPage( $databaseName );
|
| 92 | + $this->assertTrue( $this->isElementPresent( "submit-back" ));
|
| 93 | + $this->assertTrue( $this->isElementPresent( "submit-continue" ));
|
| 94 | + parent::restartInstallation();
|
| 95 | +
|
| 96 | + // Verify buttons availability on 'Install' page
|
| 97 | + $databaseName = DB_NAME_PREFIX."_install";
|
| 98 | + parent::navigateInstallPage($databaseName);
|
| 99 | + $this->assertTrue( $this->isElementPresent( "submit-back" ));
|
| 100 | + $this->assertTrue( $this->isElementPresent( "submit-continue" ));
|
| 101 | + }
|
| 102 | +
|
| 103 | +
|
| 104 | + // Verify only 'Back' button available on 'Complete' page
|
| 105 | + public function testOnlyBackButtonAvailability() {
|
| 106 | +
|
| 107 | + // Verify only 'Back' button available
|
| 108 | + $databaseName = DB_NAME_PREFIX."_back";
|
| 109 | + parent::navigateCompletePage( $databaseName );
|
| 110 | +
|
| 111 | + // Only 'Back' button available
|
| 112 | + $this->assertTrue( $this->isElementPresent( "submit-back" ));
|
| 113 | +
|
| 114 | + // 'Continue' button is not available
|
| 115 | + $this->assertElementNotPresent( "submit-continue" );
|
| 116 | + parent::restartInstallation();
|
| 117 | + }
|
| 118 | +}
|
| 119 | +
|
Index: trunk/phase3/tests/installer/MediaWikiMySQLDataBaseTestCase.php |
— | — | @@ -0,0 +1,83 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiOnAlreadyInstalledTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +
|
| 32 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 33 | +
|
| 34 | +/*
|
| 35 | + * Test Case ID : 01 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 36 | + * Test Case Name : Install Mediawiki using 'MySQL' database type successfully
|
| 37 | + * Version : MediaWiki 1.18alpha
|
| 38 | +*/
|
| 39 | +
|
| 40 | +class MediaWikiMySQLDataBaseTestCase extends MediaWikiInstallationCommonFunction {
|
| 41 | +
|
| 42 | + function setUp(){
|
| 43 | + parent::setUp();
|
| 44 | + }
|
| 45 | +
|
| 46 | + // Verify MediaWiki installation using 'MySQL' database type
|
| 47 | + public function testMySQLDatabaseSuccess(){
|
| 48 | +
|
| 49 | + $databaseName = DB_NAME_PREFIX."_sql_db";
|
| 50 | +
|
| 51 | + parent::navigateConnetToDatabasePage();
|
| 52 | +
|
| 53 | + // Verify 'MySQL" is selected as the default database type
|
| 54 | + $this->assertEquals( "MySQL settings", $this->getText( "//div[@id='DB_wrapper_mysql']/h3" ));
|
| 55 | +
|
| 56 | + // Change 'Database name'
|
| 57 | + $defaultDbName = $this->getText( "mysql_wgDBname" );
|
| 58 | + $this->type( "mysql_wgDBname", " ");
|
| 59 | + $this->type( "mysql_wgDBname", $databaseName );
|
| 60 | + $this->assertNotEquals( $defaultDbName, $databaseName );
|
| 61 | +
|
| 62 | + // 'Database settings' page
|
| 63 | + parent::clickContinueButton();
|
| 64 | +
|
| 65 | + // 'Name' page
|
| 66 | + parent::clickContinueButton();
|
| 67 | + parent::completeNamePage();
|
| 68 | +
|
| 69 | + // 'Options page
|
| 70 | + parent::clickContinueButton();
|
| 71 | +
|
| 72 | + // 'Install' page
|
| 73 | + parent::clickContinueButton();
|
| 74 | +
|
| 75 | + // 'Complete' page
|
| 76 | + $this->assertEquals( "Complete!",
|
| 77 | + $this->getText("//div[@id='bodyContent']/div/div/h2" ));
|
| 78 | +
|
| 79 | + // 'Congratulations!' text should be available in the 'Complete!' page.
|
| 80 | + $this->assertEquals( "Congratulations!",
|
| 81 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
|
| 82 | + parent::restartInstallation();
|
| 83 | + }
|
| 84 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiInstallationConfig.php |
— | — | @@ -0,0 +1,111 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * MediaWikiInstallationConfig |
| 6 | + * |
| 7 | + * @file |
| 8 | + * @ingroup Maintenance |
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com> |
| 10 | + * http://citizendium.org/ |
| 11 | + * |
| 12 | + * This program is free software; you can redistribute it and/or modify |
| 13 | + * it under the terms of the GNU General Public License as published by |
| 14 | + * the Free Software Foundation; either version 2 of the License, or |
| 15 | + * (at your option) any later version. |
| 16 | + * |
| 17 | + * This program is distributed in the hope that it will be useful, |
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | + * GNU General Public License for more details. |
| 21 | + * |
| 22 | + * You should have received a copy of the GNU General Public License along |
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc., |
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 25 | + * http://www.gnu.org/copyleft/gpl.html |
| 26 | + * |
| 27 | + * @addtogroup Maintenance |
| 28 | + * |
| 29 | + */ |
| 30 | + |
| 31 | + |
| 32 | +/* |
| 33 | + * MediaWikiInstallerTestSuite.php can be run one time successfully |
| 34 | + * with current value of the 'DB_NAME_PREFIX'. |
| 35 | + * If you wish to run the suite more than one time, you need to change |
| 36 | + * the value of the 'DB_NAME_PREFIX'. |
| 37 | + */ |
| 38 | +define('DB_NAME_PREFIX', "database_name_d" ); |
| 39 | + |
| 40 | +// Directory name should be change |
| 41 | +//define('DIRECTORY_NAME', "installertesting"); |
| 42 | +define('DIRECTORY_NAME', "nadee"); |
| 43 | + |
| 44 | +// Port should be change |
| 45 | +define ('PORT', "8080"); |
| 46 | + |
| 47 | +// Common variables |
| 48 | +define('PAGE_LOAD_TIME', "80000" ); |
| 49 | + |
| 50 | + |
| 51 | +// 'MySQL' database type help field hint |
| 52 | +define('MYSQL_DATABASE_HOST_HELP', "If your database server is on different server, enter the host name or IP address here. \nIf you are using shared web hosting, your hosting provider should give you the correct host name in their documentation. \nIf you are installing on a Windows server and using MySQL, using \"localhost\" may not work for the server name. If it does not, try \"127.0.0.1\" for the local IP address."); |
| 53 | +define('MYSQL_DATABASE_NAME_HELP', "Choose a name that identifies your wiki. It should not contain spaces or hyphens. \nIf you are using shared web hosting, your hosting provider will either give you a specific database name to use or let you create databases via a control panel."); |
| 54 | +define('MYSQL_DATABASE_TABLE_PREFIX_HELP', "Choose a name that identifies your wiki. It should not contain spaces or hyphens."); |
| 55 | +define('MYSQL_DATBASE_USERNAME_HELP', "Enter the username that will be used to connect to the database during the installation process. This is not the username of the MediaWiki account; this is the username for your database."); |
| 56 | +define('MYSQL_DATABASE_PASSWORD_HELP', "Enter the password that will be used to connect to the database during the installation process. This is not the password for the MediaWiki account; this is the password for your database."); |
| 57 | + |
| 58 | +// 'SQLite' database type help field hint |
| 59 | +define('SQLITE_DATA_DIRECTORY_HELP', "SQLite stores all data in a single file. \nThe directory you provide must be writable by the webserver during installation. \nIt should not be accessible via the web, this is why we're not putting it where your PHP files are. \nThe installer will write a .htaccess file along with it, but if that fails someone can gain access to your raw database. That includes raw user data (e-mail addresses, hashed passwords) as well as deleted revisions and other restricted data on the wiki. \nConsider putting the database somewhere else altogether, for example in /var/lib/mediawiki/yourwiki."); |
| 60 | +define('SQLITE_DATABASE_NAME_HELP', "Choose a name that identifies your wiki. Do not use spaces or hyphens. This will be used for the SQLite data file name."); |
| 61 | + |
| 62 | +// 'Database settings' page hel0p field hint |
| 63 | +define('SEARCH_ENGINE_HELP', "InnoDB is almost always the best option, since it has good concurrency support. \nMyISAM may be faster in single-user or read-only installations. MyISAM databases tend to get corrupted more often than InnoDB databases."); |
| 64 | +define('DATABASE_CHARACTER_SET_HELP', "In binary mode, MediaWiki stores UTF-8 text to the database in binary fields. This is more efficient than MySQL's UTF-8 mode, and allows you to use the full range of Unicode characters. \nIn UTF-8 mode, MySQL will know what character set your data is in, and can present and convert it appropriately, but it will not let you store characters above the Basic Multilingual Plane."); |
| 65 | + |
| 66 | +// 'Name' page help field hint |
| 67 | +define('NAME_OF_WIKI_HELP', "This will appear in the title bar of the browser and in various other places."); |
| 68 | +define('PROJECT_NAMESPACE_HELP', "Following Wikipedia's example, many wikis keep their policy pages separate from their content pages, in a \"project namespace\". All page titles in this namespace start with a certain prefix, which you can specify here. Traditionally, this prefix is derived from the name of the wiki, but it cannot contain punctuation characters such as \"#\" or \":\"."); |
| 69 | +define('USER_NAME_HELP', "Enter your preferred username here, for example \"Joe Bloggs\". This is the name you will use to log in to the wiki."); |
| 70 | +define('EMAIL_ADDRESS_HELP', "Enter an e-mail address here to allow you to receive e-mail from other users on the wiki, reset your password, and be notified of changes to pages on your watchlist."); |
| 71 | +define('SUBSCRIBE_MAILING_LIST_HELP', "This is a low-volume mailing list used for release announcements, including important security announcements. You should subscribe to it and update your MediaWiki installation when new versions come out."); |
| 72 | + |
| 73 | + |
| 74 | +// 'Name' page input values |
| 75 | +define( 'NAME_OF_WIKI', "Site Name"); |
| 76 | +define( 'ADMIN_USER_NAME', "My Name" ); |
| 77 | +define( 'ADMIN_PASSWORD', "12345" ); |
| 78 | +define ( 'ADMIN_RETYPE_PASSWORD', "12345" ); |
| 79 | +define ( 'ADMIN_EMAIL_ADDRESS', "nadeesha@calcey.com" ); |
| 80 | + |
| 81 | + |
| 82 | +// 'Name' page input values for warning messages |
| 83 | +define( 'VALID_WIKI_NAME', "MyWiki" ); |
| 84 | +define( 'VALID_YOUR_NAME', "Nadeesha Weerasinghe" ); |
| 85 | +define( 'VALID_PASSWORD', "12345" ); |
| 86 | +define( 'VALID_PASSWORD_AGAIN', "12345" ); |
| 87 | +define( 'INVALID_PASSWORD_AGAIN', "123" ); |
| 88 | +define( 'VALID_NAMESPACE', "Mynamespace" ); |
| 89 | +define( 'INVALID_NAMESPACE', "##..##" ); |
| 90 | + |
| 91 | + |
| 92 | +// 'Database settings' page input values |
| 93 | +define( 'DB_WEB_USER', "different" ); |
| 94 | +define('DB_WEB_USER_PASSWORD', "12345" ); |
| 95 | + |
| 96 | + |
| 97 | +// 'Connet to database' page input values |
| 98 | +define( 'DATABASE_PREFIX',"databaseprefix" ); |
| 99 | + |
| 100 | + |
| 101 | +// 'Connet to database' page input values for warning messages |
| 102 | +define( 'VALID_DB_HOST', "localhost" ); |
| 103 | +define( 'INVALID_DB_HOST', "local" ); |
| 104 | +define( 'INVALID_DB_NAME', "my-wiki" ); |
| 105 | +define ( 'VALID_DB_NAME', "my_wiki1"); |
| 106 | +define( 'INVALID_DB_PREFIX', "database prefix" ); |
| 107 | +define( 'VALID_DB_PREFIX', "database_prefix"); |
| 108 | +define( 'INVALID_DB_USER_NAME', "roots" ); |
| 109 | +define( 'VALID_DB_USER_NAME', "root"); |
| 110 | +define( 'INVALID_DB_PASSWORD', "12345" ); |
| 111 | + |
| 112 | + |
Index: trunk/phase3/tests/installer/MediaWikiMySQLiteDataBaseTestCase.php |
— | — | @@ -0,0 +1,84 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiMySQLiteataBaseTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +
|
| 32 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 33 | +
|
| 34 | +/*
|
| 35 | + * Test Case ID : 06 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 36 | + * Test Case Name : Install Mediawiki using 'MySQL' database type successfully
|
| 37 | + * Version : MediaWiki 1.18alpha
|
| 38 | +*/
|
| 39 | +
|
| 40 | +class MediaWikiMySQLiteDataBaseTestCase extends MediaWikiInstallationCommonFunction {
|
| 41 | +
|
| 42 | + function setUp() {
|
| 43 | + parent::setUp();
|
| 44 | + }
|
| 45 | +
|
| 46 | + // Verify MediaWiki installation using 'MySQL' database type
|
| 47 | + public function testMySQLDatabaseSuccess() {
|
| 48 | +
|
| 49 | + $databaseName = DB_NAME_PREFIX."_sqlite_db";
|
| 50 | +
|
| 51 | + parent::navigateConnetToDatabasePage();
|
| 52 | + $this->click( "DBType_sqlite" );
|
| 53 | +
|
| 54 | + // Select 'SQLite' database type
|
| 55 | + $this->assertEquals( "SQLite settings", $this->getText( "//div[@id='DB_wrapper_sqlite']/h3" ));
|
| 56 | +
|
| 57 | + // Change database name
|
| 58 | + $defaultDbName = $this->getText( "sqlite_wgDBname" );
|
| 59 | + $this->type( "sqlite_wgDBname", " ");
|
| 60 | + $this->type( "sqlite_wgDBname", $databaseName );
|
| 61 | + $this->assertNotEquals( $defaultDbName, $databaseName );
|
| 62 | +
|
| 63 | + // 'Database settings' page
|
| 64 | + parent::clickContinueButton();
|
| 65 | +
|
| 66 | + // 'Name' page
|
| 67 | + parent::clickContinueButton();
|
| 68 | + parent::completeNamePage();
|
| 69 | +
|
| 70 | + // 'Options page
|
| 71 | + parent::clickContinueButton();
|
| 72 | +
|
| 73 | + // 'Install' page
|
| 74 | + parent::clickContinueButton();
|
| 75 | +
|
| 76 | + // 'Complete' page
|
| 77 | + $this->assertEquals( "Complete!",
|
| 78 | + $this->getText("//div[@id='bodyContent']/div/div/h2" ));
|
| 79 | +
|
| 80 | + // 'Congratulations!' text should be available in the 'Complete!' page.
|
| 81 | + $this->assertEquals( "Congratulations!",
|
| 82 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
|
| 83 | + parent::restartInstallation();
|
| 84 | + }
|
| 85 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiRightFrameworkLinksTestCase.php |
— | — | @@ -0,0 +1,93 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiRightFrameworkLinksTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +
|
| 32 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 33 | +
|
| 34 | +/*
|
| 35 | + * Test Case ID : 14, 15, 16, 17 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 36 | + * Test Case Name : User selects 'Read me' link.
|
| 37 | + * User selects 'Release notes' link.
|
| 38 | + * User selects 'Copying' link.
|
| 39 | + * User selects 'Upgrading' link.
|
| 40 | + * Version : MediaWiki 1.18alpha
|
| 41 | +*/
|
| 42 | +
|
| 43 | +
|
| 44 | +class MediaWikiRightFrameworkLinksTestCase extends MediaWikiInstallationCommonFunction{
|
| 45 | +
|
| 46 | + function setUp(){
|
| 47 | + parent::setUp();
|
| 48 | + }
|
| 49 | +
|
| 50 | + public function testLinksAvailability(){
|
| 51 | +
|
| 52 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
|
| 53 | +
|
| 54 | + // Verify 'Read me' link availability
|
| 55 | + $this->assertTrue($this->isElementPresent( "link=Read me" ));
|
| 56 | +
|
| 57 | + // Verify 'Release notes' link availability
|
| 58 | + $this->assertTrue($this->isElementPresent( "link=Release notes" ));
|
| 59 | +
|
| 60 | + // Verify 'Copying' link availability
|
| 61 | + $this->assertTrue($this->isElementPresent( "link=Copying" ));
|
| 62 | + }
|
| 63 | +
|
| 64 | + public function testPageNavigation(){
|
| 65 | +
|
| 66 | + $this->open( "http://localhost:".PORT."/".DIRECTORY_NAME."/config/index.php" );
|
| 67 | +
|
| 68 | + // Navigate to the 'Read me' page
|
| 69 | + $this->click( "link=Read me" );
|
| 70 | + $this->waitForPageToLoad( PAGE_LOAD_TIME );
|
| 71 | + $this->assertEquals( "Read me", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" ));
|
| 72 | + $this->assertTrue($this->isElementPresent( "submit-back" ));
|
| 73 | + parent::clickBackButton();
|
| 74 | +
|
| 75 | + // Navigate to the 'Release notes' page
|
| 76 | + $this->click( "link=Release notes" );
|
| 77 | + $this->waitForPageToLoad( PAGE_LOAD_TIME);
|
| 78 | + $this->assertEquals( "Release notes", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" ));
|
| 79 | + $this->assertTrue( $this->isElementPresent( "submit-back" ));
|
| 80 | + parent::clickBackButton();
|
| 81 | +
|
| 82 | + // Navigate to the 'Copying' page
|
| 83 | + $this->click( "link=Copying" );
|
| 84 | + $this->waitForPageToLoad( PAGE_LOAD_TIME );
|
| 85 | + $this->assertEquals( "Copying", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" ));
|
| 86 | + $this->assertTrue($this->isElementPresent( "submit-back" ));
|
| 87 | + parent::clickBackButton();
|
| 88 | +
|
| 89 | + // Navigate to the 'Upgrading' page
|
| 90 | + $this->click( "link=Upgrading" );
|
| 91 | + $this->waitForPageToLoad( PAGE_LOAD_TIME );
|
| 92 | + $this->assertEquals( "Upgrading", $this->getText( "//div[@id='bodyContent']/div/div/h2[1]" ));
|
| 93 | + }
|
| 94 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiUserInterfaceTestCase.php |
— | — | @@ -0,0 +1,522 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiUserInterfaceTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 32 | +
|
| 33 | +/*
|
| 34 | + * Test Case ID : 18 - 27 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 35 | + * Test Case Name : UI of MediaWiki initial/ Language/ Welcome to MediaWiki!/ Connect to database/
|
| 36 | + * Database settings/ Name/ Options/ Install/ Complete/ Restart Inslation pages
|
| 37 | + * Version : MediaWiki 1.18alpha
|
| 38 | +*/
|
| 39 | +
|
| 40 | +
|
| 41 | +class MediaWikiUserInterfaceTestCase extends MediaWikiInstallationCommonFunction {
|
| 42 | +
|
| 43 | + function setUp() {
|
| 44 | + $this->setBrowser("*chrome");
|
| 45 | + $this->setBrowserUrl("http://localhost:".PORT."/".DIRECTORY_NAME."/");
|
| 46 | + }
|
| 47 | +
|
| 48 | +
|
| 49 | + public function testInitialPageUI(){
|
| 50 | +
|
| 51 | + parent::navigateInitialpage();
|
| 52 | +
|
| 53 | + // MediaWiki logo available
|
| 54 | + $this->assertTrue( $this->isElementPresent( "//img[@alt='The MediaWiki logo']" ));
|
| 55 | +
|
| 56 | + // 'MediaWiki 1.18alpha' text available
|
| 57 | + $this->assertEquals( "MediaWiki 1.18alpha", $this->getText( "//h1" ));
|
| 58 | +
|
| 59 | + // 'LocalSettings.php not found.' text available
|
| 60 | + $this->assertEquals( "LocalSettings.php not found.", $this->getText( "//p[1]" ));
|
| 61 | +
|
| 62 | + // 'Please set up the wiki first' text available
|
| 63 | + $this->assertEquals( "Please set up the wiki first.", $this->getText( "//p[2]" ));
|
| 64 | +
|
| 65 | + // 'set up the wiki' link available
|
| 66 | + $this->assertTrue($this->isElementPresent( "link=set up the wiki" ));
|
| 67 | + }
|
| 68 | +
|
| 69 | +
|
| 70 | + public function testlanguagePageUI(){
|
| 71 | +
|
| 72 | + parent::navigateLanguagePage();
|
| 73 | +
|
| 74 | + // Verify 'Language' heading
|
| 75 | + $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 76 | +
|
| 77 | + // 'Your language' label available
|
| 78 | + $this->assertEquals( "Your language:",
|
| 79 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label" ));
|
| 80 | +
|
| 81 | + // 'Your language' dropdown available
|
| 82 | + $this->assertTrue( $this->isElementPresent( "UserLang" ));
|
| 83 | +
|
| 84 | + // 'Wiki language' label available
|
| 85 | + $this->assertEquals( "Wiki language:",
|
| 86 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/label" ));
|
| 87 | +
|
| 88 | + // 'Wiki language' dropdown available
|
| 89 | + $this->assertTrue($this->isElementPresent( "ContLang" ));
|
| 90 | + }
|
| 91 | +
|
| 92 | +
|
| 93 | + public function testWelcometoMediaWikiUI(){
|
| 94 | +
|
| 95 | + parent::navigateWelcometoMediaWikiPage();
|
| 96 | +
|
| 97 | + // Verify 'Welcome to MediaWiki!' heading
|
| 98 | + $this->assertEquals( "Welcome to MediaWiki!",
|
| 99 | + $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 100 | +
|
| 101 | + // Verify environment ok text displayed.
|
| 102 | + $this->assertEquals( "The environment has been checked.You can install MediaWiki.",
|
| 103 | + $this->getText( "//div[@id='bodyContent']/div/div/div[7]/span" ));
|
| 104 | + }
|
| 105 | +
|
| 106 | +
|
| 107 | + public function testConnectToDatabaseUI(){
|
| 108 | +
|
| 109 | + parent::navigateConnetToDatabasePage();
|
| 110 | +
|
| 111 | + // 'MYSQL radio button available
|
| 112 | + $this->assertEquals( "MySQL",
|
| 113 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]/label" ));
|
| 114 | + $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]" ));
|
| 115 | +
|
| 116 | + // 'SQLite' radio button available
|
| 117 | + $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]" ));
|
| 118 | + $this->assertEquals( "SQLite", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]/label "));
|
| 119 | +
|
| 120 | + // 'Database host' label available
|
| 121 | + $this->assertEquals( "Database host:", $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/label" ));
|
| 122 | +
|
| 123 | + // 'Database host' text box default to 'localhost'
|
| 124 | + $this->assertEquals( "localhost", $this->getValue( "mysql_wgDBserver" ));
|
| 125 | +
|
| 126 | + // 'Identify this wiki' section available
|
| 127 | + $this->assertTrue( $this->isElementPresent( "//div[@id='DB_wrapper_mysql']/fieldset[1]/legend" ));
|
| 128 | +
|
| 129 | + // 'Identify this wiki' label available
|
| 130 | + $this->assertEquals( "Identify this wiki", $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/legend" ));
|
| 131 | +
|
| 132 | + // 'Database name' lable available
|
| 133 | + $this->assertEquals( "Database name:",
|
| 134 | + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/label" ));
|
| 135 | +
|
| 136 | + // Verify 'Database name:' text box is default to 'my_wiki'
|
| 137 | + $this->assertEquals( "my_wiki", $this->getValue( "mysql_wgDBname" ));
|
| 138 | +
|
| 139 | + // Verify 'Database table prefix:' label available
|
| 140 | + $this->assertEquals( "Database table prefix:",
|
| 141 | + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/label" ));
|
| 142 | +
|
| 143 | + // 'User account for installation' section available
|
| 144 | + $this->assertTrue( $this->isElementPresent( "//div[@id='DB_wrapper_mysql']/fieldset[2]/legend" ));
|
| 145 | +
|
| 146 | + // 'User account for installation' label available
|
| 147 | + $this->assertEquals( "User account for installation", $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/legend" ));
|
| 148 | +
|
| 149 | + // 'Database username' label available
|
| 150 | + $this->assertEquals( "Database username:",
|
| 151 | + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/label" ));
|
| 152 | +
|
| 153 | + // 'Database username' text box defaults to 'root'
|
| 154 | + $this->assertEquals("root", $this->getValue( "mysql__InstallUser" ));
|
| 155 | +
|
| 156 | + // 'Database password' label available
|
| 157 | + $this->assertEquals( "Database password:",
|
| 158 | + $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/label" ));
|
| 159 | + }
|
| 160 | +
|
| 161 | +
|
| 162 | +
|
| 163 | + public function testDatabaseSettingsUI(){
|
| 164 | +
|
| 165 | + $databaseName = DB_NAME_PREFIX."_db_settings_UI";
|
| 166 | + parent::navigateDatabaseSettingsPage( $databaseName );
|
| 167 | +
|
| 168 | + // 'Database settings' text available.
|
| 169 | + $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 170 | +
|
| 171 | + // 'Database account for web access' section available
|
| 172 | + $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset" ));
|
| 173 | +
|
| 174 | + // 'Database account for web access' label available
|
| 175 | + $this->assertEquals( "Database account for web access", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/legend" ));
|
| 176 | +
|
| 177 | + // 'Use the same account as for installation' check box available
|
| 178 | + $this->assertEquals( "Use the same account as for installation", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/label" ));
|
| 179 | +
|
| 180 | + // 'Use the same account as for installation' check box is selected by default
|
| 181 | + $this->assertEquals( "on", $this->getValue( "mysql__SameAccount" ));
|
| 182 | +
|
| 183 | + // 'Use the same account as for installation' check box deselected
|
| 184 | + $this->click( "mysql__SameAccount" );
|
| 185 | +
|
| 186 | + // verify 'Use the same account as for installation' check box is not selected
|
| 187 | + $this->assertEquals( "off", $this->getValue( "mysql__SameAccount" ));
|
| 188 | +
|
| 189 | + // 'Database username' label available
|
| 190 | + $this->assertEquals( "Database username:", $this->getText( "//div[@id='dbOtherAccount']/div[1]/div[1]/label" ));
|
| 191 | +
|
| 192 | + // 'Database username' text box is default to the 'wikiuser'
|
| 193 | + $this->assertEquals( "wikiuser", $this->getValue( "mysql_wgDBuser" ));
|
| 194 | +
|
| 195 | + // 'Database password' label available
|
| 196 | + $this->assertEquals( "Database password:", $this->getText( "//div[@id='dbOtherAccount']/div[2]/div[1]/label" ));
|
| 197 | +
|
| 198 | + // 'Create the account if it does not already exist' label available
|
| 199 | + $this->assertEquals( "Create the account if it does not already exist", $this->getText( "//div[@id='dbOtherAccount']/div[4]/label" ));
|
| 200 | +
|
| 201 | + // 'Create the account if it does not already exist' check box is not selected by default
|
| 202 | + $this->assertEquals( "off" , $this->getValue( "mysql__CreateDBAccount" ));
|
| 203 | +
|
| 204 | + // 'Create the account if it does not already exist' check box selected
|
| 205 | + $this->click( "mysql__CreateDBAccount" );
|
| 206 | +
|
| 207 | + // Verify 'Create the account if it does not already exist' check box is selected
|
| 208 | + $this->assertEquals( "on" , $this->getValue( "mysql__CreateDBAccount" ));
|
| 209 | + $this->click( "mysql__SameAccount" );
|
| 210 | + $this->assertEquals( "on", $this->getValue( "mysql__SameAccount" ));
|
| 211 | +
|
| 212 | + // 'Storage engine' label available
|
| 213 | + $this->assertEquals( "Storage engine:",
|
| 214 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label"));
|
| 215 | +
|
| 216 | + // 'InnoDB' label available
|
| 217 | + $this->assertEquals( "InnoDB",
|
| 218 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/ul/li[1]/label" ));
|
| 219 | +
|
| 220 | + // 'InnoDB' radio button available
|
| 221 | + $this->assertTrue( $this->isElementPresent( "mysql__MysqlEngine_InnoDB" ));
|
| 222 | +
|
| 223 | + // 'MyISAM' label available
|
| 224 | + $this->assertEquals( "MyISAM", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/ul/li[2]/label" ));
|
| 225 | +
|
| 226 | + // 'MyISAM' radio button available
|
| 227 | + $this->assertTrue($this->isElementPresent( "mysql__MysqlEngine_MyISAM" ));
|
| 228 | +
|
| 229 | + // 'Database character set' label available
|
| 230 | + $this->assertEquals( "Database character set:",
|
| 231 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[1]/label" ));
|
| 232 | +
|
| 233 | + // 'Binary' radio button available
|
| 234 | + $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_binary" ));
|
| 235 | +
|
| 236 | + // 'Binary' radio button available
|
| 237 | + $this->assertEquals( "Binary", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[2]/ul/li[1]/label" ));
|
| 238 | +
|
| 239 | + // 'UTF-8' radio button available
|
| 240 | + $this->assertTrue( $this->isElementPresent( "mysql__MysqlCharset_utf8" ));
|
| 241 | +
|
| 242 | + // 'UTF-8' label available
|
| 243 | + $this->assertEquals( "UTF-8", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[3]/div[2]/ul/li[2]/label" ));
|
| 244 | +
|
| 245 | + // 'Binary' radio button is selected
|
| 246 | + $this->assertEquals( "on", $this->getValue( "mysql__MysqlCharset_binary" ));
|
| 247 | + }
|
| 248 | +
|
| 249 | + public function testNamePageUI(){
|
| 250 | +
|
| 251 | + $databaseName = DB_NAME_PREFIX."_name_UI";
|
| 252 | + parent::navigateNamePage($databaseName);
|
| 253 | +
|
| 254 | + // 'Name of wiki' text box available
|
| 255 | + $this->assertEquals( "Name of wiki:",
|
| 256 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[1]/label" ));
|
| 257 | +
|
| 258 | + $this->assertTrue( $this->isElementPresent( "config_wgSitename" ));
|
| 259 | +
|
| 260 | + // 'Project namespace' label available
|
| 261 | + $this->assertEquals( "Project namespace:",
|
| 262 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[1]/label" ));
|
| 263 | +
|
| 264 | + // 'Same as the wiki name' radio button available
|
| 265 | + $this->assertTrue( $this->isElementPresent( "config__NamespaceType_site-name" ));
|
| 266 | +
|
| 267 | + // 'Project' radio button available
|
| 268 | + $this->assertTrue( $this->isElementPresent( "config__NamespaceType_generic" ));
|
| 269 | +
|
| 270 | + // 'Project' radio button available
|
| 271 | + $this->assertTrue( $this->isElementPresent( "config__NamespaceType_other" ));
|
| 272 | +
|
| 273 | + // 'Same as the wiki name' label available
|
| 274 | + $this->assertEquals( "Same as the wiki name:",
|
| 275 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[1]/label" ));
|
| 276 | +
|
| 277 | + // 'Project' label available
|
| 278 | + $this->assertEquals("Project",
|
| 279 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[2]/label" ));
|
| 280 | +
|
| 281 | + // 'Project' label available
|
| 282 | + $this->assertEquals( "Other (specify)",
|
| 283 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[2]/div[2]/ul/li[3]/label" ));
|
| 284 | +
|
| 285 | + // 'Same as the wiki name' radio button selected by default
|
| 286 | + $this->assertEquals( "on", $this->getValue( "config__NamespaceType_site-name" ));
|
| 287 | +
|
| 288 | + // 'Administrator account' section available
|
| 289 | + $this->assertTrue( $this->isElementPresent( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset" ));
|
| 290 | +
|
| 291 | + // 'Administrator account' label available
|
| 292 | + $this->assertEquals( "Administrator account",
|
| 293 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/legend" ));
|
| 294 | +
|
| 295 | + // 'Your Name' label available
|
| 296 | + $this->assertEquals( "Your name:",
|
| 297 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[1]/div[1]/label" ));
|
| 298 | +
|
| 299 | + // 'Your Name' text box available
|
| 300 | + $this->assertTrue( $this->isElementPresent( "config__AdminName" ));
|
| 301 | +
|
| 302 | + // 'Password' label available
|
| 303 | + $this->assertEquals( "Password:",
|
| 304 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[2]/div[1]/label" ));
|
| 305 | +
|
| 306 | + // 'Password' text box available
|
| 307 | + $this->assertTrue( $this->isElementPresent( "config__AdminPassword" ));
|
| 308 | +
|
| 309 | + // 'Password again' label available
|
| 310 | + $this->assertEquals( "Password again:",
|
| 311 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[3]/div[1]/label" ));
|
| 312 | +
|
| 313 | + // 'Password again' text box available
|
| 314 | + $this->assertTrue( $this->isElementPresent( "config__AdminPassword2" ));
|
| 315 | +
|
| 316 | + // 'Email address' label avaialble
|
| 317 | + $this->assertEquals( "E-mail address:",
|
| 318 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[4]/div[1]/label" ));
|
| 319 | +
|
| 320 | + // 'Email address' text box available
|
| 321 | + $this->assertTrue( $this->isElementPresent( "config__AdminEmail" ));
|
| 322 | +
|
| 323 | + // 'Subscribe to the release announcements mailing list. ' check box available
|
| 324 | + $this->assertTrue( $this->isElementPresent( "config__Subscribe" ));
|
| 325 | +
|
| 326 | + // 'Subscribe to the release announcements mailing list. ' label avaialble
|
| 327 | + $this->assertEquals( "Subscribe to the release announcements mailing list.",
|
| 328 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset/div[5]/label" ));
|
| 329 | +
|
| 330 | + // 'release announcements mailing list' link available
|
| 331 | + $this->assertTrue( $this->isElementPresent( "link=release announcements mailing list" ));
|
| 332 | +
|
| 333 | + // Message displayed
|
| 334 | + $this->assertEquals( "You are almost done!You can now skip the remaining configuration and install the wiki right now.",
|
| 335 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[4]/div[2]" ));
|
| 336 | +
|
| 337 | + // 'Ask me more questions.' radio button available
|
| 338 | + $this->assertTrue( $this->isElementPresent( "config__SkipOptional_continue" ));
|
| 339 | +
|
| 340 | + // 'Ask me more questions.' label available
|
| 341 | + $this->assertEquals( "Ask me more questions.",
|
| 342 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[5]/div[2]/ul/li[1]/label" ));
|
| 343 | +
|
| 344 | + // 'I'm bored already, just install the wiki' radio button is avaiable
|
| 345 | + $this->assertTrue( $this->isElementPresent( "config__SkipOptional_skip" ));
|
| 346 | +
|
| 347 | + // 'I'm bored already, just install the wiki' label available
|
| 348 | + $this->assertEquals( "I'm bored already, just install the wiki.",
|
| 349 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[5]/div[2]/ul/li[2]/label" ));
|
| 350 | +
|
| 351 | + // 'Ask me more questions.' radio button is default selected
|
| 352 | + $this->assertEquals( "on", $this->getValue( "config__SkipOptional_continue" ));
|
| 353 | + }
|
| 354 | +
|
| 355 | +
|
| 356 | +
|
| 357 | + public function testOptionPageUI(){
|
| 358 | +
|
| 359 | + $databaseName = DB_NAME_PREFIX."_options_UI";
|
| 360 | + parent::navigateOptionsPage($databaseName);
|
| 361 | +
|
| 362 | + // 'Options' label available
|
| 363 | + $this->assertEquals( "Options", $this->getText("//div[@id='bodyContent']/div/div/h2"));
|
| 364 | +
|
| 365 | + // 'Return e-mail address' label available
|
| 366 | + $this->assertEquals( "Return e-mail address:", $this->getText( "//div[@id='emailwrapper']/div[1]/div[1]/label" ));
|
| 367 | +
|
| 368 | + // 'Return e-mail address' text box available
|
| 369 | + $this->assertTrue( $this->isElementPresent( "config_wgPasswordSender" ));
|
| 370 | +
|
| 371 | + // Text 'apache@localhost' is default value of the 'Return e-mail address' text box
|
| 372 | + $this->assertEquals( "apache@localhost", $this->getValue( "config_wgPasswordSender" ));
|
| 373 | +
|
| 374 | + // 'Logo URL' label available
|
| 375 | + $this->assertEquals( "Logo URL:", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset[2]/div[3]/div[1]/label" ));
|
| 376 | +
|
| 377 | + // 'Logo URL' text box available
|
| 378 | + $this->assertTrue( $this->isElementPresent( "config_wgLogo" ));
|
| 379 | +
|
| 380 | + // Correct path available in the 'Logo URL' text box
|
| 381 | + $this->assertEquals( "/wiki/skins/common/images/wiki.png", $this->getValue( "config_wgLogo" ));
|
| 382 | +
|
| 383 | + // 'Enable file uploads' radio button available
|
| 384 | + $this->assertTrue( $this->isElementPresent( "config_wgEnableUploads" ));
|
| 385 | +
|
| 386 | + // 'Enable file uploads' label available
|
| 387 | + $this->assertEquals( "Enable file uploads",
|
| 388 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/fieldset[2]/div[1]/label" ));
|
| 389 | +
|
| 390 | + // 'Enable file uploads' check box is not selected
|
| 391 | + $this->assertEquals( "off", $this->getValue( "config_wgEnableUploads" ));
|
| 392 | +
|
| 393 | + $this->click( "config_wgEnableUploads" );
|
| 394 | +
|
| 395 | + // 'Directory for deleted files' label available
|
| 396 | + $this->assertEquals( "Directory for deleted files:",
|
| 397 | + $this->getText( "//div[@id='uploadwrapper']/div/div[1]/label" ));
|
| 398 | +
|
| 399 | + // 'Directory for deleted files' text box available
|
| 400 | + $this->assertTrue( $this->isElementPresent( "config_wgDeletedDirectory" ));
|
| 401 | +
|
| 402 | + // Correct path available in the 'Directory for deleted files' text box
|
| 403 | + $this->assertEquals( "C:\\wamp\\www\\".DIRECTORY_NAME."/images/deleted",
|
| 404 | + $this->getValue( "config_wgDeletedDirectory" ));
|
| 405 | + }
|
| 406 | +
|
| 407 | +
|
| 408 | +
|
| 409 | + public function testInstallPageUI(){
|
| 410 | +
|
| 411 | + $databaseName = DB_NAME_PREFIX."_install_UI";
|
| 412 | + parent::navigateInstallPage( $databaseName );
|
| 413 | +
|
| 414 | + // Verify installation done messages display
|
| 415 | + $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 416 | + $this->assertEquals( "Setting up database... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[1]" ));
|
| 417 | + $this->assertEquals( "Creating database user... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" ));
|
| 418 | + $this->assertEquals( "Creating tables... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[3]" ));
|
| 419 | + $this->assertEquals( "Populating default interwiki table... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[4]" ));
|
| 420 | + $this->assertEquals( "Generating secret key... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[5]" ));
|
| 421 | + $this->assertEquals( "Generating default upgrade key... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[6]" ));
|
| 422 | + $this->assertEquals( "Creating administrator user account... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[7]" ));
|
| 423 | + $this->assertEquals( "Creating main page with default content... done", $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[8]" ));
|
| 424 | + }
|
| 425 | +
|
| 426 | +
|
| 427 | +
|
| 428 | + public function testCompletePageUI(){
|
| 429 | +
|
| 430 | + $databaseName = DB_NAME_PREFIX."_complete_UI";
|
| 431 | + parent::navigateCompletePage( $databaseName );
|
| 432 | +
|
| 433 | + // 'Congratulations!' text display
|
| 434 | + $this->assertEquals( "Congratulations!",
|
| 435 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
|
| 436 | +
|
| 437 | + // 'LocalSettings.php' generated message display
|
| 438 | + $this->assertEquals( "The installer has generated a LocalSettings.php file. It contains all your configuration.",
|
| 439 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/p[2]" ));
|
| 440 | +
|
| 441 | + // 'Download LocalSettings.php'' link available
|
| 442 | + $this->assertTrue( $this->isElementPresent( "link=Download LocalSettings.php" ));
|
| 443 | +
|
| 444 | + // 'enter your wiki' link available
|
| 445 | + $this->assertTrue( $this->isElementPresent( "link=enter your wiki" ));
|
| 446 | + }
|
| 447 | +
|
| 448 | +
|
| 449 | +
|
| 450 | + public function testRestartInstallation(){
|
| 451 | +
|
| 452 | + parent::navigateConnetToDatabasePage();
|
| 453 | + $this->click( "link=Restart installation" );
|
| 454 | + $this->waitForPageToLoad( PAGE_LOAD_TIME );
|
| 455 | +
|
| 456 | + // Restart installation' label should be available.
|
| 457 | + $this->assertEquals( "Restart installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 458 | +
|
| 459 | + //'Do you want to clear all saved data that you have entered and restart the installation process?' label available
|
| 460 | + $this->assertEquals( "Do you want to clear all saved data that you have entered and restart the installation process?",
|
| 461 | + $this->getText( "//*[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]" ));
|
| 462 | + // 'Back' button available
|
| 463 | + $this->assertTrue($this->isElementPresent( "submit-back" ));
|
| 464 | +
|
| 465 | + // 'Restart' button available
|
| 466 | + $this->assertTrue($this->isElementPresent( "submit-restart" ));
|
| 467 | + }
|
| 468 | +
|
| 469 | +
|
| 470 | +
|
| 471 | + public function testMediaWikiLogoAvailability(){
|
| 472 | +
|
| 473 | + $databaseName = DB_NAME_PREFIX."_mediawiki_logo";
|
| 474 | + parent::navigateInitialpage();
|
| 475 | + parent::mediaWikiLogoPresentInitialScreen();
|
| 476 | + $this->click( "link=set up the wiki" );
|
| 477 | + $this->waitForPageToLoad( PAGE_LOAD_TIME );
|
| 478 | +
|
| 479 | + // 'Language' page
|
| 480 | + parent::mediaWikiLogoPresent();
|
| 481 | + parent::clickContinueButton();
|
| 482 | +
|
| 483 | + // 'Welcome to MediaWiki' page
|
| 484 | + parent::mediaWikiLogoPresent();
|
| 485 | + parent::clickContinueButton();
|
| 486 | +
|
| 487 | + // 'Connet to database' page
|
| 488 | + parent::mediaWikiLogoPresent();
|
| 489 | + $this->type("mysql_wgDBname", $databaseName );
|
| 490 | + parent::clickContinueButton();
|
| 491 | +
|
| 492 | + // 'Database setting' page
|
| 493 | + parent::mediaWikiLogoPresent();
|
| 494 | + parent::clickContinueButton();
|
| 495 | +
|
| 496 | + // 'Name' page
|
| 497 | + parent::mediaWikiLogoPresent();
|
| 498 | + parent::completeNamePage();
|
| 499 | + parent::clickContinueButton();
|
| 500 | +
|
| 501 | + // 'Options' page
|
| 502 | + parent::mediaWikiLogoPresent();
|
| 503 | + parent::clickContinueButton();
|
| 504 | +
|
| 505 | + // 'Install' page
|
| 506 | + parent::mediaWikiLogoPresent();
|
| 507 | + }
|
| 508 | +
|
| 509 | +
|
| 510 | + public function testRightFramework(){
|
| 511 | +
|
| 512 | + parent::navigateLanguagePage();
|
| 513 | + $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[1]/span" ));
|
| 514 | + $this->assertEquals( "Welcome to MediaWiki!", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[2]/span" ));
|
| 515 | + $this->assertEquals( "Connect to database", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[3]/span" ));
|
| 516 | + $this->assertEquals( "Upgrade existing installation", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[4]" ));
|
| 517 | + $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[5]/span" ));
|
| 518 | + $this->assertEquals( "Name", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[6]/span" ));
|
| 519 | + $this->assertEquals( "Options", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[7]/span" ));
|
| 520 | + $this->assertEquals( "Install", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[8]/span" ));
|
| 521 | + $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/div[1]/ul[1]/li[9]/span" ));
|
| 522 | + }
|
| 523 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiDifferntDatabasePrefixTestCase.php |
— | — | @@ -0,0 +1,93 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiDifferntDatabasePrefixTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 32 | +
|
| 33 | +/*
|
| 34 | + * Test Case ID : 02 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 35 | + * Test Case Name : Install MediaWiki with the same database and the different
|
| 36 | + * database prefixes(Share one database between multiple wikis).
|
| 37 | + * Version : MediaWiki 1.18alpha
|
| 38 | +*/
|
| 39 | +
|
| 40 | +class MediaWikiDifferntDatabasePrefixTestCase extends MediaWikiInstallationCommonFunction {
|
| 41 | +
|
| 42 | + function setUp(){
|
| 43 | + parent::setUp();
|
| 44 | + }
|
| 45 | +
|
| 46 | + // Install Mediawiki using 'MySQL' database type.
|
| 47 | + public function testDifferentDatabasePrefix(){
|
| 48 | +
|
| 49 | + $databaseName = DB_NAME_PREFIX."_db_prefix";
|
| 50 | + parent::navigateInstallPage( $databaseName );
|
| 51 | +
|
| 52 | + // To 'Options' page
|
| 53 | + parent::clickBackButton();
|
| 54 | +
|
| 55 | + // To 'Name' page
|
| 56 | + parent::clickBackButton();
|
| 57 | +
|
| 58 | + // To 'Database settings' page
|
| 59 | + parent::clickBackButton();
|
| 60 | +
|
| 61 | + // To 'Connect to database' page
|
| 62 | + parent::clickBackButton();
|
| 63 | +
|
| 64 | + // From 'Connect to database' page without database prefix
|
| 65 | + parent::clickContinueButton();
|
| 66 | +
|
| 67 | + // Verify upgrade existing message
|
| 68 | + $this->assertEquals( "Upgrade existing installation",
|
| 69 | + $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 70 | +
|
| 71 | + // To 'Connect to database' page
|
| 72 | + parent::clickBackButton();
|
| 73 | +
|
| 74 | + // Input the database prefix
|
| 75 | + $this->type( "mysql_wgDBprefix", DATABASE_PREFIX );
|
| 76 | +
|
| 77 | + // From 'Connect to database' page with database prefix
|
| 78 | + parent::clickContinueButton();
|
| 79 | +
|
| 80 | + // To 'Complete' page
|
| 81 | + parent::clickContinueButton();
|
| 82 | + parent::completeNamePage();
|
| 83 | + parent::clickContinueButton();
|
| 84 | +
|
| 85 | + // Verify already installed warning message
|
| 86 | + $this->assertEquals( "Install",
|
| 87 | + $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 88 | + $this->assertEquals( "Warning: You seem to have already installed MediaWiki and are trying to install it again.Please proceed to the next page.",
|
| 89 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]" ));
|
| 90 | + parent::clickContinueButton();
|
| 91 | + $this->chooseCancelOnNextConfirmation();
|
| 92 | + parent::restartInstallation();
|
| 93 | + }
|
| 94 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiRestartInstallationTestCase.php |
— | — | @@ -0,0 +1,115 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiRestartInstallationTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +
|
| 32 | +
|
| 33 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 34 | +
|
| 35 | +/*
|
| 36 | + * Test Case ID : 11, 12 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 37 | + * Test Case Name : Install mediawiki on a already installed Mediawiki.
|
| 38 | + * Version : MediaWiki 1.18alpha
|
| 39 | +*/
|
| 40 | +
|
| 41 | +class MediaWikiRestartInstallationTestCase extends MediaWikiInstallationCommonFunction {
|
| 42 | +
|
| 43 | + function setUp() {
|
| 44 | + parent::setUp();
|
| 45 | + }
|
| 46 | +
|
| 47 | + // Verify restarting the installation
|
| 48 | + public function testSuccessRestartInstallation() {
|
| 49 | +
|
| 50 | + $dbNameBeforeRestart = DB_NAME_PREFIX."_db_before";
|
| 51 | + parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart );
|
| 52 | +
|
| 53 | + // Verify 'Restart installation' link available
|
| 54 | + $this->assertTrue($this->isElementPresent( "link=Restart installation" ));
|
| 55 | +
|
| 56 | + // Click 'Restart installation'
|
| 57 | + $this->click( "link=Restart installation ");
|
| 58 | + $this->waitForPageToLoad( PAGE_LOAD_TIME );
|
| 59 | +
|
| 60 | + // 'Restart Installation' page displayed
|
| 61 | + $this->assertEquals( "Restart installation", $this->getText("//div[@id='bodyContent']/div/div/h2"));
|
| 62 | +
|
| 63 | + // Restart warning message displayed
|
| 64 | + $this->assertTrue($this->isTextPresent( "exact:Do you want to clear all saved data that you have entered and restart the installation process?" ));
|
| 65 | +
|
| 66 | + // Click on the 'Yes, restart' button
|
| 67 | + $this->click( "submit-restart" );
|
| 68 | + $this->waitForPageToLoad( PAGE_LOAD_TIME );
|
| 69 | +
|
| 70 | + // Navigate to the initial installation page(Language).
|
| 71 | + $this->assertEquals( "Language", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 72 | +
|
| 73 | + // 'Welcome to MediaWiki!' page
|
| 74 | + parent::clickContinueButton();
|
| 75 | +
|
| 76 | + // 'Connect to database' page
|
| 77 | + parent::clickContinueButton();
|
| 78 | +
|
| 79 | + // saved data should be deleted
|
| 80 | + $dbNameAfterRestart = $this->getValue("mysql_wgDBname");
|
| 81 | + $this->assertNotEquals($dbNameBeforeRestart, $dbNameAfterRestart);
|
| 82 | + }
|
| 83 | +
|
| 84 | +
|
| 85 | + // Verify cancelling restart
|
| 86 | + public function testCancelRestartInstallation(){
|
| 87 | +
|
| 88 | + $dbNameBeforeRestart = DB_NAME_PREFIX."_cancel_restart";
|
| 89 | +
|
| 90 | + parent::navigateDatabaseSettingsPage( $dbNameBeforeRestart);
|
| 91 | + // Verify 'Restart installation' link available
|
| 92 | + $this->assertTrue($this->isElementPresent( "link=Restart installation" ));
|
| 93 | +
|
| 94 | + $this->click( "link=Restart installation" );
|
| 95 | + $this->waitForPageToLoad( PAGE_LOAD_TIME );
|
| 96 | +
|
| 97 | + // 'Restart Installation' page displayed
|
| 98 | + $this->assertEquals( "Restart installation", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 99 | +
|
| 100 | + // Restart warning message displayed
|
| 101 | + $this->assertTrue( $this->isTextPresent( "Do you want to clear all saved data that you have entered and restart the installation process?"));
|
| 102 | +
|
| 103 | + // Click on the 'Back' button
|
| 104 | + parent::clickBackButton();
|
| 105 | +
|
| 106 | + // Navigates to the previous page
|
| 107 | + $this->assertEquals( "Database settings", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));;
|
| 108 | +
|
| 109 | + // 'Connect to database' page
|
| 110 | + parent::clickBackButton();
|
| 111 | +
|
| 112 | + // Saved data remain on the page.
|
| 113 | + $dbNameAfterRestart = $this->getValue( "mysql_wgDBname" );
|
| 114 | + $this->assertEquals( $dbNameBeforeRestart, $dbNameAfterRestart );
|
| 115 | + }
|
| 116 | +}
|
Index: trunk/phase3/tests/installer/MediaWikiDifferentDatabaseAccountTestCase.php |
— | — | @@ -0,0 +1,84 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * MediaWikiDifferentDatabaseAccountTestCase
|
| 6 | + *
|
| 7 | + * @file
|
| 8 | + * @ingroup Maintenance
|
| 9 | + * Copyright (C) 2010 Dan Nessett <dnessett@yahoo.com>
|
| 10 | + * http://citizendium.org/
|
| 11 | + *
|
| 12 | + * This program is free software; you can redistribute it and/or modify
|
| 13 | + * it under the terms of the GNU General Public License as published by
|
| 14 | + * the Free Software Foundation; either version 2 of the License, or
|
| 15 | + * (at your option) any later version.
|
| 16 | + *
|
| 17 | + * This program is distributed in the hope that it will be useful,
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 20 | + * GNU General Public License for more details.
|
| 21 | + *
|
| 22 | + * You should have received a copy of the GNU General Public License along
|
| 23 | + * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 24 | + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| 25 | + * http://www.gnu.org/copyleft/gpl.html
|
| 26 | + *
|
| 27 | + * @addtogroup Maintenance
|
| 28 | + *
|
| 29 | + */
|
| 30 | +
|
| 31 | +
|
| 32 | +require_once 'MediaWikiInstallationCommonFunction.php';
|
| 33 | +
|
| 34 | +/*
|
| 35 | + * Test Case ID : 04 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
|
| 36 | + * Test Case Name : Install MediaWiki with different Database accounts for web access.
|
| 37 | + * Version : MediaWiki 1.18alpha
|
| 38 | +*/
|
| 39 | +
|
| 40 | +class MediaWikiDifferentDatabaseAccountTestCase extends MediaWikiInstallationCommonFunction {
|
| 41 | +
|
| 42 | + function setUp(){
|
| 43 | + parent::setUp();
|
| 44 | + }
|
| 45 | +
|
| 46 | +
|
| 47 | + // Install Mediawiki using 'MySQL' database type.
|
| 48 | + public function testDifferentDatabaseAccount(){
|
| 49 | +
|
| 50 | + $databaseName = DB_NAME_PREFIX."_dif_accounts";
|
| 51 | +
|
| 52 | + // Navigate to the 'Database settings' page
|
| 53 | + parent::navigateDatabaseSettingsPage( $databaseName );
|
| 54 | +
|
| 55 | + // Click on the 'Use the same account as for installation' check box
|
| 56 | + $this->click( "mysql__SameAccount" );
|
| 57 | +
|
| 58 | + // Change the 'Database username'
|
| 59 | + $this->type( "mysql_wgDBuser", DB_WEB_USER );
|
| 60 | +
|
| 61 | + // Enter 'Database password:'
|
| 62 | + $this->type( "mysql_wgDBpassword", DB_WEB_USER_PASSWORD );
|
| 63 | +
|
| 64 | + // Select 'Create the account if it does not already exist' check box
|
| 65 | + $this->click( "mysql__CreateDBAccount" );
|
| 66 | + parent::clickContinueButton();
|
| 67 | +
|
| 68 | + // 'Name' page
|
| 69 | + parent::completeNamePage();
|
| 70 | +
|
| 71 | + // 'Options' page
|
| 72 | + parent::clickContinueButton();
|
| 73 | +
|
| 74 | + // 'Install' page
|
| 75 | + $this->assertEquals( "Creating database user... done",
|
| 76 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/ul/li[2]" ));
|
| 77 | + parent::clickContinueButton();
|
| 78 | +
|
| 79 | + // 'Complete' page
|
| 80 | + $this->assertEquals( "Complete!", $this->getText( "//div[@id='bodyContent']/div/div/h2" ));
|
| 81 | + $this->assertEquals( "Congratulations!",
|
| 82 | + $this->getText( "//div[@id='bodyContent']/div/div/div[2]/form/div[1]/div[2]/b" ));
|
| 83 | + $this->chooseCancelOnNextConfirmation();
|
| 84 | + }
|
| 85 | +}
|