These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of EC-CUBE |
||
5 | * |
||
6 | * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. |
||
7 | * |
||
8 | * http://www.ec-cube.co.jp/ |
||
9 | * |
||
10 | * For the full copyright and license information, please view the LICENSE |
||
11 | * file that was distributed with this source code. |
||
12 | */ |
||
13 | |||
14 | namespace Page\Admin; |
||
15 | |||
16 | class LayoutEditPage extends AbstractAdminPageStyleGuide |
||
17 | { |
||
18 | public static $未使用ブロックアイテム = ['css' => '#unused-block div.sort']; |
||
19 | public static $登録完了メッセージ = ['xpath' => "//div[@class='alert alert-success alert-dismissible fade show m-3']"]; |
||
20 | |||
21 | /** |
||
22 | * LayoutEditPage constructor. |
||
23 | */ |
||
24 | public function __construct(\AcceptanceTester $I) |
||
25 | { |
||
26 | parent::__construct($I); |
||
27 | } |
||
28 | |||
29 | public static function at($I) |
||
30 | { |
||
31 | $page = new self($I); |
||
32 | |||
33 | return $page->atPage('レイアウト管理コンテンツ管理'); |
||
34 | } |
||
35 | |||
36 | public function 登録() |
||
37 | { |
||
38 | $this->tester->waitForElementVisible('#form1 > div > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button'); |
||
39 | $this->tester->click('#form1 > div > div.c-conversionArea > div > div > div:nth-child(2) > div > div > button'); |
||
40 | |||
41 | return $this; |
||
42 | } |
||
43 | |||
44 | public function ブロックを移動($blockName, $dest, $timeout = 10) |
||
45 | { |
||
46 | $this->tester->waitForElementVisible(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='${blockName}']]]]"], $timeout); |
||
47 | $this->tester->dragAndDrop(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='${blockName}']]]]"], $dest); |
||
48 | |||
49 | return $this; |
||
50 | } |
||
51 | |||
52 | public function コンテキストメニューを開く($blockName) |
||
53 | { |
||
54 | $this->tester->click(['xpath' => "//div[contains(@id, 'detail_box__layout_item')][div[div[1][span[text()='${blockName}']]]]/div/div[2]"]); |
||
55 | |||
56 | return $this; |
||
57 | } |
||
58 | |||
59 | View Code Duplication | public function コンテキストメニューで上に移動($blockName) |
|
0 ignored issues
–
show
|
|||
60 | { |
||
61 | $this->コンテキストメニューを開く($blockName); |
||
62 | $this->tester->waitForElementVisible(['xpath' => "//div[contains(@id, 'popover')]/div[2]/div/a[1]"]); |
||
63 | $this->tester->click(['xpath' => "//div[contains(@id, 'popover')]/div[2]/div/a[1]"]); |
||
64 | |||
65 | return $this; |
||
66 | } |
||
67 | |||
68 | View Code Duplication | public function コンテキストメニューで下に移動($blockName) |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
69 | { |
||
70 | $this->コンテキストメニューを開く($blockName); |
||
71 | $this->tester->waitForElementVisible(['xpath' => "//div[contains(@id, 'popover')]/div[2]/div/a[2]"]); |
||
72 | $this->tester->click(['xpath' => "//div[contains(@id, 'popover')]/div[2]/div/a[2]"]); |
||
73 | |||
74 | return $this; |
||
75 | } |
||
76 | |||
77 | public function コンテキストメニューでセクションに移動($blockName) |
||
78 | { |
||
79 | $this->コンテキストメニューを開く($blockName); |
||
80 | $this->tester->waitForElementVisible(['xpath' => "//div[contains(@id, 'popover')]/div[2]/div/a[3]"]); |
||
81 | $this->tester->wait(1); |
||
82 | $this->tester->click(['xpath' => "//div[contains(@id, 'popover')]/div[2]/div/a[3]"]); |
||
83 | $this->tester->waitForElementVisible(['id' => 'move-to-section']); |
||
84 | $this->tester->wait(1); |
||
85 | $this->tester->click(['id' => 'move-to-section']); |
||
86 | $this->tester->waitForElementNotVisible(['id' => 'move-to-section']); |
||
87 | $this->tester->wait(1); |
||
88 | |||
89 | return $this; |
||
90 | } |
||
91 | |||
92 | public function コンテキストメニューでコードプレビュー($blockName, $element = null, $timeout = 10) |
||
93 | { |
||
94 | $this->コンテキストメニューを開く($blockName); |
||
95 | $this->tester->scrollTo(['xpath' => "//div[contains(@id, 'popover')]/div[2]/div/a[4]"], 0, 0); |
||
96 | $this->tester->wait(1); |
||
97 | $this->tester->click(['xpath' => "//div[contains(@id, 'popover')]/div[2]/div/a[4]"]); |
||
98 | $this->tester->waitForElementVisible(['id' => 'codePreview']); |
||
99 | if ($element) { |
||
100 | $this->tester->waitForElementVisible($element, $timeout); |
||
101 | } |
||
102 | $this->tester->click(['xpath' => "//*[@id='codePreview']/div/div/div[3]/button[1]"]); |
||
103 | |||
104 | return $this; |
||
105 | } |
||
106 | |||
107 | public function 選択_プレビューページ($value) |
||
108 | { |
||
109 | $this->tester->selectOption(['id' => 'admin_layout_Page'], $value); |
||
110 | |||
111 | return $this; |
||
112 | } |
||
113 | |||
114 | public function プレビュー() |
||
115 | { |
||
116 | $this->tester->click('#preview-button'); |
||
117 | |||
118 | return $this; |
||
119 | } |
||
120 | |||
121 | public function 検索ブロック名($value) |
||
122 | { |
||
123 | $this->tester->fillField(['css' => '#unused-block div.first input'], $value); |
||
124 | |||
125 | return $this; |
||
126 | } |
||
127 | |||
128 | public function レイアウト名($value) |
||
129 | { |
||
130 | $this->tester->fillField(['css' => '#admin_layout_name'], $value); |
||
131 | |||
132 | return $this; |
||
133 | } |
||
134 | } |
||
135 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.