Code Duplication    Length = 45-59 lines in 4 locations

codeception/_support/Page/Admin/AuthorityManagePage.php 1 location

@@ 16-60 (lines=45) @@
13
14
namespace Page\Admin;
15
16
class AuthorityManagePage extends AbstractAdminPageStyleGuide
17
{
18
    public static $完了メッセージ = '.c-contentsArea .alert-success';
19
20
    public function __construct(\AcceptanceTester $I)
21
    {
22
        parent::__construct($I);
23
    }
24
25
    public static function go(\AcceptanceTester $I)
26
    {
27
        $page = new self($I);
28
29
        return $page->goPage('/setting/system/authority', '権限管理システム設定');
30
    }
31
32
    public function 行追加()
33
    {
34
        $this->tester->click('body > div.c-container > div.c-contentsArea > div.c-contentsArea__cols > div > div > form > div.card.rounded.border-0.mb-4 > div.card-body > p > button');
35
36
        return $this;
37
    }
38
39
    public function 行削除($rowNum)
40
    {
41
        $this->tester->click(['css' => "form tbody tr:nth-child($rowNum) td:nth-child(3) button"]);
42
43
        return $this;
44
    }
45
46
    public function 入力($rowNum, $role, $url)
47
    {
48
        $this->tester->selectOption(['css' => "form #table-authority tbody tr:nth-child(${rowNum}) td:nth-child(1) select"], $role);
49
        $this->tester->fillField(['css' => "form #table-authority tbody tr:nth-child(${rowNum}) td:nth-child(2) input"], $url);
50
51
        return $this;
52
    }
53
54
    public function 登録()
55
    {
56
        $this->tester->click('form .c-conversionArea button');
57
58
        return $this;
59
    }
60
}
61

codeception/_support/Page/Admin/BlockEditPage.php 1 location

@@ 16-65 (lines=50) @@
13
14
namespace Page\Admin;
15
16
class BlockEditPage extends AbstractAdminPageStyleGuide
17
{
18
    public static $登録完了メッセージ = 'body > div.c-container > div.c-contentsArea > div.alert.alert-success.alert-dismissible.fade.show.m-3 > span';
19
20
    /**
21
     * BlockEditPage constructor.
22
     */
23
    public function __construct(\AcceptanceTester $I)
24
    {
25
        parent::__construct($I);
26
    }
27
28
    public static function at($I)
29
    {
30
        $page = new self($I);
31
        $page->atPage('ブロック管理コンテンツ管理');
32
        $page->tester->see('ブロック設定', '#content_block_form > div.c-contentsArea__cols > div > div > div > div.card-header > div > div.col-8 > span');
33
34
        return $page;
35
    }
36
37
    public function 入力_ブロック名($value)
38
    {
39
        $this->tester->fillField(['id' => 'block_name'], $value);
40
41
        return $this;
42
    }
43
44
    public function 入力_ファイル名($value)
45
    {
46
        $this->tester->fillField(['id' => 'block_file_name'], $value);
47
48
        return $this;
49
    }
50
51
    public function 入力_データ($value)
52
    {
53
        $value = preg_replace("/([^\\\])'/", "$1\\'", $value);
54
        $this->tester->executeJS("ace.edit('editor').setValue('$value')");
55
56
        return $this;
57
    }
58
59
    public function 登録()
60
    {
61
        $this->tester->click('#content_block_form > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');
62
63
        return $this;
64
    }
65
}
66

codeception/_support/Page/Admin/CsvSettingsPage.php 1 location

@@ 16-74 (lines=59) @@
13
14
namespace Page\Admin;
15
16
class CsvSettingsPage extends AbstractAdminPageStyleGuide
17
{
18
    public static $CSVタイプ = ['id' => 'csv-type'];
19
20
    public static $登録完了メッセージ = '#page_admin_setting_shop_csv > div.c-container > div.c-contentsArea > div.alert.alert-success.alert-dismissible.fade.show.m-3 > span';
21
22
    protected $tester;
23
24
    /**
25
     * CsvSettingsPage constructor.
26
     */
27
    public function __construct(\AcceptanceTester $I)
28
    {
29
        parent::__construct($I);
30
    }
31
32
    public static function go($I)
33
    {
34
        $page = new CsvSettingsPage($I);
35
36
        return $page->goPage('/setting/shop/csv', 'CSV出力項目設定店舗設定');
37
    }
38
39
    public static function at($I)
40
    {
41
        $page = new CsvSettingsPage($I);
42
        $page->tester->see('CSV出力項目設定店舗設定', '.c-pageTitle');
43
44
        return $page;
45
    }
46
47
    public function 入力_CSVタイプ($value)
48
    {
49
        $this->tester->selectOption(['id' => 'csv-type'], $value);
50
51
        return $this;
52
    }
53
54
    public function 選択_出力項目($value)
55
    {
56
        $this->tester->selectOption(['id' => 'csv-output'], $value);
57
58
        return $this;
59
    }
60
61
    public function 削除()
62
    {
63
        $this->tester->click('#remove');
64
65
        return $this;
66
    }
67
68
    public function 設定()
69
    {
70
        $this->tester->click('#csv-form > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button');
71
72
        return $this;
73
    }
74
}
75

codeception/_support/Page/Admin/OrderStatusSettingsPage.php 1 location

@@ 16-70 (lines=55) @@
13
14
namespace Page\Admin;
15
16
class OrderStatusSettingsPage extends AbstractAdminPageStyleGuide
17
{
18
    public static $登録完了メッセージ = '#page_admin_setting_shop_order_status > div.c-container > div.c-contentsArea > div.alert.alert-success.alert-dismissible.fade.show.m-3 > span';
19
20
    /**
21
     * CsvSettingsPage constructor.
22
     */
23
    public function __construct(\AcceptanceTester $I)
24
    {
25
        parent::__construct($I);
26
    }
27
28
    public static function go($I)
29
    {
30
        $page = new self($I);
31
32
        return $page->goPage('/setting/shop/order_status', '受注対応状況設定店舗設定');
33
    }
34
35
    public static function at($I)
36
    {
37
        $page = new self($I);
38
        $page->tester->see('受注対応状況設定店舗設定', '.c-pageTitle');
39
40
        return $page;
41
    }
42
43
    public function 入力_名称_管理($value)
44
    {
45
        $this->tester->fillField(['id' => 'form_OrderStatuses_0_name'], $value);
46
47
        return $this;
48
    }
49
50
    public function 入力_名称_マイページ($value)
51
    {
52
        $this->tester->fillField(['id' => 'form_OrderStatuses_0_customer_order_status_name'], $value);
53
54
        return $this;
55
    }
56
57
    public function 入力_色($value)
58
    {
59
        $this->tester->fillField(['id' => 'form_OrderStatuses_0_color'], $value);
60
61
        return $this;
62
    }
63
64
    public function 登録()
65
    {
66
        $this->tester->click('#ex-conversion-action > div > button');
67
68
        return $this;
69
    }
70
}
71