public function testDifferentDatabaseAccount()
 {
     $databaseName = DB_NAME_PREFIX . "_dif_accounts";
     // Navigate to the 'Database settings' page
     parent::navigateDatabaseSettingsPage($databaseName);
     // Click on the 'Use the same account as for installation' check box
     $this->click("mysql__SameAccount");
     // Change the 'Database username'
     $this->type("mysql_wgDBuser", DB_WEB_USER);
     // Enter 'Database password:'******'Create the account if it does not already exist' check box
     $this->click("mysql__CreateDBAccount");
     parent::clickContinueButton();
     // 'Name' page
     parent::completeNamePage();
     // 'Options' page
     parent::clickContinueButton();
     // 'Install' page
     $this->assertEquals("Creating database user... done", $this->getText(LINK_FORM . "ul/li[3]"));
     parent::clickContinueButton();
     // 'Complete' page
     parent::completePageSuccessfull();
     $this->chooseCancelOnNextConfirmation();
 }
 public function testDatabaseSettingsFieldHint()
 {
     $databaseName = DB_NAME_PREFIX . "_db_field";
     parent::navigateDatabaseSettingsPage($databaseName);
     // Verify help field for 'Search engine'
     $this->click(LINK_FORM . "div[2]/span[1]");
     $this->assertEquals(SEARCH_ENGINE_HELP, $this->getText(LINK_FORM . "div[2]/span[2]"));
     // Verify help field for 'Database character set'
     $this->click(LINK_FORM . "div[4]/span[1]");
     $this->assertEquals(DATABASE_CHARACTER_SET_HELP, $this->getText(LINK_FORM . "div[4]/span[2]"));
     parent::restartInstallation();
 }
 public function testCancelRestartInstallation()
 {
     $dbNameBeforeRestart = DB_NAME_PREFIX . "_cancel_restart";
     parent::navigateDatabaseSettingsPage($dbNameBeforeRestart);
     // Verify 'Restart installation' link available
     $this->assertTrue($this->isElementPresent("link=Restart installation"));
     $this->click("link=Restart installation");
     $this->waitForPageToLoad(PAGE_LOAD_TIME);
     // 'Restart Installation' page displayed
     $this->assertEquals("Restart installation", $this->getText(LINK_DIV . "h2"));
     // Restart warning message displayed
     $this->assertTrue($this->isTextPresent("Do you want to clear all saved data that you have entered and restart the installation process?"));
     // Click on the 'Back' button
     parent::clickBackButton();
     // Navigates to the previous page
     $this->assertEquals("Database settings", $this->getText(LINK_DIV . "h2"));
     // 'Connect to database' page
     parent::clickBackButton();
     // Saved data remain on the page.
     $dbNameAfterRestart = $this->getValue("mysql_wgDBname");
     $this->assertEquals($dbNameBeforeRestart, $dbNameAfterRestart);
 }
 public function testBothButtonsAvailability()
 {
     // Verify buttons availability on 'Welcome to MediaWiki' page
     parent::navigateWelcometoMediaWikiPage();
     $this->assertTrue($this->isElementPresent("submit-back"));
     $this->assertTrue($this->isElementPresent("submit-continue"));
     parent::restartInstallation();
     // Verify buttons availability on 'Connect to Database' page
     parent::navigateConnetToDatabasePage();
     $this->assertTrue($this->isElementPresent("submit-back"));
     $this->assertTrue($this->isElementPresent("submit-continue"));
     parent::restartInstallation();
     // Verify buttons availability on 'Database settings' page
     $databaseName = DB_NAME_PREFIX . "_db_settings";
     parent::navigateDatabaseSettingsPage($databaseName);
     $this->assertTrue($this->isElementPresent("submit-back"));
     $this->assertTrue($this->isElementPresent("submit-continue"));
     parent::restartInstallation();
     // Verify buttons availability on 'Name' page
     $databaseName = DB_NAME_PREFIX . "_name";
     parent::navigateNamePage($databaseName);
     $this->assertTrue($this->isElementPresent("submit-back"));
     $this->assertTrue($this->isElementPresent("submit-continue"));
     parent::restartInstallation();
     // Verify buttons availability on 'Options' page
     $databaseName = DB_NAME_PREFIX . "_options";
     parent::navigateOptionsPage($databaseName);
     $this->assertTrue($this->isElementPresent("submit-back"));
     $this->assertTrue($this->isElementPresent("submit-continue"));
     parent::restartInstallation();
     // Verify buttons availability on 'Install' page
     $databaseName = DB_NAME_PREFIX . "_install";
     parent::navigateInstallPage($databaseName);
     $this->assertTrue($this->isElementPresent("submit-back"));
     $this->assertTrue($this->isElementPresent("submit-continue"));
 }
 public function testDatabaseSettingsUI()
 {
     $databaseName = DB_NAME_PREFIX . "_db_settings_UI";
     parent::navigateDatabaseSettingsPage($databaseName);
     // 'Database settings' text available.
     $this->assertEquals("Database settings", $this->getText(LINK_DIV . "h2"));
     // 'Database account for web access' section available
     $this->assertTrue($this->isElementPresent(LINK_FORM . "fieldset"));
     // 'Database account for web access' label available
     $this->assertEquals("Database account for web access", $this->getText(LINK_FORM . "fieldset/legend"));
     // 'Use the same account as for installation' check box available
     $this->assertEquals("Use the same account as for installation", $this->getText(LINK_FORM . "fieldset/div[1]/label"));
     // 'Use the same account as for installation' check box is selected by default
     $this->assertEquals("on", $this->getValue("mysql__SameAccount"));
     // 'Use the same account as for installation' check box deselected
     $this->click("mysql__SameAccount");
     // verify 'Use the same account as for installation' check box is not selected
     $this->assertEquals("off", $this->getValue("mysql__SameAccount"));
     // 'Database username' label available
     $this->assertEquals("Database username:"******"//div[@id='dbOtherAccount']/div[1]/div[1]/label"));
     // 'Database username' text box is default to the 'wikiuser'
     $this->assertEquals("wikiuser", $this->getValue("mysql_wgDBuser"));
     // 'Database password' label available
     $this->assertEquals("Database password:"******"//div[@id='dbOtherAccount']/div[2]/div[1]/label"));
     // 'Create the account if it does not already exist' label available
     $this->assertEquals("Create the account if it does not already exist", $this->getText("//div[@id='dbOtherAccount']/div[4]/label"));
     // 'Create the account if it does not already exist' check box is not selected by default
     $this->assertEquals("off", $this->getValue("mysql__CreateDBAccount"));
     //  'Create the account if it does not already exist' check box selected
     $this->click("mysql__CreateDBAccount");
     // Verify  'Create the account if it does not already exist' check box is selected
     $this->assertEquals("on", $this->getValue("mysql__CreateDBAccount"));
     $this->click("mysql__SameAccount");
     $this->assertEquals("on", $this->getValue("mysql__SameAccount"));
     // 'Storage engine' label available
     $this->assertEquals("Storage engine:", $this->getText(LINK_FORM . "div[1]/div[1]/label"));
     // 'InnoDB' label available
     $this->assertEquals("InnoDB", $this->getText(LINK_FORM . "div[1]/div[2]/ul/li[1]/label"));
     // 'InnoDB' radio button available
     $this->assertTrue($this->isElementPresent("mysql__MysqlEngine_InnoDB"));
     // 'MyISAM' label available
     $this->assertEquals("MyISAM", $this->getText(LINK_FORM . "div[1]/div[2]/ul/li[2]/label"));
     // 'MyISAM' radio button available
     $this->assertTrue($this->isElementPresent("mysql__MysqlEngine_MyISAM"));
     // 'Database character set' label available
     $this->assertEquals("Database character set:", $this->getText(LINK_FORM . "div[3]/div[1]/label"));
     // 'Binary' radio button available
     $this->assertTrue($this->isElementPresent("mysql__MysqlCharset_binary"));
     // 'Binary' radio button available
     $this->assertEquals("Binary", $this->getText(LINK_FORM . "div[3]/div[2]/ul/li[1]/label"));
     // 'UTF-8' radio button available
     $this->assertTrue($this->isElementPresent("mysql__MysqlCharset_utf8"));
     // 'UTF-8' label available
     $this->assertEquals("UTF-8", $this->getText(LINK_FORM . "div[3]/div[2]/ul/li[2]/label"));
     // 'Binary' radio button is selected
     $this->assertEquals("on", $this->getValue("mysql__MysqlCharset_binary"));
 }