mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
테스트 설정 정리
This commit is contained in:
parent
3fa042c2fb
commit
2792590e4a
6 changed files with 2254 additions and 0 deletions
24
tests/Install.suite.dist.yml
Normal file
24
tests/Install.suite.dist.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
class_name: InstallTester
|
||||
modules:
|
||||
enabled: [Db, PhpBrowser, DbDropTablesHelper, InstallHelper]
|
||||
config:
|
||||
PhpBrowser:
|
||||
url: 'http://localhost:8000/'
|
||||
DbDropTablesHelper:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
|
||||
user: 'root'
|
||||
password: 'root'
|
||||
Db:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
|
||||
user: 'root'
|
||||
password: 'root'
|
||||
cleanup: true
|
||||
env:
|
||||
travis:
|
||||
modules:
|
||||
config:
|
||||
Db:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
|
||||
user: 'travis'
|
||||
password: 'travis'
|
||||
cleanup: true
|
||||
15
tests/Install.suite.yml
Normal file
15
tests/Install.suite.yml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
class_name: InstallTester
|
||||
modules:
|
||||
enabled: [Db, PhpBrowser, DbDropTablesHelper, InstallHelper]
|
||||
config:
|
||||
PhpBrowser:
|
||||
url: 'http://coretest.udada.kr/'
|
||||
DbDropTablesHelper:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xecore_test'
|
||||
user: 'root'
|
||||
password: 'root'
|
||||
Db:
|
||||
dsn: 'mysql:host=127.0.0.1;dbname=xecore_test'
|
||||
user: 'root'
|
||||
password: 'root'
|
||||
cleanup: true
|
||||
104
tests/Install/InstallCept.php
Normal file
104
tests/Install/InstallCept.php
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
use \Codeception\Configuration;
|
||||
|
||||
$I = new InstallTester($scenario);
|
||||
|
||||
$config = (!$this->env) ? Configuration::suiteSettings('Install', 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');
|
||||
|
||||
2099
tests/Install/InstallTester.php
Normal file
2099
tests/Install/InstallTester.php
Normal file
File diff suppressed because it is too large
Load diff
2
tests/Install/_bootstrap.php
Normal file
2
tests/Install/_bootstrap.php
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<?php
|
||||
// Here you can initialize variables that will be available to your tests
|
||||
10
tests/_support/InstallHelper.php
Normal file
10
tests/_support/InstallHelper.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Codeception\Module;
|
||||
|
||||
class InstallHelper extends \Codeception\Module
|
||||
{
|
||||
public function _initialize()
|
||||
{
|
||||
\Codeception\Util\FileSystem::deleteDir('files');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue