Failed Conditions
Push — modify-scrutinizeryml ( 361e25...08b4c1 )
by Kentaro
63:54 queued 57:30
created

CustomerManagePage::一覧_削除()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
1
<?php
2
3
namespace Page\Admin;
4
5
6
class CustomerManagePage extends AbstractAdminPageStyleGuide
7
{
8
    public static $URL = '/customer';
9
10
    public static $検索ボタン = '#search_form .c-outsideBlock__contents button';
11
    public static $詳細検索ボタン = '//*[@id="search_form"]/div[1]/div[1]/div/div/div[2]/a/span';
12
    public static $検索結果メッセージ = '#search_form > div.c-outsideBlock__contents.mb-5 > span';
13
    public static $検索結果_結果なしメッセージ = '.c-contentsArea .c-contentsArea__cols div.text-center.h5';
14
    public static $検索結果_エラーメッセージ = '.c-contentsArea .c-contentsArea__cols div.text-center.h5';
15
    public static $検索条件_仮会員 = ['id' => 'admin_search_customer_customer_status_0'];
16
    public static $検索条件_本会員 = ['id' => 'admin_search_customer_customer_status_1'];
17
18
    /**
19
     * CustomerListPage constructor.
20
     * @param $I
21
     */
22
    public function __construct(\AcceptanceTester $I)
23
    {
24
        parent::__construct($I);
25
    }
26
27
    public static function go(\AcceptanceTester $I)
28
    {
29
        $page = new self($I);
30
        return $page->goPage(self::$URL, '会員一覧会員管理');
31
    }
32
33
    public function 検索($value = '')
34
    {
35
        $this->tester->fillField(['id' => 'admin_search_customer_multi'], $value);
36
        $this->tester->click(self::$検索ボタン);
37
        $this->tester->see('会員一覧会員管理', '.c-pageTitle');
38
        return $this;
39
    }
40
41
    public function 詳細検索_電話番号($value = '')
42
    {
43
        $this->tester->click(self::$詳細検索ボタン);
44
        $this->tester->wait(1);
45
        $this->tester->fillField(['id' => 'admin_search_customer_phone_number'], $value);
46
        $this->tester->click(self::$検索ボタン);
47
        $this->tester->see('会員一覧会員管理', '.c-pageTitle');
48
        return $this;
49
    }
50
51
    /**
52
     * @param integer $rowNum
53
     */
54
    public function 一覧_編集($rowNum)
55
    {
56
        $this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td:nth-child(2) > a");
57
        return $this;
58
    }
59
60
    /**
61
     * @param integer $rowNum
62
     */
63
    public function 一覧_削除($rowNum, $execute = true)
64
    {
65
        $this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3 > div > div > a");
66
        $this->tester->waitForElementVisible("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3 > div > div > div.modal");
67
        $this->tester->wait(1);
68
        if ($execute) {
69
            $this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3 > div > div > div.modal a.btn-ec-delete");
70
        } else {
71
            $this->tester->click("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pr-3 > div > div > div.modal button.btn-ec-sub");
72
        }
73
        return $this;
74
    }
75
76
    /**
77
     * @param integer $rowNum
78
     */
79
    public function 一覧_仮会員メール再送($rowNum)
80
    {
81
        $this->tester->click(['xpath' => "//*[@id='search_form']//div/table/tbody/tr[${rowNum}]/td[6]/div/div[1]/a"]);
82
        $this->tester->wait(5);
83
        $this->tester->click('再送');
84
        return $this;
85
    }
86
87
    private function 一覧_メニュー($rowNum)
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
88
    {
89
        $this->tester->click("#search_form > div.row > div > div > div.box-body > div.table_list > div > table > tbody > tr:nth-child(${rowNum}) > td.icon_edit > div > a");
90
        return $this;
91
    }
92
93
    public function CSVダウンロード()
94
    {
95
        $this->tester->click('#search_form > div.c-contentsArea__cols > div > div > div.row.justify-content-between.mb-2 > div.col-5.text-right > div:nth-child(2) > div > button:nth-child(1)');
96
        return $this;
97
    }
98
99
    public function CSV出力項目設定()
100
    {
101
        $this->tester->click('#search_form > div.c-contentsArea__cols > div > div > div.row.justify-content-between.mb-2 > div.col-5.text-right > div:nth-child(2) > div > button:nth-child(2)');
102
    }
103
104
    /**
105
     * @param integer $rowNum
106
     */
107
    public function 一覧_会員ID($rowNum)
108
    {
109
        return $this->tester->grabTextFrom("#search_form > div.c-contentsArea__cols > div > div > div.card.rounded.border-0.mb-4 > div > table > tbody > tr:nth-child(${rowNum}) > td.align-middle.pl-3");
110
    }
111
}
112