|
13 | 13 | <arguments>
|
14 | 14 | <argument name="page"/>
|
15 | 15 | <argument name="index" defaultValue="1" type="string"/>
|
16 |
| - <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/> |
| 16 | + <argument name="padding" defaultValue="PageBuilderPaddingPropertyDefault"/> |
| 17 | + <argument name="acceptableOffset" defaultValue="2" type="string"/> |
17 | 18 | </arguments>
|
18 | 19 | <!-- Validate top edge of overlay -->
|
19 | 20 | <comment userInput="Validate top edge of overlay" stepKey="commentValidateTopEdgeOfOverlayWithPadding"/>
|
20 | 21 | <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> |
| 22 | + <executeJS function="return Math.round({{page.overlayJS(index)}}.getBoundingClientRect().top - {{padding.paddingTop}})" stepKey="overlayTopPosition"/> |
| 23 | + <executeJS function="return Math.abs({$overlayTopPosition} - {$wrapperTopPosition})" stepKey="overlayTopDifference"/> |
| 24 | + <assertLessThanOrEqual stepKey="assertOverlayTopAcceptable"> |
| 25 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 26 | + <actualResult type="variable">overlayTopDifference</actualResult> |
| 27 | + </assertLessThanOrEqual> |
27 | 28 | <!-- Validate right edge of overlay -->
|
28 | 29 | <comment userInput="Validate right edge of overlay" stepKey="commentValidateRightEdgeOfOverlay"/>
|
29 |
| - <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().right" stepKey="wrapperRightPosition"/> |
| 30 | + <executeJS function="return Math.round({{page.wrapperJS(index)}}.getBoundingClientRect().right - {{padding.paddingRight}})" stepKey="wrapperRightPosition"/> |
30 | 31 | <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> |
| 32 | + <executeJS function="return Math.abs({$wrapperRightPosition} - {$overlayRightPosition})" stepKey="overlayRightDifference"/> |
| 33 | + <assertLessThanOrEqual stepKey="assertOverlayRightAcceptable"> |
| 34 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 35 | + <actualResult type="variable">overlayRightDifference</actualResult> |
| 36 | + </assertLessThanOrEqual> |
36 | 37 | <!-- Validate bottom edge of overlay -->
|
37 | 38 | <comment userInput="Validate bottom edge of overlay" stepKey="commentValidateBottomEdgeOfOverlay"/>
|
38 |
| - <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().bottom" stepKey="wrapperBottomPosition"/> |
| 39 | + <executeJS function="return Math.round({{page.wrapperJS(index)}}.getBoundingClientRect().bottom - {{padding.paddingBottom}})" stepKey="wrapperBottomPosition"/> |
39 | 40 | <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> |
| 41 | + <executeJS function="return Math.abs({$wrapperBottomPosition} - {$overlayBottomPosition})" stepKey="overlayBottomDifference"/> |
| 42 | + <assertLessThanOrEqual stepKey="assertOverlayBottomAcceptable"> |
| 43 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 44 | + <actualResult type="variable">overlayBottomDifference</actualResult> |
| 45 | + </assertLessThanOrEqual> |
45 | 46 | <!-- Validate left edge of overlay -->
|
46 | 47 | <comment userInput="Validate left edge of overlay" stepKey="commentValidateLeftEdgeOfOverlay"/>
|
47 | 48 | <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> |
| 49 | + <executeJS function="return Math.round({{page.overlayJS(index)}}.getBoundingClientRect().left - {{padding.paddingLeft}})" stepKey="overlayLeftPosition"/> |
| 50 | + <executeJS function="return Math.abs({$overlayLeftPosition} - {$wrapperLeftPosition})" stepKey="overlayLeftDifference"/> |
| 51 | + <assertLessThanOrEqual stepKey="assertOverlayLeftAcceptable"> |
| 52 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 53 | + <actualResult type="variable">overlayLeftDifference</actualResult> |
| 54 | + </assertLessThanOrEqual> |
54 | 55 | </actionGroup>
|
55 | 56 | <!-- Collage Appearances -->
|
56 | 57 | <!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values -->
|
|
60 | 61 | <argument name="index" defaultValue="1" type="string"/>
|
61 | 62 | <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/>
|
62 | 63 | <argument name="expectedOverlayWidth" defaultValue="540" type="string"/>
|
| 64 | + <argument name="acceptableOffset" defaultValue="2" type="string"/> |
63 | 65 | </arguments>
|
64 | 66 | <!-- Validate width of overlay -->
|
65 | 67 | <comment userInput="Validate width of overlay" stepKey="commentValidateWidthOfOverlay"/>
|
66 | 68 | <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().width" stepKey="overlayWidth"/>
|
67 |
| - <assertEquals stepKey="assertOverlayWidth"> |
68 |
| - <expectedResult type="string">{{expectedOverlayWidth}}</expectedResult> |
69 |
| - <actualResult type="variable">overlayWidth</actualResult> |
70 |
| - </assertEquals> |
| 69 | + <executeJS function="return Math.abs({$overlayWidth} - {{expectedOverlayWidth}})" stepKey="widthDifference"/> |
| 70 | + <assertLessThanOrEqual stepKey="assertOverlayWidthIsAcceptable"> |
| 71 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 72 | + <actualResult type="variable">widthDifference</actualResult> |
| 73 | + </assertLessThanOrEqual> |
71 | 74 | <!-- Validate left edge of overlay -->
|
72 | 75 | <comment userInput="Validate left edge of overlay" stepKey="commentValidateLeftEdgeOfOverlay"/>
|
73 | 76 | <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().left" stepKey="wrapperLeftPosition"/>
|
74 |
| - <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().left" stepKey="overlayLeftPosition"/> |
75 |
| - <executeJS function="return Math.round(({$overlayLeftPosition}-{$wrapperLeftPosition})*100)/100" stepKey="overlayPadding"/> |
76 |
| - <assertEquals stepKey="assertOverlayIsEqualToPadding"> |
77 |
| - <expectedResult type="int">{{padding.paddingLeft}}</expectedResult> |
78 |
| - <actualResult type="variable">overlayPadding</actualResult> |
79 |
| - </assertEquals> |
| 77 | + <executeJS function="return Math.round({{page.overlayJS(index)}}.getBoundingClientRect().left - {{padding.paddingLeft}})" stepKey="overlayLeftPosition"/> |
| 78 | + <executeJS function="return Math.abs({$overlayLeftPosition} - {$wrapperLeftPosition})" stepKey="overlayMinusWrapper"/> |
| 79 | + <assertLessThanOrEqual stepKey="assertOverlayLeftIsAcceptable"> |
| 80 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 81 | + <actualResult type="variable">overlayMinusWrapper</actualResult> |
| 82 | + </assertLessThanOrEqual> |
80 | 83 | </actionGroup>
|
81 | 84 | <!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values -->
|
82 | 85 | <actionGroup name="validateOverlayPositionCollageRight">
|
|
85 | 88 | <argument name="index" defaultValue="1" type="string"/>
|
86 | 89 | <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/>
|
87 | 90 | <argument name="expectedOverlayWidth" defaultValue="540" type="string"/>
|
| 91 | + <argument name="acceptableOffset" defaultValue="2" type="string"/> |
88 | 92 | </arguments>
|
89 |
| - <!-- Validate right edge of overlay --> |
90 |
| - <comment userInput="Validate right edge of overlay" stepKey="commentValidateRightEdgeOfOverlay"/> |
91 |
| - <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().right" stepKey="wrapperRightPosition"/> |
92 |
| - <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/> |
93 |
| - <executeJS function="return Math.round(({$wrapperRightPosition}-{$overlayRightPosition})*100)/100" stepKey="overlayPadding"/> |
94 |
| - <assertEquals stepKey="assertOverlayIsEqualToPadding"> |
95 |
| - <expectedResult type="int">{{padding.paddingRight}}</expectedResult> |
96 |
| - <actualResult type="variable">overlayPadding</actualResult> |
97 |
| - </assertEquals> |
98 | 93 | <!-- Validate width of overlay -->
|
99 | 94 | <comment userInput="Validate width of overlay" stepKey="commentValidateWidthOfOverlay"/>
|
100 | 95 | <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().width" stepKey="overlayWidth"/>
|
101 |
| - <assertEquals stepKey="assertOverlayWidth"> |
102 |
| - <expectedResult type="string">{{expectedOverlayWidth}}</expectedResult> |
103 |
| - <actualResult type="variable">overlayWidth</actualResult> |
104 |
| - </assertEquals> |
| 96 | + <executeJS function="return Math.abs({$overlayWidth} - {{expectedOverlayWidth}})" stepKey="widthDifference"/> |
| 97 | + <assertLessThanOrEqual stepKey="assertOverlayWidthIsAcceptable"> |
| 98 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 99 | + <actualResult type="variable">widthDifference</actualResult> |
| 100 | + </assertLessThanOrEqual> |
| 101 | + <!-- Validate right edge of overlay --> |
| 102 | + <comment userInput="Validate right edge of overlay" stepKey="commentValidateRightEdgeOfOverlay"/> |
| 103 | + <executeJS function="return Math.round({{page.wrapperJS(index)}}.getBoundingClientRect().right - {{padding.paddingRight}})" stepKey="wrapperRightPosition"/> |
| 104 | + <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/> |
| 105 | + <executeJS function="return Math.abs({$wrapperRightPosition} - {$overlayRightPosition})" stepKey="overlayMinusWrapper"/> |
| 106 | + <assertLessThanOrEqual stepKey="assertOverlayRightIsAcceptable"> |
| 107 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 108 | + <actualResult type="variable">overlayMinusWrapper</actualResult> |
| 109 | + </assertLessThanOrEqual> |
105 | 110 | </actionGroup>
|
106 | 111 | <!-- Checks the position of the overlay with small padding value. This action group may not work with large padding values -->
|
107 | 112 | <actionGroup name="validateOverlayPositionCollageCenter">
|
108 | 113 | <arguments>
|
109 | 114 | <argument name="page"/>
|
110 | 115 | <argument name="index" defaultValue="1" type="string"/>
|
111 |
| - <argument name="padding" defaultValue="PageBuilderPaddingProperty40"/> |
112 | 116 | <argument name="expectedOverlayWidth" defaultValue="540" type="string"/>
|
| 117 | + <argument name="acceptableOffset" defaultValue="2" type="string"/> |
113 | 118 | </arguments>
|
114 | 119 | <!-- Validate width of overlay -->
|
115 | 120 | <comment userInput="Validate width of overlay" stepKey="commentValidateWidthOfOverlay"/>
|
116 | 121 | <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().width" stepKey="overlayWidth"/>
|
117 |
| - <assertEquals stepKey="assertOverlayWidth"> |
118 |
| - <expectedResult type="string">{{expectedOverlayWidth}}</expectedResult> |
119 |
| - <actualResult type="variable">overlayWidth</actualResult> |
120 |
| - </assertEquals> |
| 122 | + <executeJS function="return Math.abs({$overlayWidth} - {{expectedOverlayWidth}})" stepKey="widthDifference"/> |
| 123 | + <assertLessThanOrEqual stepKey="assertOverlayWidthIsAcceptable"> |
| 124 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 125 | + <actualResult type="variable">widthDifference</actualResult> |
| 126 | + </assertLessThanOrEqual> |
121 | 127 | <!-- Validate center position of overlay -->
|
122 | 128 | <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().right" stepKey="wrapperRightPosition"/>
|
123 | 129 | <executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().width" stepKey="wrapperWidth"/>
|
124 |
| - <executeJS function="return Math.round(({$wrapperRightPosition}-({$wrapperWidth}/2))*100)/100" stepKey="wrapperCenterPosition"/> |
| 130 | + <executeJS function="return Math.round({$wrapperRightPosition} - ({$wrapperWidth} / 2))" stepKey="wrapperCenterPosition"/> |
125 | 131 | <executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/>
|
126 |
| - <executeJS function="return Math.round(({$overlayRightPosition}-({$overlayWidth}/2))*100)/100" stepKey="overlayCenterPosition"/> |
127 |
| - <executeJS function="return Math.round(({$wrapperCenterPosition}/{$overlayCenterPosition})*100)/100" stepKey="overlayCenterRatio"/> |
128 |
| - <assertGreaterThanOrEqual stepKey="assertOverlayCenterRatio"> |
129 |
| - <expectedResult type="int">1</expectedResult> |
130 |
| - <actualResult type="variable">overlayCenterRatio</actualResult> |
131 |
| - </assertGreaterThanOrEqual> |
| 132 | + <executeJS function="return Math.round({$overlayRightPosition} - ({$overlayWidth} / 2))" stepKey="overlayCenterPosition"/> |
| 133 | + <executeJS function="return Math.abs({$wrapperCenterPosition} - {$overlayCenterPosition})" stepKey="overlayCenterDifference"/> |
| 134 | + <assertLessThanOrEqual stepKey="assertOverlayCenterAcceptable"> |
| 135 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 136 | + <actualResult type="variable">overlayCenterDifference</actualResult> |
| 137 | + </assertLessThanOrEqual> |
132 | 138 | </actionGroup>
|
133 | 139 | <!-- Overlay Position -->
|
134 | 140 | <actionGroup name="validateOverlayPositionTop">
|
|
0 commit comments