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