Skip to content

Commit 7b1ab21

Browse files
committed
MC-13769: Add Missing P0-P1 MFTF Tests For PageBuilder On CMS Block - Render Content Through Block
- Fixing columns rendered through block tests - Updating/adding supporting data, sections, actiongroups
1 parent 2ac0bfc commit 7b1ab21

File tree

7 files changed

+464
-281
lines changed

7 files changed

+464
-281
lines changed

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

Lines changed: 75 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,38 @@
2323
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenuByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForOptions"/>
2424
<waitForElementVisible selector="{{ColumnOnBackend.columnMoveByIndex(contentTypeIndex)}}" stepKey="waitForMoveHandle"/>
2525
<dragAndDrop selector1="{{ColumnOnBackend.columnMoveByIndex(contentTypeIndex)}}" selector2="{{PageBuilderStage.contentTypeContainer(contentType.role, containerTargetIndex)}}" stepKey="moveContentTypeIntoContainer"/>
26-
<waitForPageLoad stepKey="waitForDragOperation" />
26+
<waitForPageLoad stepKey="waitForDragOperation"/>
2727
</actionGroup>
2828
<actionGroup name="openGridSizeForm">
2929
<arguments>
3030
<argument name="index" defaultValue="1" type="string"/>
3131
</arguments>
32-
<waitForElementVisible selector="{{ColumnOnBackend.gridSizeButton(index)}}" stepKey="waitForGridSizeButtonVisible" />
33-
<click selector="{{ColumnOnBackend.gridSizeButton(index)}}" stepKey="clickGridSizeButton" />
34-
<waitForPageLoad stepKey="waitForAnimation" />
35-
<waitForElementVisible selector="{{ColumnOnBackend.gridSizeInput(index)}}" stepKey="waitForGridVisible" />
32+
<waitForElementVisible selector="{{ColumnOnBackend.gridSizeButton(index)}}" stepKey="waitForGridSizeButtonVisible"/>
33+
<click selector="{{ColumnOnBackend.gridSizeButton(index)}}" stepKey="clickGridSizeButton"/>
34+
<waitForPageLoad stepKey="waitForAnimation"/>
35+
<waitForElementVisible selector="{{ColumnOnBackend.gridSizeInput(index)}}" stepKey="waitForGridVisible"/>
3636
</actionGroup>
3737
<actionGroup name="closeGridSizeForm">
3838
<arguments>
3939
<argument name="index" defaultValue="1" type="string"/>
4040
</arguments>
41-
<click selector="{{ColumnOnBackend.columnX('1')}}" stepKey="clickColumn" />
42-
<waitForPageLoad stepKey="waitForAnimation" />
43-
<waitForElementNotVisible selector="{{ColumnOnBackend.gridSizeInput(index)}}" stepKey="waitForGridNotVisible" />
41+
<click selector="{{ColumnOnBackend.columnX('1')}}" stepKey="clickColumn"/>
42+
<waitForPageLoad stepKey="waitForAnimation"/>
43+
<waitForElementNotVisible selector="{{ColumnOnBackend.gridSizeInput(index)}}" stepKey="waitForGridNotVisible"/>
4444
</actionGroup>
4545
<actionGroup name="updateGridSize">
4646
<arguments>
4747
<argument name="index" defaultValue="1" type="string"/>
4848
<argument name="gridSize" defaultValue="12" type="string"/>
4949
</arguments>
50-
<waitForElementVisible selector="{{ColumnOnBackend.gridSizeButton(index)}}" stepKey="waitForGridSizeButtonVisible" />
51-
<click selector="{{ColumnOnBackend.gridSizeButton(index)}}" stepKey="clickGridSizeButton" />
52-
<waitForPageLoad stepKey="waitForAnimation" />
53-
<waitForElementVisible selector="{{ColumnOnBackend.gridSizeInput(index)}}" stepKey="waitForGridVisible" />
50+
<waitForElementVisible selector="{{ColumnOnBackend.gridSizeButton(index)}}" stepKey="waitForGridSizeButtonVisible"/>
51+
<click selector="{{ColumnOnBackend.gridSizeButton(index)}}" stepKey="clickGridSizeButton"/>
52+
<waitForPageLoad stepKey="waitForAnimation"/>
53+
<waitForElementVisible selector="{{ColumnOnBackend.gridSizeInput(index)}}" stepKey="waitForGridVisible"/>
5454
<fillField selector="{{ColumnOnBackend.gridSizeInput(index)}}" userInput="{{gridSize}}" stepKey="enterGridSize"/>
5555
<pressKey selector="{{ColumnOnBackend.gridSizeInput(index)}}" parameterArray="['su',\Facebook\WebDriver\WebDriverKeys::ENTER]" stepKey="pressKeyEnter"/>
56-
<waitForPageLoad stepKey="waitForUpdate" />
57-
<waitForElementVisible selector="{{ColumnOnBackend.displayLabelGridSize(index, gridSize)}}" stepKey="validateGridSize" />
56+
<waitForPageLoad stepKey="waitForUpdate"/>
57+
<waitForElementVisible selector="{{ColumnOnBackend.displayLabelGridSize(index, gridSize)}}" stepKey="validateGridSize"/>
5858
</actionGroup>
5959
<actionGroup name="updateGridSizeInvalid">
6060
<arguments>
@@ -63,8 +63,67 @@
6363
<argument name="errorMessage"/>
6464
</arguments>
6565
<fillField selector="{{ColumnOnBackend.gridSizeInput(index)}}" userInput="{{gridSize}}" stepKey="enterGridSize"/>
66-
<click selector="{{ColumnOnBackend.columnX(index)}}" stepKey="clickColumn" />
67-
<waitForPageLoad stepKey="waitForAnimation" />
66+
<click selector="{{ColumnOnBackend.columnX(index)}}" stepKey="clickColumn"/>
67+
<waitForPageLoad stepKey="waitForAnimation"/>
6868
<waitForElementVisible selector="{{ColumnOnBackend.gridSizeError(index, errorMessage)}}" stepKey="verifyError"/>
6969
</actionGroup>
70+
<actionGroup name="validateColumnAppearanceFullHeight">
71+
<arguments>
72+
<argument name="section" defaultValue="ColumnOnBackend"/>
73+
<argument name="columnIndex" defaultValue="1" type="string"/>
74+
<argument name="columnGroupIndex" defaultValue="1" type="string"/>
75+
<argument name="acceptableOffset" defaultValue="2" type="string"/>
76+
</arguments>
77+
<comment userInput="validateColumnAppearanceFullHeight" stepKey="comment"/>
78+
<waitForElementVisible selector="{{section.columnGroup(columnGroupIndex)}}" stepKey="waitForColumnGroup"/>
79+
<waitForElementVisible selector="{{section.base(columnIndex)}}" stepKey="waitForColumn"/>
80+
<seeElement selector="{{section.appearance(columnIndex, PageBuilderColumnAppearanceProperty_FullHeight.value)}}" stepKey="seeColumnAppearance"/>
81+
<executeJS function="return document.querySelectorAll('{{section.allColumnGroups}}')[{{columnGroupIndex}}-1].clientHeight" stepKey="columnGroupHeight"/>
82+
<executeJS function="return document.querySelectorAll('{{section.baseCSS}}')[{{columnIndex}}-1].clientHeight" stepKey="individualColumnHeight"/>
83+
<executeJS function="return Math.round(Math.abs({$columnGroupHeight}-{$individualColumnHeight}))" stepKey="heightDifference"/>
84+
<assertLessThan stepKey="assertColumnHeightEqualToColumnGroupHeight">
85+
<expectedResult type="int">{{acceptableOffset}}</expectedResult>
86+
<actualResult type="variable">heightDifference</actualResult>
87+
</assertLessThan>
88+
</actionGroup>
89+
<actionGroup name="validateColumnAppearanceTopAligned">
90+
<arguments>
91+
<argument name="section" defaultValue="ColumnOnBackend"/>
92+
<argument name="height" defaultValue="PageBuilderMinHeightProperty_300"/>
93+
<argument name="columnIndex" defaultValue="1" type="string"/>
94+
<argument name="columnGroupIndex" defaultValue="1" type="string"/>
95+
<argument name="acceptableOffset" defaultValue="2" type="string"/>
96+
</arguments>
97+
<comment userInput="validateColumnAppearanceTopAligned" stepKey="comment"/>
98+
<waitForElementVisible selector="{{section.columnGroup(columnGroupIndex)}}" stepKey="waitForColumnGroup"/>
99+
<waitForElementVisible selector="{{section.base(columnIndex)}}" stepKey="waitForColumn"/>
100+
<seeElement selector="{{section.appearance(columnIndex, PageBuilderColumnAppearanceProperty_Top.value)}}" stepKey="seeColumnAppearance"/>
101+
<executeJS function="return document.querySelectorAll('{{section.baseCSS}}')[{{columnIndex}}-1].clientHeight" stepKey="individualColumnHeight"/>
102+
<executeJS function="return Math.round(Math.abs({$individualColumnHeight}-{{height.value}}))" stepKey="heightDifference"/>
103+
<!-- Validate height of column -->
104+
<assertLessThanOrEqual stepKey="assertContentHeightAcceptable">
105+
<expectedResult type="int">{{acceptableOffset}}</expectedResult>
106+
<actualResult type="variable">heightDifference</actualResult>
107+
</assertLessThanOrEqual>
108+
<executeJS function="return document.querySelectorAll('{{section.allColumnGroups}}')[{{columnGroupIndex}}-1].getBoundingClientRect().top" stepKey="topOfColumnGroup"/>
109+
<executeJS function="return document.querySelectorAll('{{section.baseCSS}}')[{{columnIndex}}-1].getBoundingClientRect().top" stepKey="topOfIndividualColumn"/>
110+
<executeJS function="return Math.round(Math.abs({$topOfColumnGroup}-{$topOfIndividualColumn}))" stepKey="topOfColumnDifference"/>
111+
<!-- Validate position of column -->
112+
<assertLessThan stepKey="assertTopOfColumnAcceptable">
113+
<expectedResult type="int">{{acceptableOffset}}</expectedResult>
114+
<actualResult type="variable">topOfColumnDifference</actualResult>
115+
</assertLessThan>
116+
</actionGroup>
117+
<actionGroup name="validateColumnAppearanceCenterAligned" extends="validateColumnAppearanceTopAligned">
118+
<comment userInput="validateColumnAppearanceCenterAligned" stepKey="comment"/>
119+
<seeElement selector="{{section.appearance(columnIndex, PageBuilderColumnAppearanceProperty_Center.value)}}" stepKey="seeColumnAppearance"/>
120+
<executeJS function="return Math.round(document.querySelectorAll('{{section.allColumnGroups}}')[{{columnGroupIndex}}-1].getBoundingClientRect().top + (document.querySelectorAll('{{section.allColumnGroups}}')[{{columnGroupIndex}}-1].clientHeight / 2))" stepKey="topOfColumnGroup"/>
121+
<executeJS function="return Math.round(document.querySelectorAll('{{section.baseCSS}}')[{{columnIndex}}-1].getBoundingClientRect().top + (document.querySelectorAll('{{section.baseCSS}}')[{{columnIndex}}-1].clientHeight / 2))" stepKey="topOfIndividualColumn"/>
122+
</actionGroup>
123+
<actionGroup name="validateColumnAppearanceBottomAligned" extends="validateColumnAppearanceTopAligned">
124+
<comment userInput="validateColumnAppearanceBottomAligned" stepKey="comment"/>
125+
<seeElement selector="{{section.appearance(columnIndex, PageBuilderColumnAppearanceProperty_Bottom.value)}}" stepKey="seeColumnAppearance"/>
126+
<executeJS function="return document.querySelectorAll('{{section.allColumnGroups}}')[{{columnGroupIndex}}-1].getBoundingClientRect().bottom" stepKey="topOfColumnGroup"/>
127+
<executeJS function="return document.querySelectorAll('{{section.baseCSS}}')[{{columnIndex}}-1].getBoundingClientRect().bottom" stepKey="topOfIndividualColumn"/>
128+
</actionGroup>
70129
</actionGroups>

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,6 @@
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11-
<entity name="PageBuilderFirstColumnInStage" type="pagebuilder_column">
12-
<data key="index">1</data>
13-
<data key="pageName" unique="suffix">testcmspage</data>
14-
</entity>
15-
<entity name="PageBuilderSecondColumnInStage" type="pagebuilder_column">
16-
<data key="index">2</data>
17-
<data key="pageName" unique="suffix">testcmspage</data>
18-
</entity>
19-
<entity name="PageBuilderThirdColumnInStage" type="pagebuilder_column">
20-
<data key="index">3</data>
21-
<data key="pageName" unique="suffix">testcmspage</data>
22-
</entity>
23-
<!-- Column Width -->
24-
<entity name="PageBuilderColumnWidthPropertyDefault" type="pagebuilder_column_width_property">
25-
<data key="value">50%</data>
26-
</entity>
27-
<!-- Column Width -->
28-
<entity name="PageBuilderColumnAlignSelfPropertyDefault" type="pagebuilder_column_align_self_property">
29-
<data key="value">stretch</data>
30-
</entity>
3111
<!-- Appearance -->
3212
<entity name="PageBuilderColumnAppearanceProperty_FullHeight" type="pagebuilder_column_appearance_property">
3313
<data key="name">Appearance</data>

0 commit comments

Comments
 (0)