Completed
Push — experimental/sf ( b1938d...177a7b )
by chihiro
201:52 queued 194:30
created

OrderManagePage::配送CSVダウンロード実行()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 7
loc 7
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
13
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$I" missing
Loading history...
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', '受注一覧受注管理');
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
25
    }
26
27
    public static function at(\AcceptanceTester $I)
28
    {
29
        $page = new self($I);
30
        return $page->atPage('受注一覧受注管理');
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
31
    }
32
33
    public function 検索($value = '')
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::検索" is not in camel caps format
Loading history...
34
    {
35
        $this->tester->fillField(['id' => 'admin_search_order_multi'], $value);
36
        $this->tester->click('#search_form #search_submit');
37
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
38
    }
39
40
    public function 詳細検索_電話番号($value = '')
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::詳細検索_電話番号" is not in camel caps format
Loading history...
41
    {
42
        $this->tester->click(self::$詳細検索ボタン);
43
        $this->tester->wait(1);
44
        $this->tester->fillField(['id' => 'admin_search_order_phone_number'], $value);
45
        $this->tester->click('#search_form #search_submit');
46
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
47
    }
48
49 View Code Duplication
    public function 受注CSVダウンロード実行()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::受注CSVダウンロード実行" 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...
50
    {
51
        $this->tester->click(['id' => 'csvDownloadDropDown']);
52
        $this->tester->waitForElementVisible(['id' => 'orderCsvDownload']);
53
        $this->tester->click(['id' => 'orderCsvDownload']);
54
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
55
    }
56
57 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...
58
    {
59
        $this->tester->click(['id' => 'csvSettingDropDown']);
60
        $this->tester->waitForElementVisible(['id' => 'orderCsvSetting']);
61
        $this->tester->click(['id' => 'orderCsvSetting']);
62
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
63
    }
64
65 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...
66
    {
67
        $this->tester->click(['id' => 'csvDownloadDropDown']);
68
        $this->tester->waitForElementVisible(['id' => 'shippingCsvDownload']);
69
        $this->tester->click(['id' => 'shippingCsvDownload']);
70
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
71
    }
72
73 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...
74
    {
75
        $this->tester->click(['id' => 'csvSettingDropDown']);
76
        $this->tester->waitForElementVisible(['id' => 'shippingCsvSetting']);
77
        $this->tester->click(['id' => 'shippingCsvSetting']);
78
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
79
    }
80
81
    public function 一覧_編集($rowNum)
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_編集" is not in camel caps format
Loading history...
82
    {
83
        $this->tester->click("#search_result > tbody > tr:nth-child(${rowNum}) a.action-edit");
84
    }
85
86
    public function 一覧_削除()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_削除" is not in camel caps format
Loading history...
87
    {
88
        $this->tester->click("#form_bulk > div.row.justify-content-between.mb-2 .btn-bulk-wrapper button.btn.btn-ec-delete");
89
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
90
    }
91
92
    public function Accept_削除()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::Accept_削除" is not in camel caps format
Loading history...
93
    {
94
        $this->tester->waitForElementVisible(['id' => 'btn_bulk_delete']);
95
        $this->tester->click("#btn_bulk_delete");
96
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
97
    }
98
99
    public function Cancel_削除()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::Cancel_削除" is not in camel caps format
Loading history...
100
    {
101
        $this->tester->click("#bulkDeleteModal > div > div > div.modal-footer > button.btn.btn-ec-sub");
102
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
103
    }
104
105 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...
106
    {
107
        $this->tester->click(['css' => "#search_result > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3.text-center > div > div:nth-child(1) > a"]);
108
        $this->tester->waitForElementVisible(['id' => 'sentUpdateModal']);
109
        $this->tester->wait(2);
110
        $this->tester->scrollTo(['id' => 'bulkChange']);
111
        $this->tester->click(['id' => 'bulkChange']);
112
        $this->tester->wait(5);
113
        $this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']);
114
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
115
    }
116
117
    public function 一覧_選択($rowNum)
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_選択" is not in camel caps format
Loading history...
118
    {
119
        $this->tester->checkOption(['css' => "#search_result > tbody > tr:nth-child(${rowNum}) > td > input[type=checkbox]"]);
120
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
121
    }
122
123
    public function 一覧_全選択()
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_全選択" is not in camel caps format
Loading history...
124
    {
125
        $this->tester->checkOption('#check_all');
126
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
127
    }
128
129
130 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...
131
    {
132
        $this->tester->click(['css' => "#search_result > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3.text-center > div > div:nth-child(1) > a"]);
133
        $this->tester->waitForElementVisible(['id' => 'sentUpdateModal']);
134
        $this->tester->wait(2);
135
        $this->tester->scrollTo(['id' => 'bulkChange']);
136
        $this->tester->click(['id' => 'bulkChange']);
137
        $this->tester->wait(5);
138
        $this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']);
139
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
140
    }
141
142 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...
143
    {
144
        $this->tester->click(['id' => 'bulkSendMail']);
145
        $this->tester->waitForElementVisible(['id' => 'sentUpdateModal']);
146
        $this->tester->wait(1);
147
        $this->tester->click(['id' => 'bulkChange']);
148
        $this->tester->wait(5);
149
        $this->tester->waitForElementVisible(['id' => 'bulkChangeComplete']);
150
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
151
    }
152
153
    public function 一覧_注文番号($rowNum)
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::一覧_注文番号" is not in camel caps format
Loading history...
154
    {
155
        return $this->tester->grabTextFrom("#search_result > tbody > tr:nth-child($rowNum) a.action-edit");
156
    }
157
158
    public function 受注ステータス検索($value = '')
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::受注ステータス検索" is not in camel caps format
Loading history...
159
    {
160
        $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...
161
        $this->tester->click('#search_form #search_submit');
162
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
163
    }
164
165
    public function 受注ステータス変更($option = [])
0 ignored issues
show
Coding Style introduced by
Method name "OrderManagePage::受注ステータス変更" is not in camel caps format
Loading history...
166
    {
167
        $this->tester->selectOption('#option_bulk_status', $option);
168
        $this->tester->click('#form_bulk #btn_bulk_status');
169
        $this->tester->waitForElementVisible('#confirmBulkModal', 5);
170
        $this->tester->click('#confirmBulkModal button[data-action="execute"]');
171
        return $this;
0 ignored issues
show
introduced by
Missing blank line before return statement
Loading history...
172
    }
173
}