Skip to content

Commit

Permalink
ログ表示(確認)
Browse files Browse the repository at this point in the history
  • Loading branch information
h.matsuo committed Mar 16, 2022
1 parent cfd6102 commit 8341226
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions codeception/acceptance/EA08SysteminfoCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,37 @@ public function systeminfo_権限管理削除(AcceptanceTester $I)
$I->seeInTitle('コンテンツ管理');
}

public function systeminfo_ログ表示_確認(AcceptanceTester $I)
{
$admin_route = Fixtures::get('config')['eccube_admin_route'];
$access_url = "/{$admin_route}/product";
$now = new DateTime();

$I->wantTo('EA0806-UC01-T01 ログ表示(確認)');

$I->amOnPage($access_url);
$I->see('商品一覧商品管理', '.c-pageTitle');

$I->amOnPage("/{$admin_route}/setting/system/log");
$I->see('ログ表示システム設定', '.c-pageTitle');

$log_filename = 'admin-'. $now->format('Y-m-d') . '.log';
$I->seeInField('#admin_system_log_files', $log_filename);

$I->click('#form1 button:nth-child(1)');
$logs = $I->grabTextFrom('.c-contentsArea textarea');

$result = preg_match("|^.*{$access_url}.*$|m", $logs, $matches);
$I->assertEquals($result, 1);
$I->assertRegExp('/\['.$now->format('Y-m-d').' \d+:\d+:\d+\]/', $matches[0]);
}

/**
* @group vaddy
*/
public function systeminfo_ログ表示(AcceptanceTester $I)
public function systeminfo_ログ表示_正常(AcceptanceTester $I)
{
$I->wantTo('EA0806-UC02-T01 ログ表示');
$I->wantTo('EA0806-UC02-T01 ログ表示(正常)');

// 表示
$config = Fixtures::get('config');
Expand Down

0 comments on commit 8341226

Please sign in to comment.