961f6920a92524aedec805b2d7b985cb51f8cc34
[lhc/web/wiklou.git] / tests / selenium / installer / MediaWikiHelpFieldHintTestCase.php
1 <?php
2
3 /**
4 * MediaWikiHelpFieldHintTestCase
5 *
6 * @file
7 * @ingroup Maintenance
8 * Copyright (C) 2010 Nadeesha Weerasinghe <nadeesha@calcey.com>
9 * http://www.calcey.com/
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 /**
31 * Test Case ID : 29 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
32 * Test Case Name : Help field hint availability for the fields.
33 * Version : MediaWiki 1.18alpha
34 */
35
36 require_once ( __DIR__ . '/MediaWikiInstallationCommonFunction.php' );
37
38 class MediaWikiHelpFieldHintTestCase extends MediaWikiInstallationCommonFunction {
39 function setUp() {
40 parent::setUp();
41 }
42
43 // Verify help field availability for the fields
44 public function testMySQLConnectToDatabaseFieldHint() {
45
46 parent::navigateConnetToDatabasePage();
47
48 // Verify help field for 'Database host'
49 $this->click( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[1]" );
50 $this->assertEquals( MYSQL_DATABASE_HOST_HELP,
51 $this->getText( "//div[@id='DB_wrapper_mysql']/div/div[1]/div/span[2]" ) );
52
53 // Verify help field for 'Database name'
54 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[1]" );
55 $this->assertEquals( MYSQL_DATABASE_NAME_HELP,
56 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]" ) );
57
58
59 // Verify help field for 'Database table prefix'
60 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[2]/div[1]/div/span[1]" );
61 $this->assertEquals( MYSQL_DATABASE_TABLE_PREFIX_HELP,
62 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[1]/div[1]/div[1]/div/span[2]/p[1]" ) );
63
64 // Verify help field for 'Database username'
65 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[1]" );
66 $this->assertEquals( MYSQL_DATBASE_USERNAME_HELP,
67 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[1]/div[1]/div/span[2]" ) );
68
69 // Verify help field for 'Database password'
70 $this->click( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[1]" );
71 $this->assertEquals( MYSQL_DATABASE_PASSWORD_HELP,
72 $this->getText( "//div[@id='DB_wrapper_mysql']/fieldset[2]/div[2]/div[1]/div/span[2]/p" ) );
73 }
74
75 public function testSQLiteConnectToDatabaseFieldHint() {
76 parent::navigateConnetToDatabasePage();
77 $this->click( "DBType_sqlite" );
78
79 // Verify help field for 'SQLite data directory'
80 $this->click( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[1]" );
81 $this->assertEquals( SQLITE_DATA_DIRECTORY_HELP,
82 $this->getText( "//div[@id='DB_wrapper_sqlite']/div[1]/div[1]/div/span[2]" ) );
83
84 // Verify help field for 'Database name'
85 $this->click( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[1]" );
86 $this->assertEquals( SQLITE_DATABASE_NAME_HELP, $this->getText( "//div[@id='DB_wrapper_sqlite']/div[2]/div[1]/div/span[2]/p" ) );
87 }
88
89 public function testDatabaseSettingsFieldHint() {
90
91 $databaseName = DB_NAME_PREFIX . "_db_field";
92 parent::navigateDatabaseSettingsPage( $databaseName );
93
94 // Verify help field for 'Search engine'
95 $this->click( LINK_FORM . "div[2]/span[1]" );
96 $this->assertEquals( SEARCH_ENGINE_HELP,
97 $this->getText( LINK_FORM . "div[2]/span[2]" ) );
98
99 // Verify help field for 'Database character set'
100 $this->click( LINK_FORM . "div[4]/span[1]" );
101 $this->assertEquals( DATABASE_CHARACTER_SET_HELP,
102 $this->getText( LINK_FORM . "div[4]/span[2]" ) );
103 parent::restartInstallation();
104 }
105
106 public function testNameFieldHint() {
107 $databaseName = DB_NAME_PREFIX . "_name_field";
108 parent::navigateNamePage( $databaseName );
109
110 // Verify help field for 'Name of Wiki'
111 $this->click( LINK_FORM . "div[1]/div[1]/div/span[1]" );
112 $this->assertEquals( NAME_OF_WIKI_HELP,
113 $this->getText( LINK_FORM . "div[1]/div[1]/div/span[2]/p" ) );
114
115 // Verify help field for 'Project namespace'
116 $this->click( LINK_FORM . "div[2]/div[1]/div/span[1]" );
117 $this->assertEquals( PROJECT_NAMESPACE_HELP,
118 $this->getText( LINK_FORM . "div[2]/div[1]/div/span[2]/p" ) );
119
120 // Verify help field for 'Your Name'
121 $this->click( LINK_FORM . "fieldset/div[1]/div[1]/div/span[1]" );
122 $this->assertEquals( USER_NAME_HELP,
123 $this->getText( LINK_FORM . "fieldset/div[1]/div[1]/div/span[2]/p" ) );
124
125 // Verify help field for 'E mail address'
126 $this->click( LINK_FORM . "fieldset/div[4]/div[1]/div/span[1]" );
127 $this->assertEquals( EMAIL_ADDRESS_HELP,
128 $this->getText( LINK_FORM . "fieldset/div[4]/div[1]/div/span[2]/p" ) );
129
130 parent::restartInstallation();
131 }
132 }
133