mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
설치 테스트 추가
This commit is contained in:
parent
0d24de74d3
commit
b07cd5f596
11 changed files with 2157 additions and 8 deletions
1918
tests/install/InstallTester.php
Normal file
1918
tests/install/InstallTester.php
Normal file
File diff suppressed because it is too large
Load diff
5
tests/install/_bootstrap.php
Normal file
5
tests/install/_bootstrap.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
// Here you can initialize variables that will be available to your tests
|
||||
|
||||
\Codeception\Util\Autoload::registerSuffix('Steps', __DIR__.DIRECTORY_SEPARATOR.'_steps');
|
||||
\Codeception\Util\Autoload::registerSuffix('Page', __DIR__.DIRECTORY_SEPARATOR.'_pages');
|
||||
41
tests/install/_pages/installPage.php
Normal file
41
tests/install/_pages/installPage.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
class installPage
|
||||
{
|
||||
// include url of current page
|
||||
public static $URL = '';
|
||||
|
||||
/**
|
||||
* Declare UI map for this page here. CSS or XPath allowed.
|
||||
* public static $usernameField = '#username';
|
||||
* public static $formSubmitButton = "#mainForm input[type=submit]";
|
||||
*/
|
||||
|
||||
/**
|
||||
* Basic route example for your current URL
|
||||
* You can append any additional parameter to URL
|
||||
* and use it in tests like: EditPage::route('/123-post');
|
||||
*/
|
||||
public static function route($param)
|
||||
{
|
||||
return static::$URL.$param;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var InstallTester;
|
||||
*/
|
||||
protected $installTester;
|
||||
|
||||
public function __construct(InstallTester $I)
|
||||
{
|
||||
$this->installTester = $I;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return installPage
|
||||
*/
|
||||
public static function of(InstallTester $I)
|
||||
{
|
||||
return new static($I);
|
||||
}
|
||||
}
|
||||
18
tests/install/_steps/AdminSteps.php
Normal file
18
tests/install/_steps/AdminSteps.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
namespace InstallTester;
|
||||
|
||||
class AdminSteps extends \InstallTester
|
||||
{
|
||||
public function login()
|
||||
{
|
||||
$I = $this;
|
||||
}
|
||||
public function adminLogin()
|
||||
{
|
||||
$I = $this;
|
||||
}
|
||||
public function logout()
|
||||
{
|
||||
$I = $this;
|
||||
}
|
||||
}
|
||||
105
tests/install/installCept.php
Normal file
105
tests/install/installCept.php
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
use \Codeception\Configuration;
|
||||
|
||||
$I = new InstallTester($scenario);
|
||||
|
||||
$config = (!$this->env) ? Configuration::config() : Configuration::suiteEnvironments('install')[$this->env];
|
||||
$db_config = $config['modules']['config']['Db'];
|
||||
|
||||
$dsn = $db_config['dsn'];
|
||||
$dsn = split('[;:]', $dsn);
|
||||
$db_type = array_shift($dsn);
|
||||
|
||||
$dbinfo = [
|
||||
'type' => $db_type,
|
||||
'user' => $db_config['user'],
|
||||
'password' => $db_config['password'],
|
||||
'dbname' => 'xe_install',
|
||||
'port' => ((isset($db_config['port']) && $db_config['port'])?: 3306),
|
||||
];
|
||||
|
||||
foreach($dsn as $piece) {
|
||||
list($key, $val) = explode('=', $piece);
|
||||
$dbinfo[$key] = $val;
|
||||
}
|
||||
|
||||
// Step 1
|
||||
$I->wantTo('Install XE Core');
|
||||
$I->amOnPage('/index.php?l=ko');
|
||||
$I->setCookie('l', 'ko');
|
||||
$I->seeElement('//div[@id="progress"]/ul/li[1][@class="active"]');
|
||||
$I->seeElement('#content .language');
|
||||
$I->seeElement('//ul[@class="language"]/li[2]/strong');
|
||||
$I->click('#task-choose-language');
|
||||
|
||||
// Step 2 : License Agreement
|
||||
$I->seeInCurrentUrl('act=dispInstallLicenseAgreement');
|
||||
$I->seeElement('//div[@id="progress"]/ul/li[2][@class="active"]');
|
||||
$I->see('사용권 동의', '#content');
|
||||
$I->submitForm('.x_form-horizontal', ['act' => 'procInstallLicenseAggrement', 'license_agreement' => 'Y']);
|
||||
|
||||
// Step 3 : checkenv
|
||||
$I->seeInCurrentUrl('act=dispInstallCheckEnv');
|
||||
$I->seeElement('//div[@id="progress"]/ul/li[3][@class="active"]');
|
||||
$I->seeElement('#content .x_icon-ok-sign');
|
||||
$I->click('#task-checklist-confirm');
|
||||
|
||||
// Step 5 : SelectDB
|
||||
$I->seeInCurrentUrl('act=dispInstallSelectDB');
|
||||
$I->seeElement('//div[@id="progress"]/ul/li[5][@class="active"]');
|
||||
$I->submitForm('#content form', ['db_type' => 'mysqli', 'act' => 'dispInstallDBForm']);
|
||||
|
||||
// Step 6 : db info
|
||||
// $I->seeInCurrentUrl('act=dispInstallDBForm');
|
||||
$I->seeElement('//div[@id="progress"]/ul/li[6][@class="active"]');
|
||||
$I->submitForm('#content form', [
|
||||
'act' => 'procMysqlDBSetting',
|
||||
'db_type' => 'mysqli',
|
||||
'db_userid' => $dbinfo['user'],
|
||||
'db_password' => $dbinfo['password'],
|
||||
'db_database' => $dbinfo['dbname'],
|
||||
'db_hostname' => $dbinfo['host'],
|
||||
'db_port' => $dbinfo['port'],
|
||||
'db_table_prefix' => 'xe'
|
||||
]);
|
||||
|
||||
|
||||
// Step 7 : dispInstallConfigForm
|
||||
$I->seeInCurrentUrl('act=dispInstallConfigForm');
|
||||
$I->seeElement('//div[@id="progress"]/ul/li[7][@class="active"]');
|
||||
$I->seeElement('select[name=time_zone]');
|
||||
$I->submitForm('#content form', ['act' => 'procConfigSetting', 'time_zone' => '+0900']);
|
||||
|
||||
|
||||
// Step 8 : dispInstallManagerForm
|
||||
$I->seeInCurrentUrl('act=dispInstallManagerForm');
|
||||
$I->seeElement('//div[@id="progress"]/ul/li[8][@class="active"]');
|
||||
$I->fillField('#aMail', 'admin@admin.net');
|
||||
$I->submitForm('#content form', [
|
||||
'act' => 'procInstall',
|
||||
'db_type' => 'mysqli',
|
||||
'email_address' => 'admin@admin.net',
|
||||
'password' => 'admin',
|
||||
'password2' => 'admin',
|
||||
'nick_name' => 'admin',
|
||||
'user_id' => 'admin'
|
||||
]);
|
||||
|
||||
// Step 9
|
||||
$I->wantTo('completed');
|
||||
$I->dontSeeElement('//div[@id="progress"]/ul/li');
|
||||
$I->amOnPage('/index.php?act=dispMemberLoginForm');
|
||||
|
||||
$I->fillField('user_id', 'admin@admin.net');
|
||||
$I->submitForm('.login-body form', [
|
||||
'act' => 'procMemberLogin',
|
||||
'user_id' => 'admin@admin.net',
|
||||
'password' => 'admin',
|
||||
'success_return_url' => '/index.php?module=admin'
|
||||
]);
|
||||
|
||||
$I->seeInCurrentUrl('module=admin');
|
||||
$I->seeElement('#gnbNav');
|
||||
$I->seeElement('#content .x_page-header');
|
||||
$I->see('설치 환경 수집 동의', 'h2');
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue