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

NewsManagePage   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 69
rs 10
c 0
b 0
f 0
wmc 10
lcom 2
cbo 1
1
<?php
2
3
4
namespace Page\Admin;
5
6
7
class NewsManagePage extends AbstractAdminPage
8
{
9
10
    public static $登録完了メッセージ = '#main .container-fluid div:nth-child(1) .alert-success';
11
12
    /**
13
     * ContentsRegisterPage constructor.
14
     */
15
    public function __construct(\AcceptanceTester $I)
16
    {
17
        parent::__construct($I);
18
    }
19
20
    public static function go($I)
21
    {
22
        $page = new self($I);
23
        return $page->goPage('/content/news', 'コンテンツ管理新着情報管理');
24
    }
25
26
    public static function at($I)
27
    {
28
        $page = new self($I);
29
        return $page->atPage('コンテンツ管理新着情報管理');
30
    }
31
32
    public function 新規登録()
33
    {
34
        $this->tester->click('#main > div > div > div > div.row > div > a');
35
    }
36
37
    public function 一覧_編集($rowNum)
38
    {
39
        $this->一覧_メニュー($rowNum);
40
        $this->tester->click("#form1 > div > div > table > tbody > tr:nth-child(${rowNum}) > td.icon_edit > div > ul > li:nth-child(1) > a");
41
        return $this;
42
    }
43
44
    private function 一覧_メニュー($rowNum)
45
    {
46
        $this->tester->click("#form1 > div > div > table > tbody > tr:nth-child(${rowNum}) > td.icon_edit > div > a");
47
        return $this;
48
    }
49
50
    public function 一覧_タイトル($rowNum)
51
    {
52
        return $this->tester->grabTextFrom(['css' => "#form1 > div > div > table > tbody > tr:nth-child(${rowNum}) > td:nth-child(3)"]);
53
    }
54
55
    public function 一覧_下へ($rowNum)
56
    {
57
        $this->一覧_メニュー($rowNum);
58
        $this->tester->click("#form1 > div > div > table > tbody > tr:nth-child(${rowNum}) > td.icon_edit > div > ul > li:nth-child(3) > a");
59
        return $this;
60
    }
61
62
    public function 一覧_上へ($rowNum)
63
    {
64
        $this->一覧_メニュー($rowNum);
65
        $this->tester->click("#form1 > div > div > table > tbody > tr:nth-child(${rowNum}) > td.icon_edit > div > ul > li:nth-child(3) > a");
66
        return $this;
67
    }
68
69
    public function 一覧_削除($rowNum)
70
    {
71
        $this->一覧_メニュー($rowNum);
72
        $this->tester->click("#form1 > div > div > table > tbody > tr:nth-child(${rowNum}) > td.icon_edit > div > ul > li:nth-child(2) > a");
73
        return $this;
74
    }
75
}