Completed
Push — experimental/sf ( cc4ff3...99dedd )
by Ryo
37:18 queued 17:03
created

PageEditPage::at()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Page\Admin;
5
6
7
class PageEditPage extends AbstractAdminPageStyleGuide
8
{
9
10
    public static $登録完了メッセージ = ['xpath' => "//div[@class='alert alert-success alert-dismissible fade show m-3']"];
11
12
    /**
13
     * PageNewPage constructor.
14
     */
15
    public function __construct(\AcceptanceTester $I)
16
    {
17
        parent::__construct($I);
18
    }
19
20
    public static function at($I)
21
    {
22
        $page = new self($I);
23
        $page->atPage('ページ管理コンテンツ管理');
24
        $page->tester->see('ページ詳細編集', '#content_page_form > div.c-contentsArea__cols > div > div > div:nth-child(1) > div.card-header > div > div.col-8 > span');
25
        return $page;
26
    }
27
28
    public function 入力_名称($value)
29
    {
30
        $this->tester->fillField(['id' => 'main_edit_name'], $value);
31
        return $this;
32
    }
33
34
    public function 入力_URL($value)
35
    {
36
        $this->tester->fillField(['id' => 'main_edit_url'], $value);
37
        return $this;
38
    }
39
40
    public function 入力_ファイル名($value)
41
    {
42
        $this->tester->fillField(['id' => 'main_edit_file_name'], $value);
43
        return $this;
44
    }
45
46
    public function 入力_内容($value)
47
    {
48
        $value = preg_replace("/([^\\\])'/", "$1\\'", $value);
49
        $this->tester->executeJS("ace.edit('editor').setValue('$value')");
50
        return $this;
51
    }
52
53
    public function 入力_PC用レイアウト($layoutName)
54
    {
55
        $this->tester->selectOption(['id' => 'main_edit_PcLayout'], $layoutName);
56
        return $this;
57
    }
58
59
    public function 出力_内容()
60
    {
61
        return $this->tester->executeJS("return ace.edit('editor').getValue()");
62
    }
63
64
    public function 登録()
65
    {
66
        $this->tester->click(['xpath' => '//button/span[text()="登録"]']);
67
    }
68
}