Skip to content

Commit 756c4a7

Browse files
committed
MAGETWO-91377: Create MFTF Tests
- drag column with content to another column group
1 parent ba01e37 commit 756c4a7

File tree

7 files changed

+105
-8
lines changed

7 files changed

+105
-8
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ActionGroup.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@
123123
<argument name="contentBlockIndex" defaultValue="1" type="string"/>
124124
<argument name="containerTargetType" defaultValue=""/>
125125
<argument name="containerTargetIndex" defaultValue="1" type="string"/>
126+
<argument name="offsetXCoordinate" defaultValue="null" type="string"/>
127+
<argument name="offsetYCoordinate" defaultValue="null" type="string"/>
126128
</arguments>
127129
<scrollTo selector="{{CmsNewPagePageActionsSection.contentSectionName}}" stepKey="scrollToTopOfStage"/>
128-
<dragAndDrop selector1="{{PageBuilderActionsSection.draggableContentBlockInPanel(contentBlockType.name)}}" selector2="{{PageBuilderActionsSection.contentBlockContainer(containerTargetType.role, containerTargetIndex)}}" stepKey="dropContentBlockIntoStage"/>
130+
<dragAndDrop selector1="{{PageBuilderActionsSection.draggableContentBlockInPanel(contentBlockType.name)}}" selector2="{{PageBuilderActionsSection.contentBlockContainer(containerTargetType.role, containerTargetIndex)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="dropContentBlockIntoStage"/>
129131
<waitForPageLoad time="30" stepKey="waitForAnimation"/>
130132
<waitForElementVisible time="10" selector="{{PageBuilderActionsSection.contentBlockInStageByIndex(contentBlockType.role, contentBlockIndex)}}" stepKey="waitForContentBlockInStage" />
131133
</actionGroup>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ColumnActionGroup.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,18 @@
2121
<waitForElementVisible time="1" selector="{{PageBuilderColumnSection.column}}" stepKey="waitForColumn" />
2222
<seeElement selector="{{PageBuilderColumnSection.column}}" stepKey="seeElementColumn"/>
2323
</actionGroup>
24+
<actionGroup name="dragColumnToAnotherColumnGroup">
25+
<arguments>
26+
<argument name="contentBlockType" defaultValue="PageBuilderColumnContentBlock"/>
27+
<argument name="contentBlockIndex" defaultValue="1" type="string"/>
28+
<argument name="containerTargetType" defaultValue="PageBuilderColumnContentBlock"/>
29+
<argument name="containerTargetIndex" defaultValue="1" type="string"/>
30+
</arguments>
31+
<waitForElementVisible time="20" selector="{{PageBuilderActionsSection.contentBlockInStageByIndex(contentBlockType.role, contentBlockIndex)}}" stepKey="waitForContentBlockInStageVisible"/>
32+
<moveMouseOver selector="{{PageBuilderActionsSection.contentBlockInStageByIndex(contentBlockType.role, contentBlockIndex)}}" x="10" y="0" stepKey="onMouseOverContentBlockStage"/>
33+
<waitForPageLoad time="30" stepKey="waitForMouseOverAnimation"/>
34+
<waitForElementVisible time="10" selector="{{PageBuilderActionsSection.contentBlockOptionsMenuByIndex(contentBlockType.role, contentBlockIndex)}}" stepKey="waitForOptions"/>
35+
<waitForElementVisible selector="{{PageBuilderColumnSection.columnMoveByIndex(contentBlockIndex)}}" stepKey="waitForMoveHandle"/>
36+
<dragAndDrop selector1="{{PageBuilderColumnSection.columnMoveByIndex(contentBlockIndex)}}" selector2="{{PageBuilderActionsSection.contentBlockContainer(contentBlockType.role, containerTargetIndex)}}" stepKey="moveContentTypeIntoContainer"/>
37+
</actionGroup>
2438
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
<element name="editFormNoUploadedImage" type="button" selector="//span[text()='{{arg1}}']//parent::label//following-sibling::div//p[text()='Browse to find or drag image here']" parameterized="true"/>
9696
<element name="editFormUploadedImageSource" type="button" selector="//div[@data-index='{{arg1}}']/descendant::*[@name='{{arg2}}']//..//..//img[contains(@src,'{{arg3}}') and contains(@src,'{{arg4}}')]" parameterized="true"/>
9797
<element name="computedHeightOnStage" type="text" selector="return parseInt(window.getComputedStyle(document.querySelector('.pagebuilder-{{arg1}}:nth-of-type({{arg2}})')).height)" parameterized="true"/>
98+
<element name="computedWidthOnStage" type="text" selector="return parseInt(window.getComputedStyle(document.querySelector('.pagebuilder-{{arg1}}:nth-of-type({{arg2}})')).width)" parameterized="true"/>
9899
</section>
99100
<section name="AdvancedForm">
100101
<element name="sectionName" type="button" selector="//div[@data-index='advanced']"/>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<element name="default" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-column')])[{{arg1}}][@style='border: {{arg2}}; border-radius: {{arg3}}px; margin: {{arg4}}px; padding: {{arg5}}px; width: {{arg6}}; background-size: {{arg7}}; background-repeat: {{arg8}}; background-attachment: {{arg9}}; align-self: {{arg10}};']" parameterized="true"/>
1313
<element name="editFormSpinner" type="input" selector=".admin__form-loading-mask[style='display: loading;'][data-role='spinner']"/>
1414
<element name="columnGroup" type="text" selector="(//div[contains(@class, 'pagebuilder-column-group')])[1]"/>
15-
<element name="columnGroupColumns" type="text" selector="(//div[contains(@class, 'pagebuilder-column-group')])[1]/descendant::div[contains(@class, 'pagebuilder-content-type') and contains(@class, 'pagebuilder-column')]"/>
15+
<element name="columnGroupColumns" type="text" selector="(//div[contains(@class, 'pagebuilder-column-group')])[{{arg1}}]/descendant::div[contains(@class, 'pagebuilder-content-type') and contains(@class, 'pagebuilder-column')]" parameterized="true"/>
1616
<element name="column" type="text" selector="(//div[contains(@class, 'pagebuilder-column-group')])[1]/descendant::div[contains(@class, 'pagebuilder-content-type') and contains(@class, 'pagebuilder-column')][1]"/>
1717
<element name="column2" type="text" selector="(//div[contains(@class, 'pagebuilder-column-group')])[1]/descendant::div[contains(@class, 'pagebuilder-content-type') and contains(@class, 'pagebuilder-column')][2]"/>
1818
<element name="columnX" type="text" selector=".pagebuilder-content-type.pagebuilder-column:nth-child({{arg1}})" parameterized="true"/>
@@ -33,6 +33,7 @@
3333
<element name="editColumn" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-column")])[1]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="edit-block"]'/>
3434
<element name="editColumn2" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-column")])[2]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="edit-block"]'/>
3535
<element name="editColumn3" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-column")])[3]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="edit-block"]'/>
36+
<element name="columnMoveByIndex" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-column")])[{{arg1}}]//div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="move-column"]' parameterized="true"/>
3637
<element name="dragColumn" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-column")])[1]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="move-structural"]'/>
3738
<element name="removeColumn" type="button" selector='(//div[contains(@class, "pagebuilder-column-group")])[1]/descendant::div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-column")][1]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="remove-structural"]'/>
3839
<element name="removeColumn2" type="button" selector='(//div[contains(@class, "pagebuilder-column-group")])[1]/descendant::div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-column")][2]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="remove-structural"]'/>
@@ -56,6 +57,7 @@
5657
<element name="columnSaveButton" type="button" selector=".page-main-actions .page-actions [data-ui-id='column-form-page-actions-save']" timeout="30"/>
5758
<element name="displayLabel" type="button" selector='(//div[contains(@class, "pagebuilder-display-label")])[{{arg1}}][contains(text(), "{{arg2}}")]' parameterized="true"/>
5859
<element name="empty" type="button" selector="(//div[contains(@class,'empty-container')]//div[contains(@class,'element-children') and contains(@class,'column-container')])[{{arg1}}]" parameterized="true"/>
60+
<element name="dropPlaceholder" type="button" selector='(//div[contains(@class, "pagebuilder-column-group")])[{{arg1}}]//div[contains(@class,"drop-placeholder")][{{arg2}}]' parameterized="true"/>
5961
</section>
6062
<section name="ColumnsOnFrontend">
6163
<element name="columnGroup" type="block" selector=".pagebuilder-column-group"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderColumnContentTest.xml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,82 @@
350350
<argument name="contentBlockIndex" value="1"/>
351351
</actionGroup>
352352
</test>
353+
<test name="ColumnDragColumnWithContentBetweenColumnGroups">
354+
<annotations>
355+
<features value="Pagebuilder"/>
356+
<stories value="Column"/>
357+
<title value="Add Column group below existing columns group on stage"/>
358+
<description value="User sees row adjusting height when a second column group is created"/>
359+
<severity value="CRITICAL"/>
360+
<testCaseId value="MAGETWO-87113"/>
361+
<group value="pagebuilder"/>
362+
<group value="pagebuilder-column"/>
363+
<group value="pagebuilder-heading"/>
364+
</annotations>
365+
<before>
366+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
367+
<actionGroup ref="navigateToAPageWithPageBuilder" stepKey="navigateToAPageWithPageBuilder"/>
368+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
369+
</before>
370+
<after>
371+
<actionGroup ref="logout" stepKey="logout"/>
372+
</after>
373+
<actionGroup ref="dragContentBlockToStage" stepKey="dragFirstColumnIntoStage">
374+
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
375+
</actionGroup>
376+
<comment userInput="Drag Column beneath existing columns to make a new column group" stepKey="commentDragColumnBelowColumns"/>
377+
<actionGroup ref="dragContentBlockToDropZone" stepKey="dragColumnIntoStage">
378+
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
379+
<argument name="contentBlockIndex" value="4"/>
380+
<argument name="containerTargetType" value="PageBuilderRowContentBlock"/>
381+
<argument name="containerTargetIndex" value="1"/>
382+
<argument name="dropZoneIndex" value="2"/>
383+
</actionGroup>
384+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('1')}}" userInput="2" stepKey="seeTwoColumnsFirstGroup"/>
385+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('2')}}" userInput="2" stepKey="seeTwoColumnsSecondGroup"/>
386+
<seeNumberOfElements selector="{{PageBuilderColumnSection.allColumns}}" userInput="4" stepKey="validateColumnGroupAdded"/>
387+
<comment userInput="Drag new column onto first group" stepKey="commentDragColumnToFirstColumnGroup"/>
388+
<actionGroup ref="dragContentBlockToContainer" stepKey="dragColumnIntoFirstColumnGroup">
389+
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
390+
<argument name="contentBlockIndex" value="3"/>
391+
<argument name="containerTargetType" value="PageBuilderColumnContentBlock"/>
392+
<argument name="containerTargetIndex" value="2"/>
393+
</actionGroup>
394+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('1')}}" userInput="3" stepKey="seeThreeColumnsFirstGroup"/>
395+
<seeNumberOfElements selector="{{PageBuilderColumnSection.allColumns}}" userInput="5" stepKey="validateFiveTotalColumns"/>
396+
<actionGroup ref="dragContentBlockToContainer" stepKey="dragHeadingIntoColumn">
397+
<argument name="contentBlockType" value="PageBuilderHeadingContentBlock"/>
398+
<argument name="contentBlockIndex" value="1"/>
399+
<argument name="containerTargetType" value="PageBuilderColumnContentBlock"/>
400+
<argument name="containerTargetIndex" value="3"/>
401+
</actionGroup>
402+
<comment userInput="Validate heading is in third column" stepKey="commentConfirmHeadingInThirdColumn"/>
403+
404+
<actionGroup ref="validateContentBlockInsideContainerStage" stepKey="confirmHeadingInThirdColumn">
405+
<argument name="containerTargetType" value="PageBuilderColumnContentBlock"/>
406+
<argument name="containerTargetIndex" value="3"/>
407+
<argument name="positionInContainer" value="1"/>
408+
<argument name="contentBlockType" value="PageBuilderHeadingContentBlock"/>
409+
<argument name="contentBlockIndex" value="1"/>
410+
</actionGroup>
411+
<actionGroup ref="clickOutsideLiveEditHeading" stepKey="clickOutsideLiveEditHeading">
412+
<argument name="index" value="1"/>
413+
</actionGroup>
414+
<comment userInput="Move column containing heading from first to second column group" stepKey="commentMoveColumnToSecondGroup"/>
415+
<actionGroup ref="dragColumnToAnotherColumnGroup" stepKey="moveColumnToSecondGroup">
416+
<argument name="contentBlockIndex" value="3"/>
417+
<argument name="containerTargetIndex" value="5"/>
418+
</actionGroup>
419+
<seeNumberOfElements selector="{{PageBuilderColumnSection.allColumns}}" userInput="5" stepKey="validateSameNumberOfColumns"/>
420+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('1')}}" userInput="2" stepKey="seeTwoColumnsFirstGroupAgain"/>
421+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('2')}}" userInput="3" stepKey="seeThreeColumnsSecondGroup"/>
422+
<seeNumberOfElements selector="{{PageBuilderActionsSection.contentBlockInStage(PageBuilderHeadingContentBlock.role)}}" userInput="1" stepKey="validateOnlySingleHeadingAfterMove" />
423+
<actionGroup ref="validateContentBlockInsideContainerStage" stepKey="confirmHeadingInMovedColumn">
424+
<argument name="containerTargetType" value="PageBuilderColumnContentBlock"/>
425+
<argument name="containerTargetIndex" value="4"/>
426+
<argument name="positionInContainer" value="1"/>
427+
<argument name="contentBlockType" value="PageBuilderHeadingContentBlock"/>
428+
<argument name="contentBlockIndex" value="1"/>
429+
</actionGroup>
430+
</test>
353431
</tests>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderColumnTest.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<actionGroup ref="dragContentBlockToStage" stepKey="dragColumnIntoStage">
3939
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
4040
</actionGroup>
41-
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns}}" userInput="2" stepKey="seeElementColumn"/>
41+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('1')}}" userInput="2" stepKey="seeElementColumn"/>
4242
<comment userInput="Validate Initial Column Height On Stage Matches Expected" stepKey="commentValidateColumnHeight"/>
4343
<actionGroup ref="validateContentBlockHeightOnStage" stepKey="assertInitialColumnHeightMatchesExpected">
4444
<argument name="contentBlock" value="PageBuilderColumnContentBlock"/>
@@ -79,11 +79,11 @@
7979
<actionGroup ref="dragContentBlockToStage" stepKey="dragColumnIntoStage">
8080
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
8181
</actionGroup>
82-
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns}}" userInput="2" stepKey="seeElementColumn"/>
82+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('1')}}" userInput="2" stepKey="seeElementColumn"/>
8383
<actionGroup ref="removeEmptyContentBlockFromStage" stepKey="removeColumn1">
8484
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
8585
</actionGroup>
86-
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns}}" userInput="1" stepKey="seeOneColumnInGroup" />
86+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('1')}}" userInput="1" stepKey="seeOneColumnInGroup" />
8787
<!-- As the removal of the first column caused this ones width to change we have to confirm the removal -->
8888
<actionGroup ref="removeContentBlockFromStage" stepKey="removeColumn2">
8989
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
@@ -121,7 +121,7 @@
121121
<actionGroup ref="dragContentBlockToStage" stepKey="dragColumnIntoStage">
122122
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
123123
</actionGroup>
124-
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns}}" userInput="2" stepKey="seeElementColumn"/>
124+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('1')}}" userInput="2" stepKey="seeElementColumn"/>
125125
<actionGroup ref="openPageBuilderEditColumnPanel" stepKey="openEditPanel"/>
126126
<actionGroup ref="validateSlideOutPanelField" stepKey="seeAppearanceMinHeightProperty">
127127
<argument name="property" value="PageBuilderAppearanceMinHeightProperty"/>
@@ -245,7 +245,7 @@
245245
<actionGroup ref="dragContentBlockToStage" stepKey="dragColumnIntoStage">
246246
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
247247
</actionGroup>
248-
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns}}" userInput="2" stepKey="seeElementColumn"/>
248+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('1')}}" userInput="2" stepKey="seeElementColumn"/>
249249
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditPanelForFirstColumn">
250250
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
251251
</actionGroup>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderTabContentTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@
981981
<actionGroup ref="dragContentBlockToStage" stepKey="dragColumnIntoStage">
982982
<argument name="contentBlockType" value="PageBuilderColumnContentBlock"/>
983983
</actionGroup>
984-
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns}}" userInput="2" stepKey="seeElementColumn"/>
984+
<seeNumberOfElements selector="{{PageBuilderColumnSection.columnGroupColumns('1')}}" userInput="2" stepKey="seeElementColumn"/>
985985
<!-- Add Tabs to Column -->
986986
<comment userInput="Drag Tabs to Column" stepKey="commentDragTabsToColumn"/>
987987
<click selector="{{PageBuilderActionsSection.interactiveGroup}}" stepKey="clickInteractiveGroup"/>

0 commit comments

Comments
 (0)