|
429 | 429 | <argument name="page" defaultValue="ProductsCarouselOnStage"/>
|
430 | 430 | <argument name="productGroupIndex" defaultValue="1" type="string"/>
|
431 | 431 | <argument name="centerProductIndex" defaultValue="3" type="string"/>
|
| 432 | + <argument name="acceptableOffset" defaultValue="2" type="string"/> |
432 | 433 | </arguments>
|
433 | 434 | <executeJS function="return document.evaluate("{{page.productInCarouselNotClonedBySlickByIndex(productGroupIndex, centerProductIndex)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getBoundingClientRect().right" stepKey="rightPositionOfMiddleProduct"/>
|
434 | 435 | <executeJS function="return document.evaluate("{{page.productInCarouselNotClonedBySlickByIndex(productGroupIndex, centerProductIndex)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getBoundingClientRect().width" stepKey="widthOfMiddleProduct"/>
|
435 | 436 | <executeJS function="return Math.abs({$rightPositionOfMiddleProduct} - ({$widthOfMiddleProduct} / 2))" stepKey="centerPositionOfMiddleProduct"/>
|
436 | 437 | <executeJS function="return document.evaluate("{{page.base(productGroupIndex)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getBoundingClientRect().right" stepKey="rightPositionOfProductGroup"/>
|
437 | 438 | <executeJS function="return document.evaluate("{{page.base(productGroupIndex)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getBoundingClientRect().width" stepKey="widthOfProductGroup"/>
|
438 | 439 | <executeJS function="return Math.abs({$rightPositionOfProductGroup} - ({$widthOfProductGroup} / 2))" stepKey="centerPositionOfProductGroup"/>
|
439 |
| - <assertEquals stepKey="assertProductsAreCentered"> |
440 |
| - <expectedResult type="variable">centerPositionOfProductGroup</expectedResult> |
441 |
| - <actualResult type="variable">centerPositionOfMiddleProduct</actualResult> |
442 |
| - </assertEquals> |
| 440 | + <executeJS function="return Math.abs({$centerPositionOfProductGroup} - {$centerPositionOfMiddleProduct})" stepKey="differenceBetweenCenterPositions"/> |
| 441 | + <assertLessThanOrEqual stepKey="assertCenterPositionAcceptable"> |
| 442 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 443 | + <actualResult type="variable">differenceBetweenCenterPositions</actualResult> |
| 444 | + </assertLessThanOrEqual> |
443 | 445 | </actionGroup>
|
444 | 446 | <actionGroup name="validateProductsInProductCarouselAreCenteredForEvenNumberOfProducts">
|
445 | 447 | <arguments>
|
446 | 448 | <argument name="page" defaultValue="ProductsCarouselOnStage"/>
|
447 | 449 | <argument name="productGroupIndex" defaultValue="1" type="string"/>
|
448 | 450 | <argument name="adjacentLeftOfCenterProductIndex" defaultValue="1" type="string"/>
|
| 451 | + <argument name="acceptableOffset" defaultValue="2" type="string"/> |
449 | 452 | </arguments>
|
450 | 453 | <executeJS function="return document.evaluate("{{page.productInCarouselNotClonedBySlickByIndex(productGroupIndex, adjacentLeftOfCenterProductIndex)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getBoundingClientRect().right" stepKey="rightPositionOfAdjacentLeftOfCenterProduct"/>
|
451 | 454 | <executeJS function="return document.evaluate("{{page.base(productGroupIndex)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getBoundingClientRect().right" stepKey="rightPositionOfProductGroup"/>
|
452 | 455 | <executeJS function="return document.evaluate("{{page.base(productGroupIndex)}}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.getBoundingClientRect().width" stepKey="widthOfProductGroup"/>
|
453 | 456 | <executeJS function="return Math.abs({$rightPositionOfProductGroup} - ({$widthOfProductGroup} / 2))" stepKey="centerPositionOfProductGroup"/>
|
454 |
| - <assertEquals stepKey="assertProductsAreCentered"> |
455 |
| - <expectedResult type="variable">centerPositionOfProductGroup</expectedResult> |
456 |
| - <actualResult type="variable">rightPositionOfAdjacentLeftOfCenterProduct</actualResult> |
457 |
| - </assertEquals> |
| 457 | + <executeJS function="return Math.abs({$centerPositionOfProductGroup} - {$rightPositionOfAdjacentLeftOfCenterProduct})" stepKey="differenceBetweenCenterPositions"/> |
| 458 | + <assertLessThanOrEqual stepKey="assertCenterPositionAcceptable"> |
| 459 | + <expectedResult type="int">{{acceptableOffset}}</expectedResult> |
| 460 | + <actualResult type="variable">differenceBetweenCenterPositions</actualResult> |
| 461 | + </assertLessThanOrEqual> |
458 | 462 | </actionGroup>
|
459 | 463 | </actionGroups>
|
0 commit comments