Failed Conditions
Push — experimental/sf ( 49de0c...430492 )
by chihiro
27s
created

ShippingEditPage::出荷先を追加()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Page\Admin;
5
6
7
class ShippingEditPage extends AbstractAdminPageStyleGuide
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
8
{
9
10
    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';
0 ignored issues
show
Coding Style introduced by
Member variable "姓_エラーメッセージ" is not in valid camel caps format
Loading history...
11
12
    public static $登録完了メッセージ = '#page_admin_shipping_edit > div > div.c-contentsArea > div.alert.alert-success.alert-dismissible.fade.show.m-3 > span';
0 ignored issues
show
Coding Style introduced by
Member variable "登録完了メッセージ" is not in valid camel caps format
Loading history...
13
14
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$I" missing
Loading history...
15
     * ShippingRegisterPage constructor.
16
     */
17
    public function __construct(\AcceptanceTester $I)
18
    {
19
        parent::__construct($I);
20
    }
21
22
    public static function go($I)
23
    {
24
        $page = new self($I);
25
        $page->goPage('/shipping/new', '出荷登録受注管理');
26
        return $page;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
27
    }
28
29
    public static function at($I)
30
    {
31
        $page = new self($I);
32
        $page->atPage('出荷登録受注管理');
33
        return $page;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
34
    }
35
36
    public function 入力_出荷日($value)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_出荷日" is not in camel caps format
Loading history...
37
    {
38
        $this->tester->executeJS("document.getElementById('shipping_shipping_date').value = '{$value}'");
39
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
40
    }
41
42
    public function お届け先編集()
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::お届け先編集" is not in camel caps format
Loading history...
43
    {
44
        $this->tester->click(['id' => 'edit-shipping-addr']);
45
        $this->tester->waitForElementVisible(['id' => 'shipping_name_name01']);
46
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
47
    }
48
49
    public function 入力_姓($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_姓" is not in camel caps format
Loading history...
50
    {
51
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_name_name01'], $value);
52
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
53
    }
54
55
    public function 入力_名($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_名" is not in camel caps format
Loading history...
56
    {
57
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_name_name02'], $value);
58
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
59
    }
60
61
    public function 入力_セイ($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_セイ" is not in camel caps format
Loading history...
62
    {
63
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_kana_kana01'], $value);
64
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
65
    }
66
67
    public function 入力_メイ($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_メイ" is not in camel caps format
Loading history...
68
    {
69
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_kana_kana02'], $value);
70
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
71
    }
72
73
    public function 入力_郵便番号($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_郵便番号" is not in camel caps format
Loading history...
74
    {
75
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_postal_code'], $value);
76
77
        return $this;
78
    }
79
80
    public function 入力_都道府県($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_都道府県" is not in camel caps format
Loading history...
81
    {
82
        $this->tester->selectOption(['id' => 'form_shippings_'.$num.'_address_pref'], $value);
83
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
84
    }
85
86
    public function 入力_市区町村名($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_市区町村名" is not in camel caps format
Loading history...
87
    {
88
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_address_addr01'], $value);
89
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
90
    }
91
92
    public function 入力_番地_ビル名($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_番地_ビル名" is not in camel caps format
Loading history...
93
    {
94
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_address_addr02'], $value);
95
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
96
    }
97
98
    public function 入力_電話番号($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_電話番号" is not in camel caps format
Loading history...
99
    {
100
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_phone_number'], $value);
101
102
        return $this;
103
    }
104
105
    public function 入力_出荷伝票番号($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_出荷伝票番号" is not in camel caps format
Loading history...
106
    {
107
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_tracking_number'], $value);
108
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
109
    }
110
111
    public function 入力_配送業者($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_配送業者" is not in camel caps format
Loading history...
112
    {
113
        $this->tester->selectOption(['id' => 'form_shippings_'.$num.'_Delivery'], $value);
114
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
115
    }
116
117
    public function 入力_配達用メモ($value, $num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::入力_配達用メモ" is not in camel caps format
Loading history...
118
    {
119
        $this->tester->fillField(['id' => 'form_shippings_'.$num.'_note'], $value);
120
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
121
    }
122
123 View Code Duplication
    public function 商品検索($value = '')
0 ignored issues
show
Unused Code introduced by
The parameter $value 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...
Coding Style introduced by
Method name "ShippingEditPage::商品検索" is not in camel caps format
Loading history...
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...
124
    {
125
        $this->tester->click(['xpath' => '//*[@id="shipmentItem"]/div/div/div/button']);
126
        $this->tester->waitForElementVisible(['id' => 'addProduct']);
127
        $this->tester->click(['id' => 'searchItemsButton']);
128
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
129
    }
130
131 View Code Duplication
    public function 商品検索結果_選択($rowNum)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::商品検索結果_選択" is not in camel caps format
Loading history...
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...
132
    {
133
        $this->tester->click(['xpath' => "//*[@id='searchItemsResult']/table/tbody/tr[${rowNum}]/td[5]/i"]);
134
        $this->tester->click(['xpath' => '//*[@id="addProduct"]/div/div/div[1]/button']);
135
        $this->tester->wait(1);
136
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
137
    }
138
139
    public function 出荷情報登録()
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::出荷情報登録" is not in camel caps format
Loading history...
140
    {
141
        $this->tester->click(['id' => 'btn_save']);
142
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
143
    }
144
145
    public function 出荷完了にする($num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::出荷完了にする" is not in camel caps format
Loading history...
146
    {
147
        $this->tester->scrollTo(['id' => 'shipmentOverview_'.$num], 0, 50);
148
        $this->tester->click('#shipmentOverview_'.$num.' > div > div:nth-child(4) > div:nth-child(2) > div:nth-child(3) > div > button');
149
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
150
    }
151
152 View Code Duplication
    public function 変更を確定()
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...
Coding Style introduced by
Method name "ShippingEditPage::変更を確定" is not in camel caps format
Loading history...
153
    {
154
        $this->tester->waitForElementVisible(['id' => 'bulkChange']);
155
        $this->tester->click(['id' => 'bulkChange']);
156
        $this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']);
157
        $this->tester->click(['id' => 'bulkChangeComplete']);
158
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
159
    }
160
161
    public function 出荷先を追加()
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::出荷先を追加" is not in camel caps format
Loading history...
162
    {
163
        $this->tester->scrollTo(['id' => 'addShipping'], 0, 50);
164
        $this->tester->click(['id' => 'addShipping']);
165
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
166
    }
167
168
    public function 出荷日を確認($num = 0)
0 ignored issues
show
Coding Style introduced by
Method name "ShippingEditPage::出荷日を確認" is not in camel caps format
Loading history...
169
    {
170
        $this->tester->scrollTo(['id' => 'shipmentOverview_'.$num], 0, 50);
171
        $this->tester->see((new \DateTime())->format('Y/m/d'),
172
                           '#shipmentOverview_'.$num.' > div > div:nth-child(4) > div:nth-child(2) > div:nth-child(3) > div > span');
173
    }
174
}
175