|
14 | 14 | <argument name="index" defaultValue="1" type="string"/>
|
15 | 15 | <argument name="url" defaultValue=""/>
|
16 | 16 | <argument name="width" defaultValue=""/>
|
| 17 | + <!-- This is 2 because the width and the height may both have fractions that could round by a maximum of 1 for each which makes the maximum 2--> |
| 18 | + <argument name="acceptableOffset" defaultValue="2" type="string"/> |
17 | 19 | </arguments>
|
18 | 20 | <waitForPageLoad stepKey="waitForPageLoad"/>
|
19 | 21 | <waitForElementVisible selector="{{page.base(index)}}" stepKey="waitForElement"/>
|
|
24 | 26 | <executeJS function="return window.actualHeight = parseInt(getComputedStyle(document.evaluate("{{page.iframe(index)}}",document.body).iterateNext()).height)" stepKey="actualHeight"/>
|
25 | 27 | <executeJS function="return Math.abs(window.calculatedHeight - window.actualHeight)" stepKey="ratioDifference"/>
|
26 | 28 | <assertLessThanOrEqual stepKey="assertRatio">
|
27 |
| - <!-- This is 2 because the width and the height may both have fractions that could round by a maximum of 1 for each which makes the maximum 2--> |
28 |
| - <expectedResult type="int">2</expectedResult> |
| 29 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
29 | 30 | <actualResult type="variable">ratioDifference</actualResult>
|
30 | 31 | </assertLessThanOrEqual>
|
31 | 32 | </actionGroup>
|
|
34 | 35 | <argument name="page" defaultValue=""/>
|
35 | 36 | <argument name="index" defaultValue="1" type="string"/>
|
36 | 37 | <argument name="url" defaultValue=""/>
|
| 38 | + <!-- This is 2 because the width and the height may both have fractions that could round by a maximum of 1 for each which makes the maximum 2--> |
| 39 | + <argument name="acceptableOffset" defaultValue="2" type="string"/> |
37 | 40 | </arguments>
|
38 | 41 | <waitForElementVisible selector="{{page.base(index)}}" stepKey="waitForElement"/>
|
39 | 42 | <waitForElementVisible selector="{{page.source(index, url.renderedValue)}}" stepKey="waitForUrl"/>
|
|
43 | 46 | <executeJS function="return window.actualHeight = parseInt(getComputedStyle(document.evaluate("{{page.iframe(index)}}",document.body).iterateNext()).height)" stepKey="actualHeight"/>
|
44 | 47 | <executeJS function="return Math.abs(window.calculatedHeight - window.actualHeight)" stepKey="ratioDifference"/>
|
45 | 48 | <assertLessThanOrEqual stepKey="assertRatio">
|
46 |
| - <!-- This is 2 because the width and the height may both have fractions that could round by a maximum of 1 for each which makes the maximum 2--> |
47 |
| - <expectedResult type="int">2</expectedResult> |
| 49 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
48 | 50 | <actualResult type="variable">ratioDifference</actualResult>
|
49 | 51 | </assertLessThanOrEqual>
|
50 | 52 | </actionGroup>
|
|
0 commit comments