Use __DIR__ instead of dirname( __FILE__ )
[lhc/web/wiklou.git] / tests / selenium / installer / MediaWikiButtonsAvailabilityTestCase.php
1 <?php
2
3 /**
4 * MediaWikiButtonsAvailabilityTestCase
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 require_once (__DIR__.'/'.'MediaWikiInstallationCommonFunction.php');
32
33 /**
34 * Test Case ID : 30 (http://www.mediawiki.org/wiki/New_installer/Test_plan)
35 * Test Case Name :'Back' and 'Continue' button availability
36 * Version : MediaWiki 1.18alpha
37 */
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 }