Completed
Push — 4.0 ( 2ab4e3...60f34a )
by chihiro
05:05 queued 10s
created

EA07BasicinfoCest::basicinfo_認証キー設定()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16

Duplication

Lines 16
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 16
loc 16
rs 9.7333
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 Page\Admin\CsvSettingsPage;
15
use Page\Admin\DeliveryEditPage;
16
use Page\Admin\DeliveryManagePage;
17
use Page\Admin\MailSettingsPage;
18
use Page\Admin\PaymentEditPage;
19
use Page\Admin\PaymentManagePage;
20
use Page\Admin\ShopSettingPage;
21
use Page\Admin\TaxManagePage;
22
use Codeception\Util\Fixtures;
23
24
/**
25
 * @group admin
26
 * @group admin03
27
 * @group basicinformation
28
 * @group ea7
29
 */
30
class EA07BasicinfoCest
31
{
32
    public function _before(\AcceptanceTester $I)
33
    {
34
        $I->loginAsAdmin();
35
    }
36
37
    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...
38
    {
39
    }
40
41
    public function basicinfo_基本設定(\AcceptanceTester $I)
42
    {
43
        $I->wantTo('EA0701-UC01-T01 基本設定');
44
45
        ShopSettingPage::go($I)
46
            ->入力_会社名('会社名')
47
            ->登録();
48
49
        $I->see('保存しました', ShopSettingPage::$登録完了メッセージ);
50
    }
51
52
    public function basicinfo_支払方法一覧(\AcceptanceTester $I)
53
    {
54
        $I->wantTo('EA0704-UC01-T01 支払方法 一覧');
55
56
        // 表示
57
        $PaymentManagePage = PaymentManagePage::go($I);
58
59
        $I->see('郵便振替', $PaymentManagePage->一覧_支払方法(1));
60
    }
61
62
    public function basicinfo_支払方法入れ替え(\AcceptanceTester $I)
63
    {
64
        $I->wantTo('EA0704-UC02-T01 支払方法 入れ替え');
65
66
        // 表示
67
        $PaymentManagePage = PaymentManagePage::go($I);
68
69
        // 入れ替え
70
        $I->see('郵便振替', $PaymentManagePage->一覧_支払方法(1));
71
        $PaymentManagePage->一覧_下に(1);
72
73
        $PaymentManagePage = PaymentManagePage::go($I);
74
        $I->see('郵便振替', $PaymentManagePage->一覧_支払方法(2));
75
76
        $PaymentManagePage->一覧_上に(2);
77
        $PaymentManagePage = PaymentManagePage::go($I);
78
        $I->see('郵便振替', $PaymentManagePage->一覧_支払方法(1));
79
    }
80
81 View Code Duplication
    public function basicinfo_支払方法登録(\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...
82
    {
83
        $I->getScenario()->skip('EA0705-UC01-T01 支払方法 登録');
84
        $I->wantTo('EA0705-UC01-T01 支払方法 登録');
85
86
        // 表示
87
        // 登録フォーム
88
        PaymentManagePage::go($I)
89
            ->新規入力();
90
91
        // 登録
92
        PaymentEditPage::at($I)
93
            ->入力_支払方法('payment method1')
94
            ->入力_手数料('100')
95
            ->入力_利用条件下限('1')
96
            ->登録();
97
98
        PaymentEditPage::at($I);
99
        $I->see('保存しました', PaymentEditPage::$登録完了メッセージ);
100
101
        $PaymentManagePage = PaymentManagePage::go($I);
102
        $I->see('payment method1', $PaymentManagePage->一覧_支払方法(1));
103
    }
104
105 View Code Duplication
    public function basicinfo_支払方法編集(\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...
106
    {
107
        $I->getScenario()->skip('EA0705-UC01-T01 支払方法 登録');
108
        $I->wantTo('EA0705-UC02-T01 支払方法 編集');
109
110
        // 表示
111
        PaymentManagePage::go($I)
112
            ->一覧_編集(1);
113
114
        // 編集
115
        PaymentEditPage::at($I)
116
            ->入力_支払方法('payment method2')
117
            ->入力_手数料('1000')
118
            ->登録();
119
120
        PaymentEditPage::at($I);
121
        $I->see('保存しました', PaymentEditPage::$登録完了メッセージ);
122
123
        $PaymentManagePage = PaymentManagePage::go($I);
124
        $I->see('payment method2', $PaymentManagePage->一覧_支払方法(1));
125
    }
126
127
    public function basicinfo_支払方法削除(\AcceptanceTester $I)
128
    {
129
        $I->wantTo('EA0704-UC03-T01 支払方法 削除');
130
131
        // 表示
132
        // 削除
133
        PaymentManagePage::go($I)
134
            ->一覧_削除(1);
135
    }
136
137
    public function basicinfo_配送方法一覧(\AcceptanceTester $I)
138
    {
139
        $I->wantTo('EA0706-UC01-T01 配送方法 一覧');
140
141
        // 表示
142
        $DeliveryManagePage = DeliveryManagePage::go($I);
143
144
        $I->see('サンプル宅配', $DeliveryManagePage->一覧_名称(2));
145
    }
146
147 View Code Duplication
    public function basicinfo_配送方法登録(\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...
148
    {
149
        $I->wantTo('EA0707-UC01-T01 配送方法 登録');
150
151
        // 表示
152
        DeliveryManagePage::go($I)
153
            ->新規登録();
154
155
        // 登録
156
        DeliveryEditPage::at($I)
157
            ->入力_配送業者名('配送業者名')
158
            ->入力_名称('名称')
159
            ->入力_支払方法選択(['1', '4'])
160
            ->入力_全国一律送料('100')
161
            ->登録();
162
163
        DeliveryEditPage::at($I);
164
        $I->see('保存しました', DeliveryEditPage::$登録完了メッセージ);
165
166
        $DeliveryManagePage = DeliveryManagePage::go($I);
167
        $I->see('配送業者名', $DeliveryManagePage->一覧_名称(2));
168
    }
169
170
    public function basicinfo_配送方法編集(\AcceptanceTester $I)
171
    {
172
        $I->wantTo('EA0707-UC02-T01 配送方法 編集');
173
174
        // 表示
175
        DeliveryManagePage::go($I)
176
            ->一覧_編集(2);
177
178
        // 編集
179
        DeliveryEditPage::at($I)
180
            ->入力_配送業者名('配送業者名1')
181
            ->登録();
182
183
        DeliveryEditPage::at($I);
184
        $I->see('保存しました', DeliveryEditPage::$登録完了メッセージ);
185
186
        $DeliveryManagePage = DeliveryManagePage::go($I);
187
        $I->see('配送業者名1', $DeliveryManagePage->一覧_名称(2));
188
    }
189
190
    public function basicinfo_配送方法削除(\AcceptanceTester $I)
191
    {
192
        $I->wantTo('EA0706-UC03-T01 配送方法 削除');
193
194
        DeliveryManagePage::go($I)
195
            ->一覧_削除(2);
196
    }
197
198 View Code Duplication
    public function basicinfo_配送方法一覧順序変更(\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...
199
    {
200
        $I->wantTo('EA0706-UC02-T01 配送方法一覧順序変更');
201
202
        $DeliveryManagePage = DeliveryManagePage::go($I);
203
        $I->see('サンプル宅配 / サンプル宅配', $DeliveryManagePage->一覧_名称(2));
204
        $I->see('サンプル業者 / サンプル業者', $DeliveryManagePage->一覧_名称(3));
205
206
        $DeliveryManagePage->一覧_下に(2);
207
        $I->see('サンプル業者 / サンプル業者', $DeliveryManagePage->一覧_名称(2));
208
        $I->see('サンプル宅配 / サンプル宅配', $DeliveryManagePage->一覧_名称(3));
209
210
        $DeliveryManagePage->一覧_上に(3);
211
        $I->see('サンプル宅配 / サンプル宅配', $DeliveryManagePage->一覧_名称(2));
212
        $I->see('サンプル業者 / サンプル業者', $DeliveryManagePage->一覧_名称(3));
213
    }
214
215
    public function basicinfo_税率設定(\AcceptanceTester $I)
216
    {
217
        $I->wantTo('EA0708-UC01-T01 税率設定');
218
219
        // 表示
220
        $TaxManagePage = TaxManagePage::go($I);
221
222
        // 一覧
223
        $I->see('税率設定', '#page_admin_setting_shop_tax > div.c-container > div.c-contentsArea > div.c-contentsArea__cols > div > div > div > div.card-header');
224
        $I->see('8%', '#ex-tax_rule-1 > td.align-middle.text-right');
225
226
        // 登録
227
        $TaxManagePage
228
            ->入力_消費税率(1, '10')
229
            ->入力_適用日(date('Y'), date('n'), date('j'))
230
            ->入力_適用時(date('G'), (int) date('i'))
231
            ->共通税率設定_登録();
232
        $I->see('10%', $TaxManagePage->一覧_税率(2));
233
234
        // edit
235
        $TaxManagePage
236
            ->一覧_編集(2)
237
            ->入力_消費税率(2, 12)
238
            ->決定(2);
239
240
        $I->see('保存しました', TaxManagePage::$登録完了メッセージ);
241
        $I->see('12%', $TaxManagePage->一覧_税率(2));
242
243
        // 削除
244
        $TaxManagePage->一覧_削除(2);
245
        $I->see('削除しました', TaxManagePage::$登録完了メッセージ);
246
    }
247
248
    public function basicinfo_メール設定(\AcceptanceTester $I)
249
    {
250
        $I->wantTo('EA0709-UC02-T01  メール設定'); // EA0709-UC01-T01 はメールテンプレート登録機能がないのでテスト不可
251
252
        // 表示
253
        MailSettingsPage::go($I)
254
            ->入力_テンプレート('注文受付メール')
255
            ->入力_件名('ご注文有難うございました')
256
            ->登録();
257
258
        $I->see('保存しました', MailSettingsPage::$登録完了メッセージ);
259
    }
260
261
    public function basicinfo_CSV出力項目(\AcceptanceTester $I)
262
    {
263
        $I->wantTo('EA0710-UC01-T01  CSV出力項目設定');
264
265
        // 表示
266
        CsvSettingsPage::go($I)
267
            ->入力_CSVタイプ('受注CSV')
268
            ->選択_出力項目('誕生日')
269
            ->削除()
270
            ->設定();
271
272
        $I->see('保存しました', CsvSettingsPage::$登録完了メッセージ);
273
    }
274
275
    /**
276
     * EA10PluginCestではテストが失敗するため、ここでテストを行う
277
     */
278 View Code Duplication
    public function basicinfo_認証キー設定(\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...
279
    {
280
        $config = Fixtures::get('config');
281
        $I->amOnPage('/'.$config['eccube_admin_route'].'/store/plugin/authentication_setting');
282
283
        // 認証キーの新規発行については、認証キーの発行数が増加する為省略(以下は一度実行済み)
284
        // $I->expect('認証キーの新規発行ボタンのクリックします。');
285
        // $I->click('認証キー新規発行');
286
287
        $I->expect('認証キーの入力を行います。');
288
        $I->fillField(['id' => 'admin_authentication_authentication_key'], '1111111111111111111111111111111111111111');
289
290
        $I->expect('認証キーの登録ボタンをクリックします。');
291
        $I->click(['css' => '.btn-ec-conversion']);
292
        $I->see('保存しました');
293
    }
294
}
295