Failed Conditions
Push — modify-scrutinizeryml ( 361e25...08b4c1 )
by Kentaro
63:54 queued 57:30
created

codeception/acceptance/EA07BasicinfoCest.php (6 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use Page\Admin\CsvSettingsPage;
4
use Page\Admin\DeliveryEditPage;
5
use Page\Admin\DeliveryManagePage;
6
use Page\Admin\MailSettingsPage;
7
use Page\Admin\PaymentEditPage;
8
use Page\Admin\PaymentManagePage;
9
use Page\Admin\ShopSettingPage;
10
use Page\Admin\TaxManagePage;
11
12
/**
13
 * @group admin
14
 * @group admin03
15
 * @group basicinformation
16
 * @group ea7
17
 */
18
class EA07BasicinfoCest
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
19
{
20
    public function _before(\AcceptanceTester $I)
21
    {
22
        $I->loginAsAdmin();
23
    }
24
25
    public function _after(\AcceptanceTester $I)
0 ignored issues
show
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...
26
    {
27
    }
28
29
    public function basicinfo_ショップマスター(\AcceptanceTester $I)
30
    {
31
        $I->wantTo('EA0701-UC01-T01 ショップマスター');
32
33
        ShopSettingPage::go($I)
34
            ->入力_会社名('会社名')
35
            ->登録();
36
37
        $I->see('登録が完了しました。', ShopSettingPage::$登録完了メッセージ);
38
    }
39
40
    public function basicinfo_支払方法一覧(\AcceptanceTester $I)
41
    {
42
        $I->wantTo('EA0704-UC01-T01 支払方法 一覧');
43
44
        // 表示
45
        $PaymentManagePage = PaymentManagePage::go($I);
46
47
        $I->see('郵便振替', $PaymentManagePage->一覧_支払方法(1));
48
    }
49
50
    public function basicinfo_支払方法入れ替え(\AcceptanceTester $I)
51
    {
52
        $I->wantTo('EA0704-UC02-T01 支払方法 入れ替え');
53
54
        // 表示
55
        $PaymentManagePage = PaymentManagePage::go($I);
56
57
        // 入れ替え
58
        $I->see('郵便振替', $PaymentManagePage->一覧_支払方法(1));
59
        $PaymentManagePage->一覧_下に(1);
60
61
        $PaymentManagePage = PaymentManagePage::go($I);
62
        $I->see('郵便振替', $PaymentManagePage->一覧_支払方法(2));
63
64
65
        $PaymentManagePage->一覧_上に(2);
66
        $PaymentManagePage = PaymentManagePage::go($I);
67
        $I->see('郵便振替', $PaymentManagePage->一覧_支払方法(1));
68
    }
69
70 View Code Duplication
    public function basicinfo_支払方法登録(\AcceptanceTester $I)
0 ignored issues
show
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...
71
    {
72
        $I->getScenario()->skip('EA0705-UC01-T01 支払方法 登録');
73
        $I->wantTo('EA0705-UC01-T01 支払方法 登録');
74
75
        // 表示
76
        // 登録フォーム
77
        PaymentManagePage::go($I)
78
            ->新規入力();
79
80
        // 登録
81
        PaymentEditPage::at($I)
82
            ->入力_支払方法('payment method1')
83
            ->入力_手数料('100')
84
            ->入力_利用条件下限('1')
85
            ->登録();
86
87
        $PaymentManagePage = PaymentManagePage::at($I);
88
        $I->see('登録が完了しました。', PaymentManagePage::$登録完了メッセージ);
89
        $I->see('payment method1', $PaymentManagePage->一覧_支払方法(1));
90
    }
91
92 View Code Duplication
    public function basicinfo_支払方法編集(\AcceptanceTester $I)
0 ignored issues
show
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...
93
    {
94
        $I->getScenario()->skip('EA0705-UC01-T01 支払方法 登録');
95
        $I->wantTo('EA0705-UC02-T01 支払方法 編集');
96
97
        // 表示
98
        PaymentManagePage::go($I)
99
            ->一覧_編集(1);
100
101
        // 編集
102
        PaymentEditPage::at($I)
103
            ->入力_支払方法('payment method2')
104
            ->入力_手数料('1000')
105
            ->登録();
106
107
        $PaymentManagePage = PaymentManagePage::at($I);
108
        $I->see('登録が完了しました。', PaymentManagePage::$登録完了メッセージ);
109
        $I->see('payment method2', $PaymentManagePage->一覧_支払方法(1));
110
    }
111
112
    public function basicinfo_支払方法削除(\AcceptanceTester $I)
113
    {
114
        $I->wantTo('EA0704-UC03-T01 支払方法 削除');
115
116
        // 表示
117
        // 削除
118
        PaymentManagePage::go($I)
119
            ->一覧_削除(1);
120
    }
121
122
    public function basicinfo_配送方法一覧(\AcceptanceTester $I)
123
    {
124
        $I->wantTo('EA0706-UC01-T01 配送方法 一覧');
125
126
        // 表示
127
        $DeliveryManagePage = DeliveryManagePage::go($I);
128
129
        $I->see('サンプル宅配', $DeliveryManagePage->一覧_名称(1));
130
    }
131
132 View Code Duplication
    public function basicinfo_配送方法登録(\AcceptanceTester $I)
0 ignored issues
show
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...
133
    {
134
        $I->wantTo('EA0707-UC01-T01 配送方法 登録');
135
136
        // 表示
137
        DeliveryManagePage::go($I)
138
            ->新規登録();
139
140
        // 登録
141
        DeliveryEditPage::at($I)
142
            ->入力_配送業者名('配送業者名')
143
            ->入力_名称('名称')
144
            ->入力_支払方法選択(['1', '4'])
145
            ->入力_全国一律送料('100')
146
            ->登録();
147
148
        $DeliveryManagePage = DeliveryManagePage::at($I);
149
        $I->see('登録が完了しました。', DeliveryManagePage::$登録完了メッセージ);
150
        $I->see('配送業者名', $DeliveryManagePage->一覧_名称(1));
151
    }
152
153
    public function basicinfo_配送方法編集(\AcceptanceTester $I)
154
    {
155
        $I->wantTo('EA0707-UC02-T01 配送方法 編集');
156
157
        // 表示
158
        DeliveryManagePage::go($I)
159
            ->一覧_編集(1);
160
161
        // 編集
162
        DeliveryEditPage::at($I)
163
            ->入力_配送業者名('配送業者名1')
164
            ->登録();
165
166
        $DeliveryManagePage = DeliveryManagePage::at($I);
167
        $I->see('登録が完了しました。', DeliveryManagePage::$登録完了メッセージ);
168
        $I->see('配送業者名1', $DeliveryManagePage->一覧_名称(1));
169
    }
170
171
    public function basicinfo_配送方法削除(\AcceptanceTester $I)
172
    {
173
        $I->wantTo('EA0706-UC03-T01 配送方法 削除');
174
175
        DeliveryManagePage::go($I)
176
            ->一覧_削除(1);
177
178
        $I->acceptPopup();
179
    }
180
181 View Code Duplication
    public function basicinfo_配送方法一覧順序変更(\AcceptanceTester $I)
0 ignored issues
show
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...
182
    {
183
        $I->wantTo('EA0706-UC02-T01 配送方法一覧順序変更');
184
185
        $DeliveryManagePage = DeliveryManagePage::go($I);
186
        $I->see('サンプル宅配', $DeliveryManagePage->一覧_名称(1));
187
        $I->see('サンプル業者', $DeliveryManagePage->一覧_名称(2));
188
189
        $DeliveryManagePage->一覧_下に(1);
190
        $I->see('サンプル業者', $DeliveryManagePage->一覧_名称(1));
191
        $I->see('サンプル宅配', $DeliveryManagePage->一覧_名称(2));
192
193
        $DeliveryManagePage->一覧_上に(2);
194
        $I->see('サンプル宅配', $DeliveryManagePage->一覧_名称(1));
195
        $I->see('サンプル業者', $DeliveryManagePage->一覧_名称(2));
196
    }
197
198
    public function basicinfo_税率設定(\AcceptanceTester $I)
199
    {
200
        $I->wantTo('EA0708-UC01-T01 税率設定');
201
202
        // 表示
203
        $TaxManagePage = TaxManagePage::go($I);
204
205
        // 一覧
206
        $I->see('共通税率設定', '#page_admin_setting_shop_tax > div.c-container > div.c-contentsArea > div.c-contentsArea__cols > div > div > div > div.card-header');
207
        $I->see('8%', '#tax_rule_list__item--1 > td.align-middle.text-right');
208
209
        // 登録
210
        $TaxManagePage
211
            ->入力_消費税率(1, '10')
212
            ->入力_適用日(date('Y-m-d'))
213
            ->入力_適用時(date('H:i'))
214
            ->共通税率設定_登録();
215
        $I->see('10%', $TaxManagePage->一覧_税率(2));
216
217
        // edit
218
        $TaxManagePage
219
            ->一覧_編集(2)
220
            ->入力_消費税率(2, 12)
221
            ->決定(2);
222
223
        $I->see('税率設定情報を保存しました。', TaxManagePage::$登録完了メッセージ);
224
        $I->see('12%', $TaxManagePage->一覧_税率(2));
225
226
        // 削除
227
        $TaxManagePage->一覧_削除(2);
228
        $I->see('税率設定情報を削除しました。', TaxManagePage::$登録完了メッセージ);
229
    }
230
231
    public function basicinfo_メール設定(\AcceptanceTester $I)
232
    {
233
        $I->wantTo('EA0709-UC02-T01  メール設定'); // EA0709-UC01-T01 はメールテンプレート登録機能がないのでテスト不可
234
235
        // 表示
236
        MailSettingsPage::go($I)
237
            ->入力_テンプレート('注文受付メール')
238
            ->入力_件名('ご注文有難うございました')
239
            ->登録();
240
241
        $I->see('メールテンプレート情報を保存しました。', MailSettingsPage::$登録完了メッセージ);
242
    }
243
244
    public function basicinfo_CSV出力項目(\AcceptanceTester $I)
245
    {
246
        $I->wantTo('EA0710-UC01-T01  CSV出力項目設定');
247
248
        // 表示
249
        CsvSettingsPage::go($I)
250
            ->入力_CSVタイプ('受注CSV')
251
            ->選択_出力項目('誕生日')
252
            ->削除()
253
            ->設定();
254
255
        $I->see('CSV出力を設定しました。', CsvSettingsPage::$登録完了メッセージ);
256
    }
257
}
258