Merge "Minor CSS cleanup for Vector and Monobook skins"
[mediawiki.git] / tests / selenium / installer / MediaWikiHelpFieldHintTestCase.php
blobf0efce6e5a7dc0f9b7c1a448c98371299a93d39a
1 <?php
2 /**
3 * MediaWikiHelpFieldHintTestCase
5 * @file
6 * @ingroup Maintenance
7 * Copyright (C) 2010 Nadeesha Weerasinghe <nadeesha@calcey.com>
8 * http://www.calcey.com/
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * http://www.gnu.org/copyleft/gpl.html
26 require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
28 /**
29 * Test Case ID : 29 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
30 * Test Case Name : Help field hint availability for the fields.
31 * Version : MediaWiki 1.18alpha
33 class MediaWikiHelpFieldHintTestCase extends MediaWikiInstallationCommonFunction {
34 function setUp() {
35 parent::setUp();
38 // Verify help field availability for the fields
39 public function testMySQLConnectToDatabaseFieldHint() {
41 parent::navigateConnetToDatabasePage();
43 // Verify help field for 'Database host'
44 $this->click( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[1]" );
45 $this->assertEquals( MYSQL_DATABASE_HOST_HELP,
46 $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[2]" ) );
48 // Verify help field for 'Database name'
49 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[1]" );
50 $this->assertEquals( MYSQL_DATABASE_NAME_HELP,
51 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]" ) );
54 // Verify help field for 'Database table prefix'
55 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/div/span[1]" );
56 $this->assertEquals( MYSQL_DATABASE_TABLE_PREFIX_HELP,
57 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]/p[1]" ) );
59 // Verify help field for 'Database username'
60 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[1]" );
61 $this->assertEquals( MYSQL_DATBASE_USERNAME_HELP,
62 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[2]" ) );
64 // Verify help field for 'Database password'
65 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[1]" );
66 $this->assertEquals( MYSQL_DATABASE_PASSWORD_HELP,
67 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[2]/p" ) );
70 public function testSQLiteConnectToDatabaseFieldHint() {
71 parent::navigateConnetToDatabasePage();
72 $this->click( "DBType_sqlite" );
74 // Verify help field for 'SQLite data directory'
75 $this->click( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[1]" );
76 $this->assertEquals( SQLITE_DATA_DIRECTORY_HELP,
77 $this->getText( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[2]" ) );
79 // Verify help field for 'Database name'
80 $this->click( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[1]" );
81 $this->assertEquals( SQLITE_DATABASE_NAME_HELP, $this->getText( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[2]/p" ) );
84 public function testDatabaseSettingsFieldHint() {
86 $databaseName = DB_NAME_PREFIX . "_db_field";
87 parent::navigateDatabaseSettingsPage( $databaseName );
89 // Verify help field for 'Search engine'
90 $this->click( LINK_FORM . "div[2]/span[1]" );
91 $this->assertEquals( SEARCH_ENGINE_HELP,
92 $this->getText( LINK_FORM . "div[2]/span[2]" ) );
94 // Verify help field for 'Database character set'
95 $this->click( LINK_FORM . "div[4]/span[1]" );
96 $this->assertEquals( DATABASE_CHARACTER_SET_HELP,
97 $this->getText( LINK_FORM . "div[4]/span[2]" ) );
98 parent::restartInstallation();
101 public function testNameFieldHint() {
102 $databaseName = DB_NAME_PREFIX . "_name_field";
103 parent::navigateNamePage( $databaseName );
105 // Verify help field for 'Name of Wiki'
106 $this->click( LINK_FORM . "div[1]/div[1]/div/span[1]" );
107 $this->assertEquals( NAME_OF_WIKI_HELP,
108 $this->getText( LINK_FORM . "div[1]/div[1]/div/span[2]/p" ) );
110 // Verify help field for 'Project namespace'
111 $this->click( LINK_FORM . "div[2]/div[1]/div/span[1]" );
112 $this->assertEquals( PROJECT_NAMESPACE_HELP,
113 $this->getText( LINK_FORM . "div[2]/div[1]/div/span[2]/p" ) );
115 // Verify help field for 'Your Name'
116 $this->click( LINK_FORM . "fieldset/div[1]/div[1]/div/span[1]" );
117 $this->assertEquals( USER_NAME_HELP,
118 $this->getText( LINK_FORM . "fieldset/div[1]/div[1]/div/span[2]/p" ) );
120 // Verify help field for 'E mail address'
121 $this->click( LINK_FORM . "fieldset/div[4]/div[1]/div/span[1]" );
122 $this->assertEquals( EMAIL_ADDRESS_HELP,
123 $this->getText( LINK_FORM . "fieldset/div[4]/div[1]/div/span[2]/p" ) );
125 parent::restartInstallation();