Failed Conditions
Pull Request — experimental/sf (#3236)
by Kentaro
58:58 queued 51:26
created

MyPage   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 66
rs 10
c 0
b 0
f 0
wmc 9
lcom 1
cbo 2
1
<?php
2
/*
3
 * This file is part of EC-CUBE
4
 *
5
 * Copyright(c) 2000-2017 LOCKON CO.,LTD. All Rights Reserved.
6
 *
7
 * http://www.lockon.co.jp/
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
 */
23
24
namespace Page\Front;
25
26
27
class MyPage extends AbstractFrontPage
28
{
29
30
    const ORDER_HISTORY = 'ul.ec-navlistRole__navlist li:nth-child(1) a';
31
    const FAVORITE = 'ul.ec-navlistRole__navlist li:nth-child(2) a';
32
    const USER_INFO = 'ul.ec-navlistRole__navlist li:nth-child(3) a';
33
    const ADDRESS = 'ul.ec-navlistRole__navlist li:nth-child(4) a';
34
    const WITHDRAW = 'ul.ec-navlistRole__navlist li:nth-child(5) a';
35
36
    public function __construct(\AcceptanceTester $I)
37
    {
38
        parent::__construct($I);
39
    }
40
41
    public static function go($I) {
42
        $page = new self($I);
43
        $page->goPage('/mypage');
44
        return $page;
45
    }
46
47
    public static function at($I)
48
    {
49
        $page = new self($I);
50
        $page->tester->see('ご注文履歴', self::ORDER_HISTORY);
51
        $page->tester->see('お気に入り一覧', self::FAVORITE);
52
        $page->tester->see('会員情報編集', self::USER_INFO);
53
        $page->tester->see('お届け先一覧', self::ADDRESS);
54
        $page->tester->see('退会手続き', self::WITHDRAW);
55
        return $page;
56
    }
57
58
    public function 注文履歴()
59
    {
60
        $this->tester->click(self::ORDER_HISTORY);
61
        return $this;
62
    }
63
64
    public function 注文履歴詳細($num)
65
    {
66
        $num += 2;
67
        $this->tester->click(".ec-layoutRole__main div:nth-child(${num}) p.ec-historyListHeader__action a");
68
    }
69
70
    public function お気に入り一覧()
71
    {
72
        $this->tester->click(self::FAVORITE);
73
        return $this;
74
    }
75
76
    public function 会員情報編集()
77
    {
78
        $this->tester->click(self::USER_INFO);
79
        return $this;
80
    }
81
82
    public function お届け先編集()
83
    {
84
        $this->tester->click(self::ADDRESS);
85
        return new CustomerAddressListPage($this->tester);
86
    }
87
88
    public function 退会手続き()
89
    {
90
        $this->tester->click(self::WITHDRAW);
91
    }
92
}