public function testPageNavigation()
 {
     $this->open("http://" . HOST_NAME . ":" . PORT . "/" . DIRECTORY_NAME . "/config/index.php");
     // Navigate to the 'Read me' page
     $this->click("link=Read me");
     $this->waitForPageToLoad(PAGE_LOAD_TIME);
     $this->assertEquals("Read me", $this->getText(LINK_DIV . "h2[1]"));
     $this->assertTrue($this->isElementPresent("submit-back"));
     parent::clickBackButton();
     // Navigate to the 'Release notes' page
     $this->click("link=Release notes");
     $this->waitForPageToLoad(PAGE_LOAD_TIME);
     $this->assertEquals("Release notes", $this->getText(LINK_DIV . "h2[1]"));
     $this->assertTrue($this->isElementPresent("submit-back"));
     parent::clickBackButton();
     // Navigate to the 'Copying' page
     $this->click("link=Copying");
     $this->waitForPageToLoad(PAGE_LOAD_TIME);
     $this->assertEquals("Copying", $this->getText(LINK_DIV . "h2[1]"));
     $this->assertTrue($this->isElementPresent("submit-back"));
     parent::clickBackButton();
     // Navigate to the 'Upgrading' page
     $this->click("link=Upgrading");
     $this->waitForPageToLoad(PAGE_LOAD_TIME);
     $this->assertEquals("Upgrading", $this->getText(LINK_DIV . "h2[1]"));
 }
 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 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);
 }