Failed Conditions
Push — experimental/sf ( ef9148...a8c20b )
by Ryo
1419:13 queued 1408:28
created

_support/Page/Admin/ShippingManagePage.php (10 issues)

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
namespace Page\Admin;
4
5
6
class ShippingManagePage extends AbstractAdminPageStyleGuide
7
{
8
    public static $検索条件_受注ステータス = ['id' => 'admin_search_shipping_status'];
9
    public static $検索結果_メッセージ = '#search_form > div.c-outsideBlock__contents.mb-3 > span';
10
    public static $検索結果_エラーメッセージ = '//*[@id="page_admin_shipping"]/div[1]/div[3]/div[3]/div/div[1]/div/div/div[1]';
11
    public static $詳細検索ボタン = '//*[@id="search_form"]/div[1]/div/div/div[3]/a/span';
12
13
    /**
14
     * ShippingListPage 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('/shipping', '出荷一覧出荷管理');
0 ignored issues
show
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
Missing blank line before return statement
Loading history...
31
    }
32
33
    public function 検索($value = '')
34
    {
35
        $this->tester->fillField(['id' => 'admin_search_shipping_multi'], $value);
36
        $this->tester->click('#search_form > div.c-outsideBlock__contents.mb-3 > button');
37
        return $this;
38
    }
39
40
    public function 詳細検索設定()
0 ignored issues
show
Method name "ShippingManagePage::詳細検索設定" is not in camel caps format
Loading history...
41
    {
42
        $this->tester->click(self::$詳細検索ボタン);
43
        $this->tester->waitForElementVisible(['id' => 'searchDetail']);
44
        $this->tester->wait(0.5);
45
        return $this;
0 ignored issues
show
Missing blank line before return statement
Loading history...
46
    }
47
48
    public function 入力_ご注文者お名前($value)
0 ignored issues
show
Method name "ShippingManagePage::入力_ご注文者お名前" is not in camel caps format
Loading history...
49
    {
50
        $this->tester->fillField(['id' => 'admin_search_shipping_order_name'], $value);
51
        return $this;
0 ignored issues
show
Missing blank line before return statement
Loading history...
52
    }
53
54
    public function 入力_ご注文者お名前フリガナ($value)
0 ignored issues
show
Method name "ShippingManagePage::入力_ご注文者お名前フリガナ" is not in camel caps format
Loading history...
55
    {
56
        $this->tester->fillField(['id' => 'admin_search_shipping_order_kana'], $value);
57
        return $this;
0 ignored issues
show
Missing blank line before return statement
Loading history...
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_shipping_phone_number'], $value);
65
        $this->tester->click('#search_form > div.c-outsideBlock__contents.mb-3 > button');
66
        return $this;
67
    }
68
69
    public function 出荷CSVダウンロード実行()
70
    {
71
        $this->tester->click(['xpath' => '//*[@id="form_bulk"]/div[1]/div[2]/div[2]/div/a[1]']);
72
        return $this;
73
    }
74
75
    public function 出荷CSV出力項目設定()
76
    {
77
        $this->tester->click(['xpath' => '//*[@id="form_bulk"]/div[1]/div[2]/div[2]/div/a[2]']);
78
        return $this;
79
    }
80
81
    public function 一覧_編集($rowNum)
82
    {
83
        $this->tester->click(['xpath' => "//*[@id='form_bulk']/div[2]/div/table/tbody/tr[${rowNum}]/td[2]/a"]);
84
    }
85
86 View Code Duplication
    public function 一覧_削除()
87
    {
88
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[3]']);
89
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[3]']);
90
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk_delete"]']);
91
        $this->tester->click(['xpath' => '//*[@id="btn_bulk_delete"]']);
92
        return $this;
93
    }
94
95
    public function 一覧_削除キャンセル()
96
    {
97
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
98
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
99
        return $this;
100
    }
101
102 View Code Duplication
    public function 一括発送済み更新()
103
    {
104
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[2]']);
105
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[2]']);
106
        $this->tester->wait(3);
107
        $this->tester->click(['id' => 'notificationMail']);
108
        $this->tester->click(['id' => 'bulkChange']);
109
        return $this;
110
    }
111
112 View Code Duplication
    public function 一括発送済みメール送信()
113
    {
114
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
115
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
116
        $this->tester->wait(3);
117
        $this->tester->click(['id' => 'bulkChange']);
118
        return $this;
119
    }
120
121
    public function 一覧_全選択()
122
    {
123
        $this->tester->checkOption(['id' => 'check-all']);
124
        return $this;
125
    }
126
127
    /**
128
     * TODO: Should remove this function due to new design does not have other dropdown menu
129
     */
130
    private function その他メニュー()
131
    {
132
        $this->tester->click('#dropmenu > a');
133
    }
134
135
    public function メール一括通知()
136
    {
137
        $this->tester->click('#form_bulk #btn_bulk_mail');
138
    }
139
140
    public function 一覧_チェックボックス($rowNum)
141
    {
142
        $this->tester->click(['xpath' => "//*[@id='form_bulk']/div[2]/div/table/tbody/tr[${rowNum}]/td[1]/input"]);
143
    }
144
145
    public function 取得_出荷伝票番号($rowNum)
0 ignored issues
show
Method name "ShippingManagePage::取得_出荷伝票番号" is not in camel caps format
Loading history...
146
    {
147
        return $this->tester->grabTextFrom("#form_bulk table > tbody > tr:nth-child(${rowNum}) > td:nth-child(3)");
148
    }
149
150
    public function 取得_出荷日($rowNum)
0 ignored issues
show
Method name "ShippingManagePage::取得_出荷日" is not in camel caps format
Loading history...
151
    {
152
        return $this->tester->grabTextFrom("#form_bulk table > tbody > tr:nth-child(${rowNum}) > td:nth-child(7)");
153
    }
154
}
155