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