Completed
Push — dev/product_visibility ( 1ee472 )
by Kiyotaka
06:23
created

EA08SysteminfoCest::systeminfo_セキュリティ管理IP制限()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 2
nop 1
dl 0
loc 21
rs 9.584
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.ec-cube.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
use Codeception\Util\Fixtures;
15
use Page\Admin\AuthorityManagePage;
16
use Page\Admin\LoginHistoryPage;
17
18
/**
19
 * @group admin
20
 * @group admin03
21
 * @group systeminformation
22
 * @group ea8
23
 */
24
class EA08SysteminfoCest
25
{
26
    public function _before(\AcceptanceTester $I)
27
    {
28
        $I->loginAsAdmin();
29
    }
30
31
    public function _after(\AcceptanceTester $I)
0 ignored issues
show
Unused Code introduced by
The parameter $I is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
    {
33
    }
34
35
    public function systeminfo_システム情報(\AcceptanceTester $I)
36
    {
37
        $I->wantTo('EA0801-UC01-T01 システム情報');
38
39
        // 表示
40
        $config = Fixtures::get('config');
41
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/system');
42
        $I->see('システム情報システム設定', '.c-pageTitle__titles');
43
44
        $I->see('システム情報', '#server_info_box__header > div > span');
45
        $I->see('PHP情報', '#php_info_box__header > div > span');
46
47
        $I->expect('session.save_path をチェックします');
48
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/system/phpinfo');
49
        $I->scrollTo('a[name=module_session]');
50
        $I->see(realpath(__DIR__.'/../../var/sessions/'.env('APP_ENV')));
51
    }
52
53 View Code Duplication
    public function systeminfo_メンバー管理表示(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
54
    {
55
        $I->wantTo('EA0802-UC01-T01 メンバー管理 - 表示');
56
57
        // 表示
58
        $config = Fixtures::get('config');
59
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
60
        $I->see('メンバー管理システム設定', '.c-pageTitle');
61
62
        $I->see('新規登録', '#ex-member-new > a');
63
    }
64
65
    public function systeminfo_メンバー管理登録実施(\AcceptanceTester $I)
66
    {
67
        $I->wantTo('EA0803-UC01-T01 メンバー管理 - 登録 - 登録実施');
68
69
        // 表示
70
        $config = Fixtures::get('config');
71
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
72
        $I->see('メンバー管理システム設定', '.c-pageTitle');
73
74
        $I->click('#ex-member-new > a');
75
        $I->see('メンバー登録', '#member_form .c-contentsArea__primaryCol .card-header .card-title');
76
77
        $I->fillField(['id' => 'admin_member_name'], 'admintest');
78
        $I->fillField(['id' => 'admin_member_department'], 'admintest department');
79
        $I->fillField(['id' => 'admin_member_login_id'], 'admintest');
80
        $I->fillField(['id' => 'admin_member_password_first'], 'password');
81
        $I->fillField(['id' => 'admin_member_password_second'], 'password');
82
        $I->selectOption(['id' => 'admin_member_Authority'], 'システム管理者');
83
        $I->selectOption(['id' => 'admin_member_Work_1'], '稼働');
84
        $I->click('#member_form .c-conversionArea__container button');
85
        $I->see('保存しました', '.c-contentsArea .alert-success');
86
87
        $I->see('メンバー登録', '#member_form .c-contentsArea__primaryCol .card-header .card-title');
88
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
89
        $I->see('メンバー管理システム設定', '.c-pageTitle');
90
        $I->see('admintest', '.card-body tbody tr:nth-child(1) td:nth-child(1)');
91
    }
92
93
    public function systeminfo_メンバー管理登録未実施(\AcceptanceTester $I)
94
    {
95
        $I->wantTo('EA0803-UC01-T02 メンバー管理 - 登録 - 登録未実施');
96
97
        // 表示
98
        $config = Fixtures::get('config');
99
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
100
        $I->see('メンバー管理システム設定', '.c-pageTitle');
101
102
        $I->click('#ex-member-new > a');
103
        $I->see('メンバー登録', '#member_form .c-contentsArea__primaryCol .card-header .card-title');
104
105
        $I->fillField(['id' => 'admin_member_name'], 'admintest2');
106
        $I->fillField(['id' => 'admin_member_department'], 'admintest department');
107
        $I->fillField(['id' => 'admin_member_login_id'], 'admintest');
108
        $I->fillField(['id' => 'admin_member_password_first'], 'password');
109
        $I->fillField(['id' => 'admin_member_password_second'], 'password');
110
        $I->selectOption(['id' => 'admin_member_Authority'], 'システム管理者');
111
        $I->selectOption(['id' => 'admin_member_Work_1'], '稼働');
112
        $I->click('#member_form .c-conversionArea__container .c-conversionArea__leftBlockItem a');
113
114
        $I->see('メンバー管理システム設定', '.c-pageTitle');
115
        $I->dontSee('admintest2', '#search_result tbody tr:nth-child(1) td:nth-child(1)');
116
    }
117
118 View Code Duplication
    public function systeminfo_メンバー管理登録異常(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
119
    {
120
        $I->wantTo('EA0803-UC01-T03 メンバー管理 - 登録 - 異常パターン');
121
122
        // 表示
123
        $config = Fixtures::get('config');
124
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
125
        $I->see('メンバー管理システム設定', '.c-pageTitle');
126
127
        $I->click('#ex-member-new > a');
128
        $I->see('メンバー登録', '#member_form .c-contentsArea__primaryCol .card-header .card-title');
129
130
        $I->click('#member_form .c-conversionArea__container button');
131
        $I->see('入力されていません。', '#member_form div:nth-child(1) div');
132
    }
133
134
    public function systeminfo_メンバー管理編集実施(\AcceptanceTester $I)
135
    {
136
        $I->wantTo('EA0803-UC02-T01 メンバー管理 - 編集 - 編集実施');
137
138
        // 表示
139
        $config = Fixtures::get('config');
140
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
141
        $I->see('メンバー管理システム設定', '.c-pageTitle');
142
143
        $I->click('.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(5) .action-edit');
144
        $I->see('メンバー登録', '#member_form .c-contentsArea__primaryCol .card-header .card-title');
145
146
        $I->fillField(['id' => 'admin_member_name'], 'administrator');
147
        $I->click('#member_form .c-conversionArea__container button');
148
149
        $I->see('保存しました', '.c-contentsArea .alert-success');
150
        $I->see('メンバー登録', '#member_form .c-contentsArea__primaryCol .card-header .card-title');
151
152
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
153
        $I->see('メンバー管理システム設定', '.c-pageTitle');
154
        $I->see('administrator', '.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(1)');
155
    }
156
157 View Code Duplication
    public function systeminfo_メンバー管理編集未実施(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
158
    {
159
        $I->wantTo('EA0803-UC02-T02 メンバー管理 - 編集 - 編集未実施');
160
161
        // 表示
162
        $config = Fixtures::get('config');
163
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
164
        $I->see('メンバー管理システム設定', '.c-pageTitle');
165
166
        $I->click('.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(5) .action-edit');
167
        $I->see('メンバー登録', '#member_form .c-contentsArea__primaryCol .card-header .card-title');
168
169
        $I->fillField(['id' => 'admin_member_name'], 'administrator2');
170
        $I->click('#member_form .c-conversionArea__container .c-conversionArea__leftBlockItem a');
171
172
        $I->see('メンバー管理システム設定', '.c-pageTitle');
173
        $I->dontSee('administrator2', '.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(1)');
174
    }
175
176 View Code Duplication
    public function systeminfo_メンバー管理編集異常(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
177
    {
178
        $I->wantTo('EA0803-UC03-T01 メンバー管理 - 編集 - 異常パターン');
179
180
        // 表示
181
        $config = Fixtures::get('config');
182
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
183
        $I->see('メンバー管理システム設定', '.c-pageTitle');
184
185
        $I->click('.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(5) .action-edit');
186
        $I->see('メンバー登録', '#member_form .c-contentsArea__primaryCol .card-header .card-title');
187
188
        $I->fillField(['id' => 'admin_member_name'], '');
189
        $I->click('#member_form .c-conversionArea__container button');
190
191
        $I->see('入力されていません。', '#member_form div:nth-child(1) div');
192
    }
193
194 View Code Duplication
    public function systeminfo_メンバー管理登録下へ(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
195
    {
196
        $I->wantTo('EA0802-UC01-T02 メンバー管理 - 下へ');
197
198
        // 表示
199
        $config = Fixtures::get('config');
200
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
201
        $I->see('メンバー管理システム設定', '.c-pageTitle');
202
203
        $I->click('.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(5) .action-down');
204
205
        $I->waitForElementNotVisible(['css' => '.modal-backdrop']);
206
207
        $I->see('管理者', '.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(1)');
208
    }
209
210 View Code Duplication
    public function systeminfo_メンバー管理登録上へ(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
211
    {
212
        $I->wantTo('EA0802-UC01-T03 メンバー管理 - 上へ');
213
214
        // 表示
215
        $config = Fixtures::get('config');
216
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
217
        $I->see('メンバー管理システム設定', '.c-pageTitle');
218
219
        $I->click('.c-primaryCol .card-body table tbody tr:nth-child(2) td:nth-child(5) .action-up');
220
221
        $I->waitForElementNotVisible(['css' => '.modal-backdrop']);
222
223
        $I->see('管理者', '.c-primaryCol .card-body table tbody tr:nth-child(2) td:nth-child(1)');
224
    }
225
226 View Code Duplication
    public function systeminfo_メンバー管理削除(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
227
    {
228
        $I->wantTo('EA0802-UC01-T06 メンバー管理 - 削除');
229
230
        // 表示
231
        $config = Fixtures::get('config');
232
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
233
        $I->see('メンバー管理システム設定', '.c-pageTitle');
234
235
        $I->click('.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(5) .action-delete');
236
        $I->waitForElementVisible(['css' => '.c-primaryCol .card-body table tbody tr:nth-child(1) .modal']);
237
        $I->click('.c-primaryCol .card-body table tbody tr:nth-child(1) .modal .btn-ec-delete');
238
239
        $I->see('削除しました', '.c-contentsArea .alert-success');
240
        $I->see('管理者', '.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(1)');
241
    }
242
243
    public function systeminfo_メンバー管理自ユーザー削除(\AcceptanceTester $I)
244
    {
245
        $I->wantTo('EA0802-UC01-T07 メンバー管理 - 自ユーザー削除');
246
247
        // 表示
248
        $config = Fixtures::get('config');
249
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/member');
250
        $I->see('メンバー管理システム設定', '.c-pageTitle');
251
252
        $href = $I->grabAttributeFrom('.c-primaryCol .card-body table tbody tr:nth-child(1) td:nth-child(5) .action-delete', 'href');
253
        $I->assertEquals('', $href, $href.' が一致しません');
254
    }
255
256 View Code Duplication
    public function systeminfo_セキュリティ管理表示(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
257
    {
258
        $I->wantTo('EA0804-UC01-T01 セキュリティ管理 - 表示');
259
260
        // 表示
261
        $config = Fixtures::get('config');
262
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/security');
263
        $I->see('セキュリティ管理システム設定', '#page_admin_setting_system_security .c-pageTitle__titles');
264
        $I->see('セキュリティ設定', '#page_admin_setting_system_security > div.c-container > div.c-contentsArea > form > div > div.c-contentsArea__primaryCol > div > div > div.card-header > div > div.col-8 > span');
265
    }
266
267 View Code Duplication
    public function systeminfo_セキュリティ管理ディレクトリ名(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
268
    {
269
        $I->wantTo('EA0804-UC01-T02 セキュリティ管理 - ディレクトリ名変更');
270
271
        // 表示
272
        $config = Fixtures::get('config');
273
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/security');
274
        $I->see('セキュリティ管理システム設定', '#page_admin_setting_system_security .c-pageTitle__titles');
275
276
        $I->fillField(['id' => 'admin_security_admin_route_dir'], 'admin2');
277
        $I->click('#page_admin_setting_system_security form div.c-contentsArea__cols > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');
278
        $I->loginAsAdmin('', '', 'admin2');
279
280
        $I->amOnPage('/admin2/setting/system/security');
281
        $I->fillField(['id' => 'admin_security_admin_route_dir'], $config['eccube_admin_route']);
282
        $I->click('#page_admin_setting_system_security form div.c-contentsArea__cols > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');
283
        $I->loginAsAdmin();
284
    }
285
286
    public function systeminfo_セキュリティ管理SSL(\AcceptanceTester $I)
287
    {
288
        $I->wantTo('EA0804-UC01-T04 セキュリティ管理 - SSL強制');
289
290
        $I->getScenario()->skip('このテストを通すと以降のテストが通らなくなってしまっているので一時的にスキップ');
291
292
        $httpBaseUrl = $I->getBaseUrl();
293
        $I->amOnUrl($httpBaseUrl);
294
        $I->assertRegExp('/^http:\/\//', $I->executeJS('return location.href'), 'httpsにリダイレクトされない');
295
296
        $config = Fixtures::get('config');
297
        $httpsBaseUrl = str_replace('http://', 'https://', $httpBaseUrl);
298
        $I->amOnUrl($httpsBaseUrl.$config['eccube_admin_route'].'/setting/system/security');
299
        $I->checkOption(['id' => 'admin_security_force_ssl']);
300
        $I->click('#page_admin_setting_system_security form div.c-contentsArea__cols > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');
301
302
        // httpでアクセスしたらhttpsにリダイレクトされる
303
        $I->amOnUrl($httpBaseUrl);
304
        $I->assertRegExp('/^https:\/\//', $I->executeJS('return location.href'), 'httpsにリダイレクトされる');
305
306
        // 後続テストのために戻しておく
307
        $I->amOnUrl($httpsBaseUrl.$config['eccube_admin_route'].'/setting/system/security');
308
        $I->uncheckOption(['id' => 'admin_security_force_ssl']);
309
        $I->click('#page_admin_setting_system_security form div.c-contentsArea__cols > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');
310
    }
311
312
    /**
313
     * GitHub Actions は IPv6で実行されており、アクセス拒否のテストはできない
314
     */
315 View Code Duplication
    public function systeminfo_セキュリティ管理IP制限_拒否リスト(\AcceptanceTester $I)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
316
    {
317
        $I->wantTo('EA0804-UC01-T05 セキュリティ管理 - IP制限(拒否リスト)');
318
319
        // 表示
320
        $config = Fixtures::get('config');
321
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/security');
322
        $I->see('セキュリティ管理システム設定', '#page_admin_setting_system_security .c-pageTitle__titles');
323
324
        $I->fillField(['id' => 'admin_security_admin_deny_hosts'], '1.1.1.1');
325
        $I->click('#page_admin_setting_system_security form div.c-contentsArea__cols > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');
326
327
        $I->see('保存しました', AuthorityManagePage::$完了メッセージ);
328
    }
329
330
    public function systeminfo_権限管理追加(\AcceptanceTester $I)
331
    {
332
        $I->wantTo('EA0805-UC01-T01 権限管理 - 追加');
333
334
        AuthorityManagePage::go($I)
335
            ->行追加()
336
            ->入力(1, ['0' => 'システム管理者'], '/content')
337
            ->入力(2, ['0' => 'システム管理者'], '/store')
338
            ->登録();
339
340
        $I->see('保存しました', AuthorityManagePage::$完了メッセージ);
341
        $I->dontSee('コンテンツ管理', 'nav .c-mainNavArea__nav');
342
        $I->dontSee('オーナーズストア', 'nav .c-mainNavArea__nav');
343
    }
344
345
    public function systeminfo_権限管理削除(\AcceptanceTester $I)
346
    {
347
        $I->wantTo('EA0805-UC02-T01 権限管理 - 削除');
348
349
        AuthorityManagePage::go($I)
350
            ->行削除(2)
351
            ->行削除(1)
352
            ->登録();
353
354
        $I->see('保存しました', AuthorityManagePage::$完了メッセージ);
355
        $I->see('コンテンツ管理', 'nav .c-mainNavArea__nav');
356
        $I->see('オーナーズストア', 'nav .c-mainNavArea__nav');
357
    }
358
359
    public function systeminfo_ログ表示(\AcceptanceTester $I)
360
    {
361
        $I->wantTo('EA0806-UC01-T01 ログ表示');
362
363
        // 表示
364
        $config = Fixtures::get('config');
365
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/log');
366
        $I->see('ログ表示システム設定', '.c-pageTitle');
367
368
        $option = $I->grabTextFrom('#admin_system_log_files option:nth-child(1)');
369
        $I->selectOption('#admin_system_log_files', $option);
370
371
        $I->fillField(['id' => 'admin_system_log_line_max'], '1');
372
        $I->click(['css' => '#form1 button']);
373
374
        $I->seeInField(['id' => 'admin_system_log_line_max'], '1');
375
    }
376
377
    public function systeminfo_マスターデータ管理(\AcceptanceTester $I)
378
    {
379
        $I->wantTo('EA0807-UC01-T01 マスターデータ管理');
380
381
        // 表示
382
        $config = Fixtures::get('config');
383
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/masterdata');
384
        $I->see('マスタデータ管理システム設定', '.c-pageTitle');
385
386
        $I->selectOption(['id' => 'admin_system_masterdata_masterdata'], ['Eccube-Entity-Master-Sex' => 'mtb_sex']);
387
        $I->click('#form1 button');
388
389
        $I->fillField(['css' => '#form2 table tbody tr:nth-child(3) td:nth-child(1) input'], '3');
390
        $I->fillField(['css' => '#form2 table tbody tr:nth-child(3) td:nth-child(2) input'], '無回答');
391
392
        $I->click(['css' => '#form2 .c-conversionArea .ladda-button']);
393
394
        $I->see('保存しました', '.c-contentsArea .alert-success');
395
        $I->amOnPage('/'.$config['eccube_admin_route'].'/customer/new');
396
        $I->see('無回答', '#customer_form #admin_customer_sex');
397
    }
398
399
    public function systeminfo_ログイン履歴検索(\AcceptanceTester $I)
400
    {
401
        $I->wantTo('EA0808-UC01-T01 ログイン履歴 - 検索');
402
403
        LoginHistoryPage::go($I)->検索('admin');
404
405
        // 1項目目をチェック
406
        $I->see('admin', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody/tr[1]/td[2]');
407
        $I->see('成功', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody/tr[1]/td[5]/span');
408
409
        LoginHistoryPage::go($I)->検索('admin-failure');
410
411
        $I->see('検索結果:0件が該当しました', LoginHistoryPage::$検索結果_メッセージ);
412
413
        $I->logoutAsAdmin();
414
415
        // ログインに失敗する
416
        $I->submitForm('#form1', [
417
            'login_id' => 'admin-failure',
418
            'password' => 'password',
419
        ]);
420
421
        $I->loginAsAdmin();
422
423
        LoginHistoryPage::go($I)->検索('admin-failure');
424
425
        // 1項目目をチェック
426
        $I->see('admin-failure', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody/tr[1]/td[2]');
427
        $I->see('失敗', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody/tr[1]/td[5]/span');
428
429
430
        // ステータスで詳細検索
431
432
        LoginHistoryPage::go($I)->検索();
433
434
        $I->see('失敗', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody');
435
        $I->see('成功', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody');
436
437
        LoginHistoryPage::go($I)->詳細検索_ステータス('0');
438
439
        $I->see('失敗', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody');
440
        $I->dontSee('成功', '//*[@id="search_form"]/div[4]/div/div/div[2]/div/table/tbody');
441
    }
442
443
    /**
444
     * ATTENTION 後続のテストが失敗するため、最後に実行する必要がある
445
     */
446
    public function systeminfo_セキュリティ管理IP制限_許可リスト(\AcceptanceTester $I)
447
    {
448
        $I->wantTo('EA0804-UC01-T03 セキュリティ管理 - IP制限(許可リスト)');
449
450
        $findPlugins = Fixtures::get('findPlugins');
451
        $Plugins = $findPlugins();
452
        if (is_array($Plugins) && count($Plugins) > 0) {
453
            $I->getScenario()->skip('プラグインのアンインストールが必要なため、テストをスキップします');
454
        }
455
456
        // 表示
457
        $config = Fixtures::get('config');
458
        $I->amOnPage('/'.$config['eccube_admin_route'].'/setting/system/security');
459
        $I->see('セキュリティ管理システム設定', '#page_admin_setting_system_security .c-pageTitle__titles');
460
461
        $I->fillField(['id' => 'admin_security_admin_allow_hosts'], '1.1.1.1');
462
        $I->click('#page_admin_setting_system_security form div.c-contentsArea__cols > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');
463
464
        $I->amOnPage('/'.$config['eccube_admin_route']);
465
        $I->see('アクセスできません。', '//*[@id="error-page"]//h3');
466
    }
467
}
468