Skip to content

Commit 5391dc5

Browse files
committed
PB-108 add MFTF test for TC PB-1211
1 parent 5a03f86 commit 5391dc5

File tree

9 files changed

+244
-3
lines changed

9 files changed

+244
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
3+
<actionGroup name="dragExistingColumnToExistingColumnLine">
4+
<arguments>
5+
<argument name="containerColumnGroupIndex" defaultValue="1" type="string"/>
6+
<argument name="containerColumnLineIndex" defaultValue="1" type="string"/>
7+
<argument name="columnIndexInNewLine" defaultValue="1" type="string"/>
8+
<argument name="columnIndex" defaultValue="1" type="string"/>
9+
<argument name="x" defaultValue="null" type="string"/>
10+
<argument name="y" defaultValue="null" type="string"/>
11+
</arguments>
12+
<waitForElementVisible time="20" selector="{{PageBuilderStage.contentTypeInStageByIndex('column', columnIndex)}}" stepKey="waitForContentTypeInStageVisible"/>
13+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex('column', columnIndex)}}" x="{{x}}" y="{{y}}" stepKey="onMouseOverContentTypeStage"/>
14+
<waitForPageLoad time="30" stepKey="waitForMouseOverAnimation"/>
15+
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenuByIndex('column', columnIndex)}}" stepKey="waitForOptions"/>
16+
<waitForElementVisible selector="{{ColumnOnBackend.columnMoveByIndex(columnIndex)}}" stepKey="waitForMoveHandle"/>
17+
<dragAndDrop selector1="{{ColumnOnBackend.columnMoveByIndex(columnIndex)}}" selector2="{{PageBuilderStage.contentTypeInStageByIndex('column-group', containerColumnGroupIndex)}}{{PageBuilderStage.childContentTypeInStageByIndex('column-line', containerColumnLineIndex)}}{{PageBuilderStage.childContentTypeInStageByIndex('column', columnIndexInNewLine)}}" stepKey="moveContentTypeIntoContainer"/>
18+
<waitForPageLoad stepKey="waitForDragOperation"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="dragExistingColumnToNewColumnLine">
11+
<arguments>
12+
<argument name="newColumnLineIndexExpected" defaultValue="1" type="string"/>
13+
<argument name="targetColumnLineSelector" type="string"/>
14+
<argument name="columnIndex" defaultValue="1" type="string"/>
15+
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
16+
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
17+
<!-- When adding column line to the top, advised to use y offset of 10 -->
18+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
19+
</arguments>
20+
<waitForElementVisible time="20" selector="{{PageBuilderStage.contentTypeInStageByIndex('column', columnIndex)}}" stepKey="waitForContentTypeInStageVisible"/>
21+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex('column', columnIndex)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
22+
<waitForPageLoad time="30" stepKey="waitForMouseOverAnimation"/>
23+
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenuByIndex('column', columnIndex)}}" stepKey="waitForOptions"/>
24+
<waitForElementVisible selector="{{ColumnOnBackend.columnMoveByIndex(columnIndex)}}" stepKey="waitForMoveHandle"/>
25+
<dragAndDrop selector1="{{ColumnOnBackend.columnMoveByIndex(columnIndex)}}" selector2="{{targetColumnLineSelector}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="dropPageBuilderColumnGroupContentTypeIntoStage"/>
26+
<waitForPageLoad stepKey="waitForAnimationasdads" time="30"/>
27+
<dontSeeJsError stepKey="doNotSeeJSErrorInConsole"/>
28+
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStageByIndex('column-line', newColumnLineIndexExpected)}}" stepKey="waitForPageBuilderColumnLineContentTypeInStage"/>
29+
<waitForPageLoad stepKey="waitForToolbarsToLoad" time="30"/>
30+
</actionGroup>
31+
</actionGroups>
32+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="dragNewColumnToExistingColumnLine">
11+
<arguments>
12+
<argument name="columnGroupIndex" defaultValue="1" type="string"/>
13+
<argument name="columnLineIndex" defaultValue="1" type="string"/>
14+
<argument name="columnIndex" defaultValue="1" type="string"/>
15+
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
16+
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
17+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
18+
</arguments>
19+
<click selector="{{pageBuilderArea}}{{PageBuilderPanel.searchPanel}}" stepKey="lostFocus"/>
20+
<waitForElementVisible time="30" selector="{{pageBuilderArea}}{{PageBuilderPanel.draggableContentTypeInPanel(PageBuilderColumnGroupContentType.name)}}" stepKey="waitForPageBuilderColumnGroupContentTypeInPanel"/>
21+
<dragAndDrop selector1="{{pageBuilderArea}}{{PageBuilderPanel.draggableContentTypeInPanel(PageBuilderColumnGroupContentType.name)}}" selector2="{{ColumnLineOnBackend.bottomDropPlaceHolder(targetAfterColumnLineIndex)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="dropagainPageBuilderColumnGroupContentTypeIntoStage"/>
22+
<waitForPageLoad stepKey="waitForAnimationasdads" time="30"/>
23+
<dontSeeJsError stepKey="doNotSeeJSErrorInConsole"/>
24+
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStageByIndex('column-line', contentTypeIndex)}}" stepKey="waitForPageBuilderColumnLineContentTypeInStage"/>
25+
<waitForPageLoad stepKey="waitForToolbarsToLoad" time="30"/>
26+
</actionGroup>
27+
</actionGroups>
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="dragNewColumnToNewColumnLine">
11+
<arguments>
12+
<argument name="contentTypeIndex" defaultValue="1" type="string"/>
13+
<argument name="targetColumnLineSelector" type="string"/>
14+
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
15+
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
16+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
17+
</arguments>
18+
<click selector="{{pageBuilderArea}}{{PageBuilderPanel.searchPanel}}" stepKey="lostFocus"/>
19+
<waitForElementVisible time="30" selector="{{pageBuilderArea}}{{PageBuilderPanel.draggableContentTypeInPanel(PageBuilderColumnGroupContentType.name)}}" stepKey="waitForPageBuilderColumnGroupContentTypeInPanel"/>
20+
<dragAndDrop selector1="{{pageBuilderArea}}{{PageBuilderPanel.draggableContentTypeInPanel(PageBuilderColumnGroupContentType.name)}}" selector2="{{targetColumnLineSelector}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="dropagainPageBuilderColumnGroupContentTypeIntoStage"/>
21+
<waitForPageLoad stepKey="waitForAnimationasdads" time="30"/>
22+
<dontSeeJsError stepKey="doNotSeeJSErrorInConsole"/>
23+
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStageByIndex('column-line', contentTypeIndex)}}" stepKey="waitForPageBuilderColumnLineContentTypeInStage"/>
24+
<waitForPageLoad stepKey="waitForToolbarsToLoad" time="30"/>
25+
</actionGroup>
26+
</actionGroups>
27+

app/code/Magento/PageBuilder/Test/Mftf/Data/ContentTypeData.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
<data key="role">column-group</data>
3030
<data key="pageNamePrefix">columns</data>
3131
</entity>
32+
<entity name="PageBuilderColumnLineContentType" type="pagebuilder_content_type">
33+
<data key="name">Column Line</data>
34+
<data key="section">Layout</data>
35+
<data key="role">column-line</data>
36+
<data key="pageNamePrefix">column-line</data>
37+
</entity>
3238
<entity name="PageBuilderColumnContentType" type="pagebuilder_content_type">
3339
<data key="name">Column</data>
3440
<data key="section">Layout</data>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
<section name="ColumnLineOnBackend">
10+
<element name="base" type="button" selector="(//div[@data-content-type=&quot;column-line&quot;])[{{arg1}}]" parameterized="true"/>
11+
<element name="bottomDropPlaceHolder" type="button" selector="(//div[@data-content-type=&quot;column-line&quot;])[{{arg1}}]/div[contains(@class,&quot;bottom-dropper&quot;)]" parameterized="true"/>
12+
<element name="topDropPlaceHolder" type="button" selector="(//div[@data-content-type=&quot;column-line&quot;])[{{arg1}}]/div[contains(@class,&quot;top-dropper&quot;)]" parameterized="true"/>
13+
<element name="childColumnDisplayLabel" type="button" selector="(//div[@data-content-type=&quot;column-line&quot;])[{{arg1}}]//div[contains(@class, &quot;pagebuilder-content-type&quot;) and contains(concat(' ', @class, ' '), ' pagebuilder-column ')][{{arg2}}]/descendant::div[contains(@class, &quot;pagebuilder-display-label&quot;)][contains(text(), &quot;{{arg3}}&quot;)]" parameterized="true"/>
14+
</section>
15+
</sections>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderStageSection/PageBuilderStageSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<element name="contentTypeLabelByText" type="button" selector="//div[contains(@class, &quot;pagebuilder-content-type&quot;) and contains(concat(' ', @class, ' '), ' pagebuilder-{{arg1}} ')]//div[contains(@class, &quot;pagebuilder-display-label&quot;) and contains(., &quot;{{labelText}}&quot;)]" parameterized="true"/>
4141
<element name="contentTypeAffordanceLabelByText" type="button" selector="//div[contains(@class, &quot;pagebuilder-content-type&quot;) and contains(@class, &quot;pagebuilder-affordance-{{contentType}}&quot;)]//div[contains(@class, &quot;pagebuilder-display-label&quot;) and contains(., &quot;{{labelText}}&quot;)]" parameterized="true"/>
4242
<element name="contentTypeInStageByIndex" type="button" selector="(//div[contains(@class, &quot;pagebuilder-content-type&quot;) and contains(concat(' ', @class, ' '), &quot; pagebuilder-{{arg1}} &quot;)])[{{arg2}}]" parameterized="true"/>
43+
<element name="childContentTypeInStageByIndex" type="button" selector="//div[contains(@class, &quot;pagebuilder-content-type&quot;) and contains(concat(' ', @class, ' '), &quot; pagebuilder-{{arg1}} &quot;)][{{arg2}}]" parameterized="true"/>
4344
<element name="contentTypeContainer" type="button" selector="(//div[contains(@class, &quot;pagebuilder-content-type&quot;) and contains(concat(' ', @class, ' '), ' pagebuilder-{{arg1}} ')])[{{arg2}}]/descendant::div[contains(@class, &quot;element-children&quot;)]" parameterized="true"/>
4445
<element name="contentTypeInsideContainerStage" type="button" selector="(//div[contains(@class, &quot;{{arg1}}-container&quot;)])[{{arg2}}]//div[contains(@class,&quot;pagebuilder-content-type-wrapper&quot;)][{{arg3}}]//div[contains(@class,&quot;pagebuilder-{{arg4}}&quot;)][{{arg5}}]" parameterized="true"/>
4546
<element name="contentTypePreviewInStage" type="button" selector="div.pagebuilder-{{arg1}}.pagebuilder-content-type" parameterized="true"/>

0 commit comments

Comments
 (0)