1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Page\Admin; |
4
|
|
|
|
5
|
|
|
|
6
|
|
|
class OrderManagePage extends AbstractAdminPageStyleGuide |
|
|
|
|
7
|
|
|
{ |
8
|
|
|
public static $検索条件_受注ステータス = ['id' => 'admin_search_order_status']; |
|
|
|
|
9
|
|
|
public static $検索結果_メッセージ = '#search_form #search_total_count'; |
|
|
|
|
10
|
|
|
public static $検索結果_エラーメッセージ = '//*[@id="page_admin_order"]/div[1]/div[3]/div[3]/div/div/div[1]/div/div[1]'; |
|
|
|
|
11
|
|
|
public static $詳細検索ボタン = '//*[@id="search_form"]/div[1]/div/div/div[3]/a/i/span'; |
|
|
|
|
12
|
|
|
|
13
|
|
|
/** |
|
|
|
|
14
|
|
|
* OrderListPage constructor. |
15
|
|
|
*/ |
16
|
|
|
public function __construct(\AcceptanceTester $I) |
17
|
|
|
{ |
18
|
|
|
parent::__construct($I); |
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
public static function go(\AcceptanceTester $I) |
22
|
|
|
{ |
23
|
|
|
$page = new self($I); |
24
|
|
|
return $page->goPage('/order', '受注一覧受注管理'); |
|
|
|
|
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
public static function at(\AcceptanceTester $I) |
28
|
|
|
{ |
29
|
|
|
$page = new self($I); |
30
|
|
|
return $page->atPage('受注一覧受注管理'); |
|
|
|
|
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
public function 検索($value = '') |
|
|
|
|
34
|
|
|
{ |
35
|
|
|
$this->tester->fillField(['id' => 'admin_search_order_multi'], $value); |
36
|
|
|
$this->tester->click('#search_form #search_submit'); |
37
|
|
|
return $this; |
|
|
|
|
38
|
|
|
} |
39
|
|
|
|
40
|
|
View Code Duplication |
public function 詳細検索設定() |
|
|
|
|
41
|
|
|
{ |
42
|
|
|
$this->tester->click(self::$詳細検索ボタン); |
43
|
|
|
$this->tester->waitForElementVisible(['id' => 'searchDetail']); |
44
|
|
|
$this->tester->wait(0.5); |
45
|
|
|
return $this; |
|
|
|
|
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function 入力_ご注文者お名前($value) |
|
|
|
|
49
|
|
|
{ |
50
|
|
|
$this->tester->fillField(['id' => 'admin_search_order_name'], $value); |
51
|
|
|
return $this; |
|
|
|
|
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function 入力_ご注文者お名前フリガナ($value) |
|
|
|
|
55
|
|
|
{ |
56
|
|
|
$this->tester->fillField(['id' => 'admin_search_order_kana'], $value); |
57
|
|
|
return $this; |
|
|
|
|
58
|
|
|
} |
59
|
|
|
|
60
|
|
View Code Duplication |
public function 詳細検索_電話番号($value = '') |
|
|
|
|
61
|
|
|
{ |
62
|
|
|
$this->tester->click(self::$詳細検索ボタン); |
63
|
|
|
$this->tester->wait(1); |
64
|
|
|
$this->tester->fillField(['id' => 'admin_search_order_phone_number'], $value); |
65
|
|
|
$this->tester->click('#search_form #search_submit'); |
66
|
|
|
return $this; |
|
|
|
|
67
|
|
|
} |
68
|
|
|
|
69
|
|
View Code Duplication |
public function 受注CSVダウンロード実行() |
|
|
|
|
70
|
|
|
{ |
71
|
|
|
$this->tester->click(['id' => 'csvDownloadDropDown']); |
72
|
|
|
$this->tester->waitForElementVisible(['id' => 'orderCsvDownload']); |
73
|
|
|
$this->tester->click(['id' => 'orderCsvDownload']); |
74
|
|
|
return $this; |
|
|
|
|
75
|
|
|
} |
76
|
|
|
|
77
|
|
View Code Duplication |
public function 受注CSV出力項目設定() |
|
|
|
|
78
|
|
|
{ |
79
|
|
|
$this->tester->click(['id' => 'csvSettingDropDown']); |
80
|
|
|
$this->tester->waitForElementVisible(['id' => 'orderCsvSetting']); |
81
|
|
|
$this->tester->click(['id' => 'orderCsvSetting']); |
82
|
|
|
return $this; |
|
|
|
|
83
|
|
|
} |
84
|
|
|
|
85
|
|
View Code Duplication |
public function 配送CSVダウンロード実行() |
|
|
|
|
86
|
|
|
{ |
87
|
|
|
$this->tester->click(['id' => 'csvDownloadDropDown']); |
88
|
|
|
$this->tester->waitForElementVisible(['id' => 'shippingCsvDownload']); |
89
|
|
|
$this->tester->click(['id' => 'shippingCsvDownload']); |
90
|
|
|
return $this; |
|
|
|
|
91
|
|
|
} |
92
|
|
|
|
93
|
|
View Code Duplication |
public function 配送CSV出力項目設定() |
|
|
|
|
94
|
|
|
{ |
95
|
|
|
$this->tester->click(['id' => 'csvSettingDropDown']); |
96
|
|
|
$this->tester->waitForElementVisible(['id' => 'shippingCsvSetting']); |
97
|
|
|
$this->tester->click(['id' => 'shippingCsvSetting']); |
98
|
|
|
return $this; |
|
|
|
|
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
public function 一覧_編集($rowNum) |
|
|
|
|
102
|
|
|
{ |
103
|
|
|
$this->tester->click("#search_result > tbody > tr:nth-child(${rowNum}) a.action-edit"); |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public function 一覧_削除() |
|
|
|
|
107
|
|
|
{ |
108
|
|
|
$this->tester->click("#form_bulk > div.row.justify-content-between.mb-2 .btn-bulk-wrapper button.btn.btn-ec-delete"); |
109
|
|
|
return $this; |
|
|
|
|
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
public function Accept_削除() |
|
|
|
|
113
|
|
|
{ |
114
|
|
|
$this->tester->waitForElementVisible(['id' => 'btn_bulk_delete']); |
115
|
|
|
$this->tester->click("#btn_bulk_delete"); |
116
|
|
|
return $this; |
|
|
|
|
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
public function Cancel_削除() |
|
|
|
|
120
|
|
|
{ |
121
|
|
|
$this->tester->click("#bulkDeleteModal > div > div > div.modal-footer > button.btn.btn-ec-sub"); |
122
|
|
|
return $this; |
|
|
|
|
123
|
|
|
} |
124
|
|
|
|
125
|
|
View Code Duplication |
public function 一覧_メール通知($rowNum) |
|
|
|
|
126
|
|
|
{ |
127
|
|
|
$this->tester->click(['css' => "#search_result > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3.text-center > div > div:nth-child(1) > a"]); |
128
|
|
|
$this->tester->waitForElementVisible(['id' => 'sentUpdateModal']); |
129
|
|
|
$this->tester->wait(2); |
130
|
|
|
$this->tester->scrollTo(['id' => 'bulkChange']); |
131
|
|
|
$this->tester->click(['id' => 'bulkChange']); |
132
|
|
|
$this->tester->wait(5); |
133
|
|
|
$this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']); |
134
|
|
|
return $this; |
|
|
|
|
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
public function 一覧_選択($rowNum) |
|
|
|
|
138
|
|
|
{ |
139
|
|
|
$this->tester->checkOption(['css' => "#search_result > tbody > tr:nth-child(${rowNum}) > td > input[type=checkbox]"]); |
140
|
|
|
return $this; |
|
|
|
|
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
public function 一覧_全選択() |
|
|
|
|
144
|
|
|
{ |
145
|
|
|
$this->tester->checkOption('#toggle_check_all'); |
146
|
|
|
return $this; |
|
|
|
|
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
|
150
|
|
View Code Duplication |
public function 個別メール送信($rowNum) |
|
|
|
|
151
|
|
|
{ |
152
|
|
|
$this->tester->click(['css' => "#search_result > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3.text-center > div > div:nth-child(1) > a"]); |
153
|
|
|
$this->tester->waitForElementVisible(['id' => 'sentUpdateModal']); |
154
|
|
|
$this->tester->wait(2); |
155
|
|
|
$this->tester->scrollTo(['id' => 'bulkChange']); |
156
|
|
|
$this->tester->click(['id' => 'bulkChange']); |
157
|
|
|
$this->tester->wait(5); |
158
|
|
|
$this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']); |
159
|
|
|
return $this; |
|
|
|
|
160
|
|
|
} |
161
|
|
|
|
162
|
|
View Code Duplication |
public function 一括メール送信() |
|
|
|
|
163
|
|
|
{ |
164
|
|
|
$this->tester->click(['id' => 'bulkSendMail']); |
165
|
|
|
$this->tester->waitForElementVisible(['id' => 'sentUpdateModal']); |
166
|
|
|
$this->tester->wait(1); |
167
|
|
|
$this->tester->click(['id' => 'bulkChange']); |
168
|
|
|
$this->tester->wait(5); |
169
|
|
|
$this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']); |
170
|
|
|
return $this; |
|
|
|
|
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
public function 一覧_注文番号($rowNum) |
|
|
|
|
174
|
|
|
{ |
175
|
|
|
return $this->tester->grabTextFrom("#search_result > tbody > tr:nth-child($rowNum) a.action-edit"); |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
public function 受注ステータス検索($value = '') |
|
|
|
|
179
|
|
|
{ |
180
|
|
|
$this->tester->checkOption(['id' => 'admin_search_order_status_' . $value]); |
|
|
|
|
181
|
|
|
$this->tester->click('#search_form #search_submit'); |
182
|
|
|
return $this; |
|
|
|
|
183
|
|
|
} |
184
|
|
|
|
185
|
|
|
public function 受注ステータス変更($option = []) |
|
|
|
|
186
|
|
|
{ |
187
|
|
|
$this->tester->selectOption('#option_bulk_status', $option); |
188
|
|
|
$this->tester->click('#form_bulk #btn_bulk_status'); |
189
|
|
|
return $this; |
|
|
|
|
190
|
|
|
} |
191
|
|
|
|
192
|
|
View Code Duplication |
public function 出荷済にする($rowNum) |
|
|
|
|
193
|
|
|
{ |
194
|
|
|
$this->tester->click("#search_result > tbody > tr:nth-child($rowNum) a[data-type='status']"); |
195
|
|
|
$this->tester->waitForElementVisible(['id' => 'sentUpdateModal']); |
196
|
|
|
$this->tester->wait(2); |
197
|
|
|
$this->tester->click(['id' => 'notificationMail']); |
198
|
|
|
$this->tester->scrollTo(['id' => 'bulkChange']); |
199
|
|
|
$this->tester->click(['id' => 'bulkChange']); |
200
|
|
|
$this->tester->wait(5); |
201
|
|
|
$this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']); |
202
|
|
|
return $this; |
|
|
|
|
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
public function 取得_出荷伝票番号($rowNum) |
|
|
|
|
206
|
|
|
{ |
207
|
|
|
return $this->tester->grabValueFrom("#search_result > tbody > tr:nth-child(${rowNum}) > td:nth-child(8) > div > input"); |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
public function 取得_出荷日($rowNum) |
|
|
|
|
211
|
|
|
{ |
212
|
|
|
return $this->tester->grabTextFrom("#search_result > tbody > tr:nth-child(${rowNum}) > td:nth-child(7)"); |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
public function 取得_ステータス($rowNum) |
|
|
|
|
216
|
|
|
{ |
217
|
|
|
return $this->tester->grabTextFrom("#search_result > tbody > tr:nth-child(${rowNum}) > td:nth-child(4) > span"); |
218
|
|
|
} |
219
|
|
|
} |
220
|
|
|
|