Completed
Push — 4.0 ( 268f2c...88f012 )
by Hideki
05:48 queued 10s
created

_support/Page/Admin/ShippingEditPage.php (1 issue)

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
/*
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
namespace Page\Admin;
15
16
class ShippingEditPage extends AbstractAdminPageStyleGuide
17
{
18
    public static $姓_エラーメッセージ = '#shipmentOverview_0 > div > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div > div > div:nth-child(1) > span > span > span.form-error-message';
19
20
    public static $登録完了メッセージ = '#page_admin_shipping_edit > div > div.c-contentsArea > div.alert.alert-success.alert-dismissible.fade.show.m-3 > span';
21
22
    /**
23
     * ShippingRegisterPage constructor.
24
     */
25
    public function __construct(\AcceptanceTester $I)
26
    {
27
        parent::__construct($I);
28
    }
29
30
    public static function go($I)
31
    {
32
        $page = new self($I);
33
        $page->goPage('/shipping/new', '出荷登録受注管理');
34
35
        return $page;
36
    }
37
38
    /**
39
     * @param \AcceptanceTester $I
40
     */
41
    public static function at($I)
42
    {
43
        $page = new self($I);
44
        $page->atPage('出荷登録受注管理');
45
46
        return $page;
47
    }
48
49
    public function 入力_出荷日($value)
50
    {
51
        $this->tester->executeJS("document.getElementById('shipping_shipping_date').value = '{$value}'");
52
53
        return $this;
54
    }
55
56
    public function お届け先編集()
57
    {
58
        $this->tester->click(['id' => 'edit-shipping-addr']);
59
        $this->tester->waitForElementVisible(['id' => 'shipping_name_name01']);
60
61
        return $this;
62
    }
63
64
    /**
65
     * @param string $value
66
     */
67
    public function 入力_姓($value, $num = 0)
68
    {
69
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_name_name01'], $value);
70
71
        return $this;
72
    }
73
74
    /**
75
     * @param string $value
76
     */
77
    public function 入力_名($value, $num = 0)
78
    {
79
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_name_name02'], $value);
80
81
        return $this;
82
    }
83
84
    /**
85
     * @param string $value
86
     */
87
    public function 入力_セイ($value, $num = 0)
88
    {
89
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_kana_kana01'], $value);
90
91
        return $this;
92
    }
93
94
    /**
95
     * @param string $value
96
     */
97
    public function 入力_メイ($value, $num = 0)
98
    {
99
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_kana_kana02'], $value);
100
101
        return $this;
102
    }
103
104
    /**
105
     * @param string $value
106
     */
107
    public function 入力_郵便番号($value, $num = 0)
108
    {
109
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_postal_code'], $value);
110
111
        return $this;
112
    }
113
114
    public function 入力_都道府県($value, $num = 0)
115
    {
116
        $this->tester->selectOption(['id' => 'form_shippings_'.$num.'_address_pref'], $value);
117
118
        return $this;
119
    }
120
121
    /**
122
     * @param string $value
123
     */
124
    public function 入力_市区町村名($value, $num = 0)
125
    {
126
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_address_addr01'], $value);
127
128
        return $this;
129
    }
130
131
    /**
132
     * @param string $value
133
     */
134
    public function 入力_番地_ビル名($value, $num = 0)
135
    {
136
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_address_addr02'], $value);
137
138
        return $this;
139
    }
140
141
    /**
142
     * @param string $value
143
     */
144
    public function 入力_電話番号($value, $num = 0)
145
    {
146
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_phone_number'], $value);
147
148
        return $this;
149
    }
150
151
    public function 入力_出荷伝票番号($value, $num = 0)
152
    {
153
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_tracking_number'], $value);
154
155
        return $this;
156
    }
157
158
    public function 入力_配送業者($value, $num = 0)
159
    {
160
        $this->tester->selectOption(['id' => 'form_shippings_'.$num.'_Delivery'], $value);
161
162
        return $this;
163
    }
164
165
    public function 入力_配達用メモ($value, $num = 0)
166
    {
167
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_note'], $value);
168
169
        return $this;
170
    }
171
172
    public function 商品検索($value = '')
173
    {
174
        $this->tester->scrollTo(['css' => '#shipping-product_1 > div > button'], 0, -50);
175
        $this->tester->click(['css' => '#shipping-product_1 > div > button']);
176
        $this->tester->waitForElementVisible(['id' => 'addProduct']);
177
        $this->tester->fillField(['id' => 'admin_search_product_id'], $value);
178
        $this->tester->click('#searchProductModalButton');
179
        $this->tester->waitForElementVisible('#searchProductModalList table');
180
181
        return $this;
182
    }
183
184
    public function 商品検索結果_選択($rowNum)
185
    {
186
        $rowNum = $rowNum * 2;
187
        $this->tester->click("#searchProductModalList > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3.text-right > button");
188
189
        return $this;
190
    }
191
192
    public function 出荷情報登録()
193
    {
194
        $this->tester->click(['id' => 'btn_save']);
195
196
        return $this;
197
    }
198
199
    public function 出荷完了にする($num = 0)
200
    {
201
        $this->tester->scrollTo(['id' => 'shipmentOverview_'.$num], 0, 50);
202
        $this->tester->click('#shipmentOverview_'.$num.' > div > div:nth-child(4) > div:nth-child(2) > div:nth-child(3) > div > button');
203
204
        return $this;
205
    }
206
207 View Code Duplication
    public function 変更を確定()
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...
208
    {
209
        $this->tester->waitForElementVisible(['id' => 'bulkChange']);
210
        $this->tester->click(['id' => 'bulkChange']);
211
        $this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']);
212
        $this->tester->click(['id' => 'bulkChangeComplete']);
213
214
        return $this;
215
    }
216
217
    public function 出荷先を追加()
218
    {
219
        $this->tester->scrollTo(['id' => 'addShipping'], 0, 50);
220
        $this->tester->click(['id' => 'addShipping']);
221
222
        return $this;
223
    }
224
225
    public function 出荷日を確認($num = 0)
226
    {
227
        $this->tester->scrollTo(['id' => 'shipmentOverview_'.$num], 0, 50);
228
        $this->tester->see((new \DateTime())->format('Y/m/d'),
229
                            '#shipmentOverview_'.$num.' > div > div:nth-child(4) > div:nth-child(2) > div:nth-child(3) > div > span');
230
    }
231
}
232