public function testDifferentDatabasePrefix()
 {
     $databaseName = DB_NAME_PREFIX . "_db_prefix";
     parent::navigateInstallPage($databaseName);
     // To 'Options' page
     parent::clickBackButton();
     // To 'Name' page
     parent::clickBackButton();
     // To 'Database settings' page
     parent::clickBackButton();
     // To 'Connect to database' page
     parent::clickBackButton();
     // From 'Connect to database' page without database prefix
     parent::clickContinueButton();
     // Verify upgrade existing message
     $this->assertEquals("Upgrade existing installation", $this->getText(LINK_DIV . "h2"));
     // To 'Connect to database' page
     parent::clickBackButton();
     // Input the database prefix
     $this->type("mysql_wgDBprefix", DATABASE_PREFIX);
     // From 'Connect to database' page with database prefix
     parent::clickContinueButton();
     // To 'Complete' page
     parent::clickContinueButton();
     parent::completeNamePage();
     parent::clickContinueButton();
     // Verify already installed warning message
     $this->assertEquals("Install", $this->getText(LINK_DIV . "h2"));
     $this->assertEquals("Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.", $this->getText(LINK_FORM . "div[1]"));
     parent::clickContinueButton();
     parent::completePageSuccessfull();
     $this->chooseCancelOnNextConfirmation();
     parent::restartInstallation();
 }
 public function testUpgradeExistingDatabase()
 {
     $databaseName = DB_NAME_PREFIX . "_upgrade_existing";
     parent::navigateInstallPage($databaseName);
     $this->open("http://*****:*****@id='bodyContent']/div/div[1]/div[4]/form/div[1]/div[2]/p[1]"));
     $this->assertEquals("You can now Folder/index.php start using your wiki.", $this->getText("//div[@id='bodyContent']/div/div[1]/div[4]/form/div[1]/div[2]/p[2]"));
     $this->assertEquals("Folder/index.php start using your wiki", $this->getText("link=Folder/index.php start using your wiki"));
     $this->assertTrue($this->isElementPresent("submit-regenerate"));
     $this->click("submit-regenerate");
     $this->waitForPageToLoad(PAGE_LOAD_TIME);
     $this->assertEquals("Database settings", $this->getText(LINK_DIV . "h2"));
     // 'Database settings' page
     parent::clickContinueButton();
     // Name page
     parent::completeNamePage();
     // Options page
     parent::clickContinueButton();
     // Install page
     $this->assertEquals("Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.", $this->getText(LINK_FORM . "div[1]/div[2]"));
     parent::clickContinueButton();
     // complete
     parent::completePageSuccessfull();
     $this->chooseCancelOnNextConfirmation();
     parent::restartInstallation();
 }
 public function testInstallOnAlreadyInstalled()
 {
     $databaseName = DB_NAME_PREFIX . "_already_installed";
     parent::navigateInstallPage($databaseName);
     // 'Options' page
     parent::clickBackButton();
     // Install page
     parent::clickContinueButton();
     // 'Install' page should display after the 'Option' page
     $this->assertEquals("Install", $this->getText(LINK_DIV . "h2"));
     // Verify warning text displayed
     $this->assertEquals("Warning: You seem to have already installed MediaWiki and are trying to install it again. Please proceed to the next page.", $this->getText(LINK_FORM . "div[1]/div[2]"));
     // Complete page
     parent::clickContinueButton();
     parent::completePageSuccessfull();
     $this->chooseCancelOnNextConfirmation();
     parent::restartInstallation();
 }
 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 testInstallPageUI()
 {
     $databaseName = DB_NAME_PREFIX . "_install_UI";
     parent::navigateInstallPage($databaseName);
     // Verify installation done messages display
     $this->assertEquals("Setting up database... done", $this->getText(LINK_FORM . "ul/li[1]"));
     $this->assertEquals("Creating tables... done", $this->getText(LINK_FORM . "ul/li[2]"));
     $this->assertEquals("Creating database user... done", $this->getText(LINK_FORM . "ul/li[3]"));
     $this->assertEquals("Populating default interwiki table... done", $this->getText(LINK_FORM . "ul/li[4]"));
     $this->assertEquals("Generating secret key... done", $this->getText(LINK_FORM . "ul/li[5]"));
     $this->assertEquals("Generating default upgrade key... done", $this->getText(LINK_FORM . "ul/li[6]"));
     $this->assertEquals("Creating administrator user account... done", $this->getText(LINK_FORM . "ul/li[7]"));
     $this->assertEquals("Creating main page with default content... done", $this->getText(LINK_FORM . "ul/li[8]"));
 }