|
8 | 8 |
|
9 | 9 | <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
10 | 10 | xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
|
| 11 | + <!-- Poster Appearance --> |
| 12 | + <actionGroup name="validateOverlayPositionPoster"> |
| 13 | + <arguments> |
| 14 | + <argument name="page"/> |
| 15 | + <argument name="index" defaultValue="1" type="string"/> |
| 16 | + <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/> |
| 17 | + </arguments> |
| 18 | + <!-- Validate top edge of overlay --> |
| 19 | + <comment userInput="Validate top edge of overlay" stepKey="commentValidateTopEdgeOfOverlayWithPadding"/> |
| 20 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().top" stepKey="wrapperTopPosition"/> |
| 21 | + <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().top" stepKey="overlayTopPosition"/> |
| 22 | + <executeJS function="return Math.round(({$overlayTopPosition}/{$wrapperTopPosition})*100)/100" stepKey="overlayTopRatio"/> |
| 23 | + <assertEquals stepKey="assertOverlayTopRatio"> |
| 24 | + <expectedResult type="int">1</expectedResult> |
| 25 | + <actualResult type="variable">overlayTopRatio</actualResult> |
| 26 | + </assertEquals> |
| 27 | + <!-- Validate right edge of overlay --> |
| 28 | + <comment userInput="Validate right edge of overlay" stepKey="commentValidateRightEdgeOfOverlay"/> |
| 29 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().right" stepKey="wrapperRightPosition"/> |
| 30 | + <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/> |
| 31 | + <executeJS function="return Math.round(({$wrapperRightPosition}/{$overlayRightPosition})*100)/100" stepKey="overlayRightRatio"/> |
| 32 | + <assertEquals stepKey="assertOverlayRightRatio"> |
| 33 | + <expectedResult type="int">1</expectedResult> |
| 34 | + <actualResult type="variable">overlayRightRatio</actualResult> |
| 35 | + </assertEquals> |
| 36 | + <!-- Validate bottom edge of overlay --> |
| 37 | + <comment userInput="Validate bottom edge of overlay" stepKey="commentValidateBottomEdgeOfOverlay"/> |
| 38 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().bottom" stepKey="wrapperBottomPosition"/> |
| 39 | + <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().bottom" stepKey="overlayBottomPosition"/> |
| 40 | + <executeJS function="return Math.round(({$wrapperBottomPosition}/{$overlayBottomPosition})*100)/100" stepKey="overlayBottomRatio"/> |
| 41 | + <assertEquals stepKey="assertOverlayBottomRatio"> |
| 42 | + <expectedResult type="int">1</expectedResult> |
| 43 | + <actualResult type="variable">overlayBottomRatio</actualResult> |
| 44 | + </assertEquals> |
| 45 | + <!-- Validate left edge of overlay --> |
| 46 | + <comment userInput="Validate left edge of overlay" stepKey="commentValidateLeftEdgeOfOverlay"/> |
| 47 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().left" stepKey="wrapperLeftPosition"/> |
| 48 | + <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/> |
| 49 | + <executeJS function="return Math.round(({$wrapperLeftPosition}/{$overlayLeftPosition})*100)/100" stepKey="overlayLeftRatio"/> |
| 50 | + <assertEquals stepKey="assertOverlayLeftRatio"> |
| 51 | + <expectedResult type="int">1</expectedResult> |
| 52 | + <actualResult type="variable">overlayLeftRatio</actualResult> |
| 53 | + </assertEquals> |
| 54 | + </actionGroup> |
11 | 55 | <!-- Collage Appearances -->
|
12 | 56 | <!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values -->
|
13 | 57 | <actionGroup name="validateOverlayPositionCollageLeft">
|
|
108 | 152 | <argument name="index" defaultValue="1" type="string"/>
|
109 | 153 | <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/>
|
110 | 154 | </arguments>
|
111 |
| - <!-- Bottom edge validation is skipped until MC-4116 --> |
112 | 155 | <!-- Validate bottom edge of overlay -->
|
113 |
| - <!--<comment userInput="Validate bottom edge of overlay" stepKey="commentValidateBottomEdgeOfOverlay"/>--> |
114 |
| - <!--<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().top+{{padding.paddingTop}}+120" stepKey="wrapperTopPaddingContent"/>--> |
| 156 | + <comment userInput="Validate bottom edge of overlay" stepKey="commentValidateBottomEdgeOfOverlay"/> |
| 157 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().top+{{padding.paddingTop}}+120" stepKey="wrapperTopPaddingContent"/> |
115 | 158 | <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().bottom" stepKey="overlayBottomPosition"/>
|
116 |
| - <!--<assertEquals stepKey="assertOverlayBottomRatio">--> |
117 |
| - <!--<expectedResult type="variable">wrapperTopPaddingContent</expectedResult>--> |
118 |
| - <!--<actualResult type="variable">overlayBottomPosition</actualResult>--> |
119 |
| - <!--</assertEquals>--> |
| 159 | + <executeJS function="return Math.round(({$wrapperTopPaddingContent}/{$overlayBottomPosition})*100)/100" stepKey="overlayBottomRatio"/> |
| 160 | + <assertEquals stepKey="assertOverlayBottomRatio"> |
| 161 | + <expectedResult type="int">1</expectedResult> |
| 162 | + <actualResult type="variable">overlayBottomRatio</actualResult> |
| 163 | + </assertEquals> |
120 | 164 | <!-- Validate bottom edge of overlay is within parent -->
|
121 | 165 | <comment userInput="Validate bottom edge of overlay is within parent" stepKey="commentValidateBottomEdgeOfOverlayIsWithinParent"/>
|
122 |
| - <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().bottom" stepKey="wrapperBottomPosition"/> |
| 166 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().bottom-{{padding.paddingBottom}}" stepKey="wrapperBottomPositionNoPadding"/> |
123 | 167 | <assertLessThanOrEqual stepKey="assertOverlayBottomIsWithinParent">
|
124 |
| - <expectedResult type="variable">wrapperBottomPosition</expectedResult> |
| 168 | + <expectedResult type="variable">wrapperBottomPositionNoPadding</expectedResult> |
125 | 169 | <actualResult type="variable">overlayBottomPosition</actualResult>
|
126 | 170 | </assertLessThanOrEqual>
|
127 | 171 | </actionGroup>
|
|
0 commit comments