Completed
Push — apply-codeceptions ( 341052...a29855 )
by Kentaro
53:23 queued 21:51
created

PageManagePage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Page\Admin;
5
6
7
class PageManagePage extends AbstractAdminPageStyleGuide
8
{
9
10
    /**
11
     * PageManagePage constructor.
12
     */
13
    public function __construct(\AcceptanceTester $I)
14
    {
15
        parent::__construct($I);
16
    }
17
18
    public static function go($I)
19
    {
20
        $page = new self($I);
21
        return $page->goPage('/content/page', 'ページ管理コンテンツ管理');
22
    }
23
24
    public function 新規入力()
25
    {
26
        $this->tester->click(['xpath' => '//a[text()="新規追加"]']);
27
    }
28
29
    public function ページ編集($pageName)
30
    {
31
        $this->tester->click(['xpath' => sprintf('//a[text()="%s"]', $pageName)]);
32
    }
33
34
    public function 削除($pageName)
35
    {
36
        $this->tester->click(['xpath'=> "//*[@id='list_page_tbl']/tbody/tr/td/a[contains(text(), '${pageName}')]/parent::node()/parent::node()/td[@class='align-middle pr-3']/div/div/a"]);
37
        $this->accept_削除($pageName);
38
    }
39
40
    public function accept_削除($pageName) {
41
        $this->tester->waitForElementVisible(['xpath' => "//*[@id='list_page_tbl']/tbody/tr/td/a[contains(text(), '${pageName}')]/parent::node()/parent::node()/td[@class='align-middle pr-3']/div/div/div[contains(@class, 'modal')]"]);
42
        $this->tester->click(['xpath' => "//*[@id='list_page_tbl']/tbody/tr/td/a[contains(text(), '${pageName}')]/parent::node()/parent::node()/td[@class='align-middle pr-3']/div/div/div[contains(@class, 'modal')]/div/div/div/a[contains(@class, 'btn-ec-delete')]"]);
43
    }
44
}