Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2Eテスト追加: システム設定 #5325

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 59 additions & 1 deletion codeception/acceptance/EA08SysteminfoCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Page\Admin\AuthorityManagePage;
use Page\Admin\LoginHistoryPage;
use Page\Admin\MasterDataManagePage;
use Page\Admin\SystemMemberEditPage;

/**
* @group admin
Expand Down Expand Up @@ -353,6 +354,63 @@ public function systeminfo_セキュリティ管理IP制限_拒否リスト(Acce
$I->see('保存しました', AuthorityManagePage::$完了メッセージ);
}

/**
* @group vaddy
*/
public function systeminfo_権限管理登録(AcceptanceTester $I)
{
// 店舗オーナーアカウントを作成
$page = SystemMemberEditPage::go_new($I)
->メンバー登録([
'login_id' => 'shop_owner',
'authority' => '店舗オーナー',
])
->登録();

$I->wantTo('EA0805-UC01-T01 権限管理 - 登録');

// 設定を追加
AuthorityManagePage::go($I)
->行追加()
->入力(1, ['1' => '店舗オーナー'], '/setting')
->登録();
$I->see('保存しました', AuthorityManagePage::$完了メッセージ);

$I->wantTo('EA0805-UC01-T02 権限管理 - 登録');

// 店舗オーナーでログインし、ナビに表示されないことを確認
$I->logoutAsAdmin();
$I->loginAsAdmin('shop_owner', 'password');
$I->click(['css' => 'a[href="#nav-setting"]']);
$I->wait(1);
$I->dontSee('システム設定', '#nav-setting');

// URL直でもアクセスできないことを確認
$config = Fixtures::get('config');
$I->amOnPage("/${config['eccube_admin_route']}/setting/system/member");
$I->seeInTitle('アクセスできません');

// 設定を削除
$I->amOnPage("/{$config['eccube_admin_route']}/logout");
$I->loginAsAdmin();

AuthorityManagePage::go($I)
->行削除(1)
->登録();
$I->see('保存しました', AuthorityManagePage::$完了メッセージ);

// 店舗オーナーアカウントでアクセスできることを確認
$I->logoutAsAdmin();
$I->loginAsAdmin('shop_owner', 'password');

$I->click(['css' => 'a[href="#nav-setting"]']);
$I->wait(1);
$I->see('システム設定', '#nav-setting');

$I->amOnPage("/${config['eccube_admin_route']}/setting/system/member");
$I->seeInTitle('メンバー管理');
}

/**
* @group vaddy
*/
Expand Down Expand Up @@ -417,7 +475,7 @@ public function systeminfo_ログ表示(AcceptanceTester $I)
$I->click(['css' => '#form1 button']);

$logs = $I->grabTextFrom('.c-contentsArea textarea');
$I->assertLessThanOrEqual(10, count(explode("\n", $logs)), "ログ件数を確認");
$I->assertLessThanOrEqual(10, count(explode("\n", $logs)), 'ログ件数を確認');
$I->seeInField(['id' => 'admin_system_log_line_max'], '10');
}

Expand Down