Skip to content

Commit f620d4c

Browse files
committed
MC-4117: Update banner to use new background images logic
- add padding comments - use index argument - specify padding values
1 parent 6634cdf commit f620d4c

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

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

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!-- Collage Appearances -->
12+
<!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values -->
1213
<actionGroup name="validateOverlayPositionCollageLeft">
1314
<arguments>
1415
<argument name="page"/>
@@ -17,23 +18,24 @@
1718
</arguments>
1819
<!-- Validate right edge of overlay -->
1920
<comment userInput="Validate right edge of overlay" stepKey="commentValidateRightEdgeOfOverlay"/>
20-
<executeJS function="return {{page.wrapperJS('1')}}.getBoundingClientRect().right-{{page.wrapperJS('1')}}.getBoundingClientRect().width/2" stepKey="wrapperRightPositionMinusWidth50Percent"/>
21-
<executeJS function="return {{page.overlayJS('1')}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/>
21+
<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().right-{{page.wrapperJS(index)}}.getBoundingClientRect().width/2" stepKey="wrapperRightPositionMinusWidth50Percent"/>
22+
<executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/>
2223
<executeJS function="return Math.round(({$wrapperRightPositionMinusWidth50Percent}/{$overlayRightPosition})*100)/100" stepKey="overlayRightRatio"/>
2324
<assertEquals stepKey="assertOverlayRightRatio">
2425
<expectedResult type="int">1</expectedResult>
2526
<actualResult type="variable">overlayRightRatio</actualResult>
2627
</assertEquals>
2728
<!-- Validate left edge of overlay -->
2829
<comment userInput="Validate left edge of overlay" stepKey="commentValidateLeftEdgeOfOverlay"/>
29-
<executeJS function="return {{page.wrapperJS('1')}}.getBoundingClientRect().left" stepKey="wrapperLeftPosition"/>
30-
<executeJS function="return {{page.overlayJS('1')}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/>
30+
<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().left" stepKey="wrapperLeftPosition"/>
31+
<executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/>
3132
<executeJS function="return Math.round(({$overlayLeftPosition}-{$wrapperLeftPosition})*100)/100" stepKey="overlayPadding"/>
3233
<assertEquals stepKey="assertOverlayIsEqualToPadding">
33-
<expectedResult type="int">{{padding.value}}</expectedResult>
34+
<expectedResult type="int">{{padding.paddingLeft}}</expectedResult>
3435
<actualResult type="variable">overlayPadding</actualResult>
3536
</assertEquals>
3637
</actionGroup>
38+
<!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values -->
3739
<actionGroup name="validateOverlayPositionCollageRight">
3840
<arguments>
3941
<argument name="page"/>
@@ -42,40 +44,41 @@
4244
</arguments>
4345
<!-- Validate right edge of overlay -->
4446
<comment userInput="Validate right edge of overlay" stepKey="commentValidateRightEdgeOfOverlay"/>
45-
<executeJS function="return {{page.wrapperJS('1')}}.getBoundingClientRect().right" stepKey="wrapperRightPosition"/>
46-
<executeJS function="return {{page.overlayJS('1')}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/>
47+
<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().right" stepKey="wrapperRightPosition"/>
48+
<executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/>
4749
<executeJS function="return Math.round(({$wrapperRightPosition}-{$overlayRightPosition})*100)/100" stepKey="overlayPadding"/>
4850
<assertEquals stepKey="assertOverlayIsEqualToPadding">
49-
<expectedResult type="int">{{padding.value}}</expectedResult>
51+
<expectedResult type="int">{{padding.paddingRight}}</expectedResult>
5052
<actualResult type="variable">overlayPadding</actualResult>
5153
</assertEquals>
5254
<!-- Validate left edge of overlay -->
5355
<comment userInput="Validate left edge of overlay" stepKey="commentValidateLeftEdgeOfOverlay"/>
54-
<executeJS function="return {{page.wrapperJS('1')}}.getBoundingClientRect().right-{{page.wrapperJS('1')}}.getBoundingClientRect().width/2" stepKey="wrapperRightMinusWidthHalf"/>
55-
<executeJS function="return {{page.overlayJS('1')}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/>
56+
<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().right-{{page.wrapperJS(index)}}.getBoundingClientRect().width/2" stepKey="wrapperRightMinusWidthHalf"/>
57+
<executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/>
5658
<executeJS function="return Math.round(({$wrapperRightMinusWidthHalf}/{$overlayLeftPosition})*100)/100" stepKey="overlayLeftRatio"/>
5759
<assertEquals stepKey="assertOverlayLeftRatio">
5860
<expectedResult type="int">1</expectedResult>
5961
<actualResult type="variable">overlayLeftRatio</actualResult>
6062
</assertEquals>
6163
</actionGroup>
64+
<!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values -->
6265
<actionGroup name="validateOverlayPositionCollageCenter">
6366
<arguments>
6467
<argument name="page"/>
6568
<argument name="index" defaultValue="1" type="string"/>
6669
<argument name="padding" defaultValue="PageBuilderPaddingProperty40"/>
6770
</arguments>
6871
<!-- Validate right edge of overlay -->
69-
<executeJS function="return ({{page.wrapperJS('1')}}.getBoundingClientRect().width+{{padding.value}}*2)*.25" stepKey="wrapperWidthMinusPadding25"/>
70-
<executeJS function="return {{page.wrapperJS('1')}}.getBoundingClientRect().right-{{page.overlayJS('1')}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/>
72+
<executeJS function="return ({{page.wrapperJS(index)}}.getBoundingClientRect().width+{{padding.paddingLeft}}+{{padding.paddingRight}})*.25" stepKey="wrapperWidthMinusPadding25"/>
73+
<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().right-{{page.overlayJS(index)}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/>
7174
<executeJS function="return Math.round(({$wrapperWidthMinusPadding25}/{$overlayRightPosition})*100)/100" stepKey="overlayRightRatio"/>
7275
<assertEquals stepKey="assertOverlayRightRatio">
7376
<expectedResult type="int">1</expectedResult>
7477
<actualResult type="variable">overlayRightRatio</actualResult>
7578
</assertEquals>
7679
<!-- Validate left edge of overlay -->
7780
<comment userInput="Validate left edge of overlay" stepKey="commentValidateLeftEdgeOfOverlay"/>
78-
<executeJS function="return {{page.overlayJS('1')}}.getBoundingClientRect().left-{{page.wrapperJS('1')}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/>
81+
<executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().left-{{page.wrapperJS(index)}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/>
7982
<executeJS function="return Math.round(({$wrapperWidthMinusPadding25}/{$overlayLeftPosition})*100)/100" stepKey="overlayLeftRatio"/>
8083
<assertEquals stepKey="assertOverlayLeftRatio">
8184
<expectedResult type="int">1</expectedResult>
@@ -91,8 +94,8 @@
9194
</arguments>
9295
<!-- Validate top edge of overlay with padding -->
9396
<comment userInput="Validate top edge of overlay with padding" stepKey="commentValidateTopEdgeOfOverlayWithPadding"/>
94-
<executeJS function="return {{page.wrapperJS('1')}}.getBoundingClientRect().top" stepKey="wrapperTopPosition"/>
95-
<executeJS function="return {{page.overlayJS('1')}}.getBoundingClientRect().top-{{padding.value}}" stepKey="overlayTopPositionWithPadding"/>
97+
<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().top" stepKey="wrapperTopPosition"/>
98+
<executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().top-{{padding.paddingTop}}" stepKey="overlayTopPositionWithPadding"/>
9699
<executeJS function="return Math.round(({$overlayTopPositionWithPadding}/{$wrapperTopPosition})*100)/100" stepKey="overlayTopRatio"/>
97100
<assertEquals stepKey="assertOverlayTopRatio">
98101
<expectedResult type="int">1</expectedResult>
@@ -108,15 +111,15 @@
108111
<!-- Bottom edge validation is skipped until MC-4116 -->
109112
<!-- Validate bottom edge of overlay -->
110113
<!--<comment userInput="Validate bottom edge of overlay" stepKey="commentValidateBottomEdgeOfOverlay"/>-->
111-
<!--<executeJS function="return {{page.wrapperJS('1')}}.getBoundingClientRect().top+{{padding.value}}+120" stepKey="wrapperTopPaddingContent"/>-->
112-
<executeJS function="return {{page.overlayJS('1')}}.getBoundingClientRect().bottom" stepKey="overlayBottomPosition"/>
114+
<!--<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().top+{{padding.value}}+120" stepKey="wrapperTopPaddingContent"/>-->
115+
<executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().bottom" stepKey="overlayBottomPosition"/>
113116
<!--<assertEquals stepKey="assertOverlayBottomRatio">-->
114117
<!--<expectedResult type="variable">wrapperTopPaddingContent</expectedResult>-->
115118
<!--<actualResult type="variable">overlayBottomPosition</actualResult>-->
116119
<!--</assertEquals>-->
117120
<!-- Validate bottom edge of overlay is within parent -->
118121
<comment userInput="Validate bottom edge of overlay is within parent" stepKey="commentValidateBottomEdgeOfOverlayIsWithinParent"/>
119-
<executeJS function="return {{page.wrapperJS('1')}}.getBoundingClientRect().bottom" stepKey="wrapperBottomPosition"/>
122+
<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().bottom" stepKey="wrapperBottomPosition"/>
120123
<assertLessThanOrEqual stepKey="assertOverlayBottomIsWithinParent">
121124
<expectedResult type="variable">wrapperBottomPosition</expectedResult>
122125
<actualResult type="variable">overlayBottomPosition</actualResult>

0 commit comments

Comments
 (0)