|
| 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 | + |
| 9 | +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> |
| 11 | + <!-- Collage Appearances --> |
| 12 | + <!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values --> |
| 13 | + <actionGroup name="validateOverlayPositionCollageLeft"> |
| 14 | + <arguments> |
| 15 | + <argument name="page"/> |
| 16 | + <argument name="index" defaultValue="1" type="string"/> |
| 17 | + <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/> |
| 18 | + </arguments> |
| 19 | + <!-- Validate right edge of overlay --> |
| 20 | + <comment userInput="Validate right edge of overlay" stepKey="commentValidateRightEdgeOfOverlay"/> |
| 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"/> |
| 23 | + <executeJS function="return Math.round(({$wrapperRightPositionMinusWidth50Percent}/{$overlayRightPosition})*100)/100" stepKey="overlayRightRatio"/> |
| 24 | + <assertEquals stepKey="assertOverlayRightRatio"> |
| 25 | + <expectedResult type="int">1</expectedResult> |
| 26 | + <actualResult type="variable">overlayRightRatio</actualResult> |
| 27 | + </assertEquals> |
| 28 | + <!-- Validate left edge of overlay --> |
| 29 | + <comment userInput="Validate left edge of overlay" stepKey="commentValidateLeftEdgeOfOverlay"/> |
| 30 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().left" stepKey="wrapperLeftPosition"/> |
| 31 | + <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/> |
| 32 | + <executeJS function="return Math.round(({$overlayLeftPosition}-{$wrapperLeftPosition})*100)/100" stepKey="overlayPadding"/> |
| 33 | + <assertEquals stepKey="assertOverlayIsEqualToPadding"> |
| 34 | + <expectedResult type="int">{{padding.paddingLeft}}</expectedResult> |
| 35 | + <actualResult type="variable">overlayPadding</actualResult> |
| 36 | + </assertEquals> |
| 37 | + </actionGroup> |
| 38 | + <!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values --> |
| 39 | + <actionGroup name="validateOverlayPositionCollageRight"> |
| 40 | + <arguments> |
| 41 | + <argument name="page"/> |
| 42 | + <argument name="index" defaultValue="1" type="string"/> |
| 43 | + <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/> |
| 44 | + </arguments> |
| 45 | + <!-- Validate right edge of overlay --> |
| 46 | + <comment userInput="Validate right edge of overlay" stepKey="commentValidateRightEdgeOfOverlay"/> |
| 47 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().right" stepKey="wrapperRightPosition"/> |
| 48 | + <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/> |
| 49 | + <executeJS function="return Math.round(({$wrapperRightPosition}-{$overlayRightPosition})*100)/100" stepKey="overlayPadding"/> |
| 50 | + <assertEquals stepKey="assertOverlayIsEqualToPadding"> |
| 51 | + <expectedResult type="int">{{padding.paddingRight}}</expectedResult> |
| 52 | + <actualResult type="variable">overlayPadding</actualResult> |
| 53 | + </assertEquals> |
| 54 | + <!-- Validate left edge of overlay --> |
| 55 | + <comment userInput="Validate left edge of overlay" stepKey="commentValidateLeftEdgeOfOverlay"/> |
| 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"/> |
| 58 | + <executeJS function="return Math.round(({$wrapperRightMinusWidthHalf}/{$overlayLeftPosition})*100)/100" stepKey="overlayLeftRatio"/> |
| 59 | + <assertEquals stepKey="assertOverlayLeftRatio"> |
| 60 | + <expectedResult type="int">1</expectedResult> |
| 61 | + <actualResult type="variable">overlayLeftRatio</actualResult> |
| 62 | + </assertEquals> |
| 63 | + </actionGroup> |
| 64 | + <!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values --> |
| 65 | + <actionGroup name="validateOverlayPositionCollageCenter"> |
| 66 | + <arguments> |
| 67 | + <argument name="page"/> |
| 68 | + <argument name="index" defaultValue="1" type="string"/> |
| 69 | + <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/> |
| 70 | + </arguments> |
| 71 | + <!-- Validate right edge of overlay --> |
| 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"/> |
| 74 | + <executeJS function="return Math.round(({$wrapperWidthMinusPadding25}/{$overlayRightPosition})*100)/100" stepKey="overlayRightRatio"/> |
| 75 | + <assertEquals stepKey="assertOverlayRightRatio"> |
| 76 | + <expectedResult type="int">1</expectedResult> |
| 77 | + <actualResult type="variable">overlayRightRatio</actualResult> |
| 78 | + </assertEquals> |
| 79 | + <!-- Validate left edge of overlay --> |
| 80 | + <comment userInput="Validate left edge of overlay" stepKey="commentValidateLeftEdgeOfOverlay"/> |
| 81 | + <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().left-{{page.wrapperJS(index)}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/> |
| 82 | + <executeJS function="return Math.round(({$wrapperWidthMinusPadding25}/{$overlayLeftPosition})*100)/100" stepKey="overlayLeftRatio"/> |
| 83 | + <assertEquals stepKey="assertOverlayLeftRatio"> |
| 84 | + <expectedResult type="int">1</expectedResult> |
| 85 | + <actualResult type="variable">overlayLeftRatio</actualResult> |
| 86 | + </assertEquals> |
| 87 | + </actionGroup> |
| 88 | + <!-- Overlay Position --> |
| 89 | + <actionGroup name="validateOverlayPositionTop"> |
| 90 | + <arguments> |
| 91 | + <argument name="page"/> |
| 92 | + <argument name="index" defaultValue="1" type="string"/> |
| 93 | + <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/> |
| 94 | + </arguments> |
| 95 | + <!-- Validate top edge of overlay with padding --> |
| 96 | + <comment userInput="Validate top edge of overlay with padding" stepKey="commentValidateTopEdgeOfOverlayWithPadding"/> |
| 97 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().top" stepKey="wrapperTopPosition"/> |
| 98 | + <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().top-{{padding.paddingTop}}" stepKey="overlayTopPositionWithPadding"/> |
| 99 | + <executeJS function="return Math.round(({$overlayTopPositionWithPadding}/{$wrapperTopPosition})*100)/100" stepKey="overlayTopRatio"/> |
| 100 | + <assertEquals stepKey="assertOverlayTopRatio"> |
| 101 | + <expectedResult type="int">1</expectedResult> |
| 102 | + <actualResult type="variable">overlayTopRatio</actualResult> |
| 103 | + </assertEquals> |
| 104 | + </actionGroup> |
| 105 | + <actionGroup name="validateOverlayPositionBottom"> |
| 106 | + <arguments> |
| 107 | + <argument name="page"/> |
| 108 | + <argument name="index" defaultValue="1" type="string"/> |
| 109 | + <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/> |
| 110 | + </arguments> |
| 111 | + <!-- Bottom edge validation is skipped until MC-4116 --> |
| 112 | + <!-- 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"/>--> |
| 115 | + <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>--> |
| 120 | + <!-- Validate bottom edge of overlay is within parent --> |
| 121 | + <comment userInput="Validate bottom edge of overlay is within parent" stepKey="commentValidateBottomEdgeOfOverlayIsWithinParent"/> |
| 122 | + <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().bottom" stepKey="wrapperBottomPosition"/> |
| 123 | + <assertLessThanOrEqual stepKey="assertOverlayBottomIsWithinParent"> |
| 124 | + <expectedResult type="variable">wrapperBottomPosition</expectedResult> |
| 125 | + <actualResult type="variable">overlayBottomPosition</actualResult> |
| 126 | + </assertLessThanOrEqual> |
| 127 | + </actionGroup> |
| 128 | +</actionGroups> |
0 commit comments