1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-22 07:47:10 +01:00
php-e107/tests/acceptance/InstallCest.php

129 lines
3.0 KiB
PHP
Raw Normal View History

<?php
class InstallCest
{
2018-02-19 15:19:56 -06:00
public function _before(AcceptanceTester $I)
{
}
public function _after(AcceptanceTester $I)
{
}
// tests
public function installWelcomePageContainsExpectedContent(AcceptanceTester $I)
{
$I->amOnPage('/install.php');
2018-02-16 13:34:08 -08:00
$I->see("e107 Installation :: Step 1");
$I->see("Language Selection");
2018-02-19 15:19:56 -06:00
}
2018-02-16 13:34:08 -08:00
public function installStep1ToStep2(AcceptanceTester $I)
2018-02-19 15:19:56 -06:00
{
$I->amOnPage('/install.php');
$I->wantTo("Verify Proceed to Step 2 of the Installation");
2018-02-16 13:34:08 -08:00
$I->selectOption("language", 'English');
$I->click('start');
$I->see("MySQL Server Details", 'h3');
2018-02-19 15:19:56 -06:00
}
2018-02-16 15:42:29 -08:00
2018-02-19 15:19:56 -06:00
public function installStep2ToStep3(AcceptanceTester $I)
{
$I->amOnPage('/install.php');
$I->wantTo("Verify Proceed to Step 3 of the Installation");
$db = $I->getHelperDb();
$this->installStep1ToStep2($I);
2018-02-16 15:42:29 -08:00
$I->fillField('server', $db->_getDbHostname());
$I->fillField('name', $db->_getDbUsername());
$I->fillField('password', $db->_getDbPassword());
$I->fillField('db', $db->_getDbName());
2018-02-17 16:28:57 -08:00
$I->uncheckOption('createdb');
$I->click('submit');
2018-02-16 15:42:29 -08:00
2018-02-17 16:28:57 -08:00
$I->see("MySQL Connection Verification", 'h3');
2018-02-16 15:42:29 -08:00
// ....
2018-02-19 15:19:56 -06:00
}
2018-02-17 16:28:57 -08:00
public function installStep3ToStep4(AcceptanceTester $I)
2018-02-19 15:19:56 -06:00
{
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->amOnPage('/install.php');
$I->wantTo("Verify Proceed to Step 4 of the Installation");
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$this->installStep2ToStep3($I);
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
// $I->see("Connection to the MySQL server established and verified");
2018-02-17 16:28:57 -08:00
$I->see("Found existing database");
$I->click('submit');
$I->see("PHP and MySQL Versions Check / File Permissions Check");
2018-02-19 15:19:56 -06:00
}
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
public function installStep4ToStep5(AcceptanceTester $I) // TODO Fails due to e107_config.php being present.
{
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->amOnPage('/install.php');
$I->wantTo("Verify Proceed to Step 5 of the Installation");
2018-02-17 16:28:57 -08:00
$this->installStep3ToStep4($I);
$I->canSee('You might have an existing installation'); //XXX Triggered if e107_config.php is not empty
2018-02-19 15:19:56 -06:00
$I->click('continue_install');
2018-02-17 16:28:57 -08:00
$I->see("Administration", 'h3');
2018-02-19 15:19:56 -06:00
}
2018-02-17 16:28:57 -08:00
public function installStep5ToStep6(AcceptanceTester $I)
2018-02-19 15:19:56 -06:00
{
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->amOnPage('/install.php');
$I->wantTo("Verify Proceed to Step 6 of the Installation");
$this->installStep4ToStep5($I);
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->fillField('u_name', 'admin');
2018-02-17 16:28:57 -08:00
$I->fillField('d_name', 'admin');
$I->fillField('pass1', 'admin');
$I->fillField('pass2', 'admin');
$I->fillField('email', 'admin@admin.com');
2018-02-19 15:19:56 -06:00
$I->click('submit');
2018-02-17 16:28:57 -08:00
$I->see("Website Preferences", 'h3');
2018-02-19 15:19:56 -06:00
}
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
public function installStep6ToStep7(AcceptanceTester $I)
{
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->amOnPage('/install.php');
$I->wantTo("Verify Proceed to Step 7 of the Installation");
$this->installStep5ToStep6($I);
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->fillField('sitename', 'Test Site');
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->click('submit');
2018-02-17 16:28:57 -08:00
$I->see("Install Confirmation", 'h3');
2018-02-19 15:19:56 -06:00
}
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
public function installStep7ToStep8(AcceptanceTester $I)
{
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->amOnPage('/install.php');
$I->wantTo("Verify Proceed to Step 8 of the Installation");
$this->installStep6ToStep7($I);
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->see("Install Confirmation", 'h3');
2018-02-17 16:28:57 -08:00
2018-02-19 15:19:56 -06:00
$I->click('submit');
2018-02-17 16:28:57 -08:00
$I->see("Install Confirmation", 'h3');
2018-02-19 15:19:56 -06:00
}
}