Failed Conditions
Pull Request — experimental/sf (#3394)
by k-yamamura
50:41
created

OrderManagePage::すべてチェック()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Page\Admin;
4
5
6
class OrderManagePage extends AbstractAdminPageStyleGuide
0 ignored issues
show
introduced by
Missing class doc comment
Loading history...
7
{
8
    public static $検索条件_受注ステータス = ['id' => 'admin_search_order_status'];
0 ignored issues
show
Coding Style introduced by
Member variable "検索条件_受注ステータス" is not in valid camel caps format
Loading history...
9
    public static $検索結果_メッセージ = '#search_form #search_total_count';
0 ignored issues
show
Coding Style introduced by
Member variable "検索結果_メッセージ" is not in valid camel caps format
Loading history...
10
    public static $検索結果_エラーメッセージ = '//*[@id="page_admin_order"]/div[1]/div[3]/div[3]/div/div/div[1]/div/div[1]';
0 ignored issues
show
Coding Style introduced by
Member variable "検索結果_エラーメッセージ" is not in valid camel caps format
Loading history...
11
    public static $詳細検索ボタン = '//*[@id="search_form"]/div[1]/div/div/div[3]/a/i/span';
0 ignored issues
show
Coding Style introduced by
Member variable "詳細検索ボタン" is not in valid camel caps format
Loading history...
12
    public static $タイトル要素 = '.c-container .c-contentsArea .c-pageTitle .c-pageTitle__titles';
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
     * OrderListPage constructor.
16
     */
17
    public function __construct(\AcceptanceTester $I)
18
    {
19
        parent::__construct($I);
20
    }
21
22
    public static function go(\AcceptanceTester $I)
23
    {
24
        $page = new self($I);
25
        return $page->goPage('/order', '受注一覧受注管理');
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
26
    }
27
28
    public static function at(\AcceptanceTester $I)
29
    {
30
        $page = new self($I);
31
        return $page->atPage('受注一覧受注管理');
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
32
    }
33
34
    public function 検索($value = '')
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::検索" is not in camel caps format
Loading history...
35
    {
36
        $this->tester->fillField(['id' => 'admin_search_order_multi'], $value);
37
        $this->tester->click('#search_form #search_submit');
38
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
39
    }
40
41
    public function 詳細検索_電話番号($value = '')
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::詳細検索_電話番号" is not in camel caps format
Loading history...
42
    {
43
        $this->tester->click(self::$詳細検索ボタン);
44
        $this->tester->wait(1);
45
        $this->tester->fillField(['id' => 'admin_search_order_phone_number'], $value);
46
        $this->tester->click('#search_form #search_submit');
47
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
48
    }
49
50 View Code Duplication
    public function 受注CSVダウンロード実行()
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 "OrderManagePage::受注CSVダウンロード実行" is not in camel caps format
Loading history...
51
    {
52
        $this->tester->click(['id' => 'csvDownloadDropDown']);
53
        $this->tester->waitForElementVisible(['id' => 'orderCsvDownload']);
54
        $this->tester->click(['id' => 'orderCsvDownload']);
55
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
56
    }
57
58 View Code Duplication
    public function 受注CSV出力項目設定()
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 "OrderManagePage::受注CSV出力項目設定" is not in camel caps format
Loading history...
59
    {
60
        $this->tester->click(['id' => 'csvSettingDropDown']);
61
        $this->tester->waitForElementVisible(['id' => 'orderCsvSetting']);
62
        $this->tester->click(['id' => 'orderCsvSetting']);
63
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
64
    }
65
66 View Code Duplication
    public function 配送CSVダウンロード実行()
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 "OrderManagePage::配送CSVダウンロード実行" is not in camel caps format
Loading history...
67
    {
68
        $this->tester->click(['id' => 'csvDownloadDropDown']);
69
        $this->tester->waitForElementVisible(['id' => 'shippingCsvDownload']);
70
        $this->tester->click(['id' => 'shippingCsvDownload']);
71
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
72
    }
73
74 View Code Duplication
    public function 配送CSV出力項目設定()
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 "OrderManagePage::配送CSV出力項目設定" is not in camel caps format
Loading history...
75
    {
76
        $this->tester->click(['id' => 'csvSettingDropDown']);
77
        $this->tester->waitForElementVisible(['id' => 'shippingCsvSetting']);
78
        $this->tester->click(['id' => 'shippingCsvSetting']);
79
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
80
    }
81
82
    public function すべてチェック()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::すべてチェック" is not in camel caps format
Loading history...
83
    {
84
        $this->tester->click('#form_bulk #toggle_check_all');
85
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
86
    }
87
88
    public function 要素をクリック($element)
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::要素をクリック" is not in camel caps format
Loading history...
89
    {
90
        $this->tester->click($element);
91
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
92
    }
93
94
    public function PDFフォームを入力($elId, $value)
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::PDFフォームを入力" is not in camel caps format
Loading history...
95
    {
96
        $this->tester->fillField($elId, $value);
97
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
98
    }
99
100
    public function 一覧_編集($rowNum)
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_編集" is not in camel caps format
Loading history...
101
    {
102
        $this->tester->click("#search_result > tbody > tr:nth-child(${rowNum}) a.action-edit");
103
    }
104
105
    public function 一覧_削除()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_削除" is not in camel caps format
Loading history...
106
    {
107
        $this->tester->click("#form_bulk > div.row.justify-content-between.mb-2 .btn-bulk-wrapper button.btn.btn-ec-delete");
108
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
109
    }
110
111
    public function Accept_削除()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::Accept_削除" is not in camel caps format
Loading history...
112
    {
113
        $this->tester->waitForElementVisible(['id' => 'btn_bulk_delete']);
114
        $this->tester->click("#btn_bulk_delete");
115
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
116
    }
117
118
    public function Cancel_削除()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::Cancel_削除" is not in camel caps format
Loading history...
119
    {
120
        $this->tester->click("#bulkDeleteModal > div > div > div.modal-footer > button.btn.btn-ec-sub");
121
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
122
    }
123
124 View Code Duplication
    public function 一覧_メール通知($rowNum)
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 "OrderManagePage::一覧_メール通知" is not in camel caps format
Loading history...
125
    {
126
        $this->tester->click(['css' => "#search_result > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3.text-center > div > div:nth-child(1) > a"]);
127
        $this->tester->waitForElementVisible(['id' => 'sentUpdateModal']);
128
        $this->tester->wait(2);
129
        $this->tester->scrollTo(['id' => 'bulkChange']);
130
        $this->tester->click(['id' => 'bulkChange']);
131
        $this->tester->wait(5);
132
        $this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']);
133
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
134
    }
135
136
    public function 一覧_選択($rowNum)
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_選択" is not in camel caps format
Loading history...
137
    {
138
        $this->tester->checkOption(['css' => "#search_result > tbody > tr:nth-child(${rowNum}) > td > input[type=checkbox]"]);
139
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
140
    }
141
142
    public function 一覧_全選択()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_全選択" is not in camel caps format
Loading history...
143
    {
144
        $this->tester->checkOption('#toggle_check_all');
145
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
146
    }
147
148
149 View Code Duplication
    public function 個別メール送信($rowNum)
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 "OrderManagePage::個別メール送信" is not in camel caps format
Loading history...
150
    {
151
        $this->tester->click(['css' => "#search_result > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3.text-center > div > div:nth-child(1) > a"]);
152
        $this->tester->waitForElementVisible(['id' => 'sentUpdateModal']);
153
        $this->tester->wait(2);
154
        $this->tester->scrollTo(['id' => 'bulkChange']);
155
        $this->tester->click(['id' => 'bulkChange']);
156
        $this->tester->wait(5);
157
        $this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']);
158
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
159
    }
160
161 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 "OrderManagePage::一括メール送信" is not in camel caps format
Loading history...
162
    {
163
        $this->tester->click(['id' => 'bulkSendMail']);
164
        $this->tester->waitForElementVisible(['id' => 'sentUpdateModal']);
165
        $this->tester->wait(1);
166
        $this->tester->click(['id' => 'bulkChange']);
167
        $this->tester->wait(5);
168
        $this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']);
169
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
170
    }
171
172
    public function 一覧_注文番号($rowNum)
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_注文番号" is not in camel caps format
Loading history...
173
    {
174
        return $this->tester->grabTextFrom("#search_result > tbody > tr:nth-child($rowNum) a.action-edit");
175
    }
176
177
    public function 受注ステータス検索($value = '')
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::受注ステータス検索" is not in camel caps format
Loading history...
178
    {
179
        $this->tester->checkOption(['id' => 'admin_search_order_status_' . $value]);
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
180
        $this->tester->click('#search_form #search_submit');
181
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
182
    }
183
184
    public function 受注ステータス変更($option = [])
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::受注ステータス変更" is not in camel caps format
Loading history...
185
    {
186
        $this->tester->selectOption('#option_bulk_status', $option);
187
        $this->tester->click('#form_bulk #btn_bulk_status');
188
        $this->tester->waitForElementVisible('#confirmBulkModal', 5);
189
        $this->tester->click('#confirmBulkModal button[data-action="execute"]');
190
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
191
    }
192
}