Failed Conditions
Push — experimental/sf ( 069d05...1f2df0 )
by chihiro
157:56 queued 150:35
created

_support/Page/Admin/ShippingManagePage.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
namespace Page\Admin;
4
5
6
class ShippingManagePage extends AbstractAdminPageStyleGuide
7
{
8
    public static $検索結果_メッセージ = '#search_form > div.c-outsideBlock__contents.mb-3 > span';
9
    public static $検索結果_エラーメッセージ = '//*[@id="page_admin_shipping"]/div[1]/div[3]/div[3]/div/div[1]/div/div/div[1]';
10
    public static $詳細検索ボタン = '//*[@id="search_form"]/div[1]/div/div/div[2]/a/span';
11
12
    /**
13
     * ShippingListPage constructor.
14
     */
15
    public function __construct(\AcceptanceTester $I)
16
    {
17
        parent::__construct($I);
18
    }
19
20
    public static function go(\AcceptanceTester $I)
21
    {
22
        $page = new self($I);
23
        return $page->goPage('/shipping', '出荷一覧出荷管理');
24
    }
25
26
    public static function at(\AcceptanceTester $I)
27
    {
28
        $page = new self($I);
29
        return $page->atPage('出荷管理出荷一覧');
30
    }
31
32
    public function 検索($value = '')
33
    {
34
        $this->tester->fillField(['id' => 'admin_search_shipping_multi'], $value);
35
        $this->tester->click('#search_form > div.c-outsideBlock__contents.mb-3 > button');
36
        return $this;
37
    }
38
39 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...
40
    {
41
        $this->tester->click(self::$詳細検索ボタン);
42
        $this->tester->waitForElementVisible(['id' => 'searchDetail']);
43
        $this->tester->wait(0.5);
44
        return $this;
45
    }
46
47
    public function 入力_ご注文者お名前($value)
48
    {
49
        $this->tester->fillField(['id' => 'admin_search_shipping_order_name'], $value);
50
        return $this;
51
    }
52
53
    public function 入力_ご注文者お名前フリガナ($value)
54
    {
55
        $this->tester->fillField(['id' => 'admin_search_shipping_order_kana'], $value);
56
        return $this;
57
    }
58
59 View Code Duplication
    public function 詳細検索_電話番号($value = '')
60
    {
61
        $this->tester->click(self::$詳細検索ボタン);
62
        $this->tester->wait(1);
63
        $this->tester->fillField(['id' => 'admin_search_shipping_phone_number'], $value);
64
        $this->tester->click('#search_form > div.c-outsideBlock__contents.mb-3 > button');
65
        return $this;
66
    }
67
68
    public function 出荷CSVダウンロード実行()
69
    {
70
        $this->tester->click(['xpath' => '//*[@id="form_bulk"]/div[1]/div[2]/div[2]/div/a[1]']);
71
        return $this;
72
    }
73
74
    public function 出荷CSV出力項目設定()
75
    {
76
        $this->tester->click(['xpath' => '//*[@id="form_bulk"]/div[1]/div[2]/div[2]/div/a[2]']);
77
        return $this;
78
    }
79
80
    public function 一覧_編集($rowNum)
81
    {
82
        $this->tester->click(['xpath' => "//*[@id='form_bulk']/div[2]/div/table/tbody/tr[${rowNum}]/td[2]/a"]);
83
    }
84
85 View Code Duplication
    public function 一覧_削除()
86
    {
87
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[3]']);
88
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[3]']);
89
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk_delete"]']);
90
        $this->tester->click(['xpath' => '//*[@id="btn_bulk_delete"]']);
91
        return $this;
92
    }
93
94
    public function 一覧_削除キャンセル()
95
    {
96
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
97
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
98
        return $this;
99
    }
100
101 View Code Duplication
    public function 一括発送済み更新()
102
    {
103
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[2]']);
104
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[2]']);
105
        $this->tester->wait(3);
106
        $this->tester->click(['id' => 'notificationMail']);
107
        $this->tester->click(['id' => 'bulkChange']);
108
        return $this;
109
    }
110
111 View Code Duplication
    public function 一括発送済みメール送信()
112
    {
113
        $this->tester->waitForElementVisible(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
114
        $this->tester->click(['xpath' => '//*[@id="btn_bulk"]/button[1]']);
115
        $this->tester->wait(3);
116
        $this->tester->click(['id' => 'bulkChange']);
117
        return $this;
118
    }
119
120
    public function 一覧_全選択()
121
    {
122
        $this->tester->checkOption(['id' => 'check-all']);
123
        return $this;
124
    }
125
126
    /**
127
     * TODO: Should remove this function due to new design does not have other dropdown menu
128
     */
129
    private function その他メニュー()
130
    {
131
        $this->tester->click('#dropmenu > a');
132
    }
133
134
    public function メール一括通知()
135
    {
136
        $this->tester->click('#form_bulk #btn_bulk_mail');
137
    }
138
139
    public function 一覧_チェックボックス($rowNum)
140
    {
141
        $this->tester->click(['xpath' => "//*[@id='form_bulk']/div[2]/div/table/tbody/tr[${rowNum}]/td[1]/input"]);
142
    }
143
}
144