Completed
Push — 4.0 ( 268f2c...88f012 )
by Hideki
05:48 queued 10s
created

_support/Page/Admin/CustomerManagePage.php (2 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
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.ec-cube.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Page\Admin;
15
16
class CustomerManagePage extends AbstractAdminPageStyleGuide
17
{
18
    public static $URL = '/customer';
19
20
    public static $検索ボタン = '#search_form .c-outsideBlock__contents button';
21
    public static $詳細検索ボタン = '//*[@id="search_form"]/div[1]/div[1]/div/div/div[2]/a/span';
22
    public static $検索結果メッセージ = '#search_form > div.c-outsideBlock__contents.mb-5 > span';
23
    public static $検索結果_結果なしメッセージ = '.c-contentsArea .c-contentsArea__cols div.text-center.h5';
24
    public static $検索結果_エラーメッセージ = '.c-contentsArea .c-contentsArea__cols div.text-center.h5';
25
    public static $検索条件_仮会員 = ['id' => 'admin_search_customer_customer_status_0'];
26
    public static $検索条件_本会員 = ['id' => 'admin_search_customer_customer_status_1'];
27
28
    /**
29
     * CustomerListPage constructor.
30
     *
31
     * @param $I
32
     */
33
    public function __construct(\AcceptanceTester $I)
34
    {
35
        parent::__construct($I);
36
    }
37
38
    public static function go(\AcceptanceTester $I)
39
    {
40
        $page = new self($I);
41
42
        return $page->goPage(self::$URL, '会員一覧会員管理');
43
    }
44
45
    public function 検索($value = '')
46
    {
47
        $this->tester->fillField(['id' => 'admin_search_customer_multi'], $value);
48
        $this->tester->click(self::$検索ボタン);
49
        $this->tester->see('会員一覧会員管理', '.c-pageTitle');
50
51
        return $this;
52
    }
53
54 View Code Duplication
    public function 詳細検索_電話番号($value = '')
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...
55
    {
56
        $this->tester->click(self::$詳細検索ボタン);
57
        $this->tester->wait(1);
58
        $this->tester->fillField(['id' => 'admin_search_customer_phone_number'], $value);
59
        $this->tester->click(self::$検索ボタン);
60
        $this->tester->see('会員一覧会員管理', '.c-pageTitle');
61
62
        return $this;
63
    }
64
65
    /**
66
     * @param integer $rowNum
67
     */
68
    public function 一覧_編集($rowNum)
69
    {
70
        $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");
71
72
        return $this;
73
    }
74
75
    /**
76
     * @param integer $rowNum
77
     */
78
    public function 一覧_削除($rowNum, $execute = true)
79
    {
80
        $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");
81
        $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.modal");
82
        if ($execute) {
83
            $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.modal a.btn-ec-delete");
84
        } else {
85
            $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.modal button.btn-ec-sub");
86
        }
87
88
        return $this;
89
    }
90
91
    /**
92
     * @param integer $rowNum
93
     */
94
    public function 一覧_仮会員メール再送($rowNum)
95
    {
96
        $this->tester->click(['xpath' => "//*[@id='search_form']//div/table/tbody/tr[${rowNum}]/td[6]/div/div[1]/a"]);
97
        $this->tester->wait(5);
98
        $this->tester->click('送信');
99
100
        return $this;
101
    }
102
103
    private function 一覧_メニュー($rowNum)
0 ignored issues
show
This method is not used, and could be removed.
Loading history...
104
    {
105
        $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");
106
107
        return $this;
108
    }
109
110
    public function CSVダウンロード()
111
    {
112
        $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 > a:nth-child(1)');
113
114
        return $this;
115
    }
116
117
    public function CSV出力項目設定()
118
    {
119
        $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 > a:nth-child(2)');
120
    }
121
122
    /**
123
     * @param integer $rowNum
124
     */
125
    public function 一覧_会員ID($rowNum)
126
    {
127
        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");
128
    }
129
}
130