|
| 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 | + <!-- Element Position --> |
| 12 | + <actionGroup name="validatePositionRightWithinContainer"> |
| 13 | + <arguments> |
| 14 | + <argument name="content" type="string"/> |
| 15 | + <argument name="contentMargins" defaultValue="PageBuilderMarginsPropertyDefault"/> |
| 16 | + <argument name="container" type="string"/> |
| 17 | + <argument name="containerBorder" defaultValue="PageBuilderAdvancedBorderWidthProperty0"/> |
| 18 | + <argument name="containerPadding" defaultValue="PageBuilderPaddingPropertyDefault"/> |
| 19 | + <argument name="index" defaultValue="1" type="string"/> |
| 20 | + <argument name="pixelBuffer" defaultValue="5" type="string"/> |
| 21 | + </arguments> |
| 22 | + <!-- Validate right edge of content is within parent --> |
| 23 | + <comment userInput="Validate right edge of content is within parent" stepKey="commentValidateRightEdgeOfContentIsWithinParent"/> |
| 24 | + <executeJS function="return document.querySelectorAll('{{content}}')[{{index}}-1].getBoundingClientRect().right+{{contentMargins.marginRight}}" stepKey="contentRightPosition"/> |
| 25 | + <executeJS function="return document.querySelectorAll('{{container}}')[{{index}}-1].getBoundingClientRect().right-{{containerPadding.paddingRight}}-{{containerBorder.value}}" stepKey="parentRightPosition"/> |
| 26 | + <executeJS function="return Math.round({$parentRightPosition}-{$contentRightPosition})" stepKey="rightPositionDifference"/> |
| 27 | + <assertLessThanOrEqual stepKey="assertRightPositionDifference"> |
| 28 | + <expectedResult type="int">{{pixelBuffer}}</expectedResult> |
| 29 | + <actualResult type="variable">rightPositionDifference</actualResult> |
| 30 | + </assertLessThanOrEqual> |
| 31 | + <assertGreaterThanOrEqual stepKey="assertRightPositionIsGreaterThanZero"> |
| 32 | + <expectedResult type="int">0</expectedResult> |
| 33 | + <actualResult type="variable">rightPositionDifference</actualResult> |
| 34 | + </assertGreaterThanOrEqual> |
| 35 | + </actionGroup> |
| 36 | + <!-- Element Size --> |
| 37 | + <actionGroup name="validateContentWidthEqualToContainerWidth"> |
| 38 | + <arguments> |
| 39 | + <argument name="content" type="string"/> |
| 40 | + <argument name="contentIndex" defaultValue="1" type="string"/> |
| 41 | + <argument name="contentMargins" defaultValue="PageBuilderMarginsPropertyDefault"/> |
| 42 | + <argument name="container" type="string"/> |
| 43 | + <argument name="containerBorder" defaultValue="PageBuilderAdvancedBorderWidthProperty0"/> |
| 44 | + <argument name="containerIndex" defaultValue="1" type="string"/> |
| 45 | + <argument name="containerPadding" defaultValue="PageBuilderPaddingPropertyDefault"/> |
| 46 | + <argument name="pixelBuffer" defaultValue="5" type="string"/> |
| 47 | + </arguments> |
| 48 | + <!-- Validate width of content and width of container are equal --> |
| 49 | + <comment userInput="Validate width of content and width of container are equal" stepKey="commentValidateWidthOfContentAndWidthOfContainerAreEqual"/> |
| 50 | + <executeJS function="return document.querySelectorAll('{{content}}')[{{contentIndex}}-1].getBoundingClientRect().width+{{contentMargins.marginLeft}}+{{contentMargins.marginRight}}" stepKey="contentWidth"/> |
| 51 | + <executeJS function="return document.querySelectorAll('{{container}}')[{{containerIndex}}-1].getBoundingClientRect().width-{{containerPadding.paddingLeft}}-{{containerPadding.paddingRight}}-({{containerBorder.value}}*2)" stepKey="parentWidth"/> |
| 52 | + <executeJS function="return Math.round(Math.abs({$contentWidth}-{$parentWidth}))" stepKey="widthDifference"/> |
| 53 | + <assertLessThanOrEqual stepKey="assertWidthDifference"> |
| 54 | + <expectedResult type="int">{{pixelBuffer}}</expectedResult> |
| 55 | + <actualResult type="variable">widthDifference</actualResult> |
| 56 | + </assertLessThanOrEqual> |
| 57 | + </actionGroup> |
| 58 | +</actionGroups> |
0 commit comments