|
| 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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> |
| 11 | + <actionGroup name="validateBackgroundAttributesWithNoImageOrColor"> |
| 12 | + <arguments> |
| 13 | + <argument name="section"/> |
| 14 | + <argument name="backgroundPosition" defaultValue="PageBuilderBackgroundPosition_Default"/> |
| 15 | + <argument name="backgroundSize" defaultValue="PageBuilderBackgroundSize_Default"/> |
| 16 | + <argument name="backgroundRepeat" defaultValue="PageBuilderBackgroundRepeat_Default"/> |
| 17 | + <argument name="backgroundAttachment" defaultValue="PageBuilderBackgroundAttachment_Default"/> |
| 18 | + <argument name="index" defaultValue="1" type="string"/> |
| 19 | + </arguments> |
| 20 | + <comment userInput="validateBackgroundAttributesWithNoImageOrColor" stepKey="comment"/> |
| 21 | + <waitForElementVisible selector="{{section.base(index)}}" stepKey="waitForBaseElement"/> |
| 22 | + <waitForElementVisible selector="{{section.noBackgroundColor(index)}}" stepKey="waitForBackgroundColor"/> |
| 23 | + <waitForElementVisible selector="{{section.noBackgroundImage(index)}}" stepKey="waitForBackgroundImage"/> |
| 24 | + <waitForElementVisible selector="{{section.backgroundPosition(index, backgroundPosition.styleValue)}}" stepKey="waitForBackgroundPosition"/> |
| 25 | + <waitForElementVisible selector="{{section.backgroundSize(index, backgroundSize.value)}}" stepKey="waitForBackgroundSize"/> |
| 26 | + <waitForElementVisible selector="{{section.backgroundRepeat(index, backgroundRepeat.styleValue)}}" stepKey="waitForBackgroundRepeat"/> |
| 27 | + <waitForElementVisible selector="{{section.backgroundAttachment(index, backgroundAttachment.value)}}" stepKey="waitForBackgroundAttachment"/> |
| 28 | + </actionGroup> |
| 29 | + <actionGroup name="validateBackgroundAttributesWithNoColor"> |
| 30 | + <arguments> |
| 31 | + <argument name="section"/> |
| 32 | + <argument name="backgroundImage"/> |
| 33 | + <argument name="backgroundPosition" defaultValue="PageBuilderBackgroundPosition_Default"/> |
| 34 | + <argument name="backgroundSize" defaultValue="PageBuilderBackgroundSize_Default"/> |
| 35 | + <argument name="backgroundRepeat" defaultValue="PageBuilderBackgroundRepeat_Default"/> |
| 36 | + <argument name="backgroundAttachment" defaultValue="PageBuilderBackgroundAttachment_Default"/> |
| 37 | + <argument name="index" defaultValue="1" type="string"/> |
| 38 | + </arguments> |
| 39 | + <comment userInput="validateBackgroundAttributesWithNoColor" stepKey="comment"/> |
| 40 | + <waitForElementVisible selector="{{section.base(index)}}" stepKey="waitForBaseElement"/> |
| 41 | + <waitForElementVisible selector="{{section.noBackgroundColor(index)}}" stepKey="waitForBackgroundColor"/> |
| 42 | + <waitForElementVisible selector="{{section.backgroundImage(index, backgroundImage.fileName)}}" stepKey="waitForBackgroundImage"/> |
| 43 | + <waitForElementVisible selector="{{section.backgroundPosition(index, backgroundPosition.styleValue)}}" stepKey="waitForBackgroundPosition"/> |
| 44 | + <waitForElementVisible selector="{{section.backgroundSize(index, backgroundSize.value)}}" stepKey="waitForBackgroundSize"/> |
| 45 | + <waitForElementVisible selector="{{section.backgroundRepeat(index, backgroundRepeat.styleValue)}}" stepKey="waitForBackgroundRepeat"/> |
| 46 | + <waitForElementVisible selector="{{section.backgroundAttachment(index, backgroundAttachment.value)}}" stepKey="waitForBackgroundAttachment"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup name="validateBackgroundAttributesWithNoImage"> |
| 49 | + <arguments> |
| 50 | + <argument name="section"/> |
| 51 | + <argument name="backgroundColor"/> |
| 52 | + <argument name="backgroundPosition" defaultValue="PageBuilderBackgroundPosition_Default"/> |
| 53 | + <argument name="backgroundSize" defaultValue="PageBuilderBackgroundSize_Default"/> |
| 54 | + <argument name="backgroundRepeat" defaultValue="PageBuilderBackgroundRepeat_Default"/> |
| 55 | + <argument name="backgroundAttachment" defaultValue="PageBuilderBackgroundAttachment_Default"/> |
| 56 | + <argument name="index" defaultValue="1" type="string"/> |
| 57 | + </arguments> |
| 58 | + <comment userInput="validateBackgroundAttributesWithNoImage" stepKey="comment"/> |
| 59 | + <waitForElementVisible selector="{{section.base(index)}}" stepKey="waitForBaseElement"/> |
| 60 | + <waitForElementVisible selector="{{section.backgroundColor(index, backgroundColor.rgb)}}" stepKey="waitForBackgroundColor"/> |
| 61 | + <waitForElementVisible selector="{{section.backgroundPosition(index, backgroundPosition.styleValue)}}" stepKey="waitForBackgroundPosition"/> |
| 62 | + <waitForElementVisible selector="{{section.backgroundSize(index, backgroundSize.value)}}" stepKey="waitForBackgroundSize"/> |
| 63 | + <waitForElementVisible selector="{{section.backgroundRepeat(index, backgroundRepeat.styleValue)}}" stepKey="waitForBackgroundRepeat"/> |
| 64 | + <waitForElementVisible selector="{{section.backgroundAttachment(index, backgroundAttachment.value)}}" stepKey="waitForBackgroundAttachment"/> |
| 65 | + </actionGroup> |
| 66 | + <actionGroup name="validateBackgroundImage"> |
| 67 | + <arguments> |
| 68 | + <argument name="section"/> |
| 69 | + <argument name="pageNamePrefix" defaultValue="admin" type="string"/> |
| 70 | + <argument name="backgroundImage"/> |
| 71 | + <argument name="index" defaultValue="1" type="string"/> |
| 72 | + </arguments> |
| 73 | + <comment userInput="validateBackgroundImage" stepKey="comment"/> |
| 74 | + <waitForElementVisible selector="{{section.base(index)}}" stepKey="waitForBaseElement"/> |
| 75 | + <waitForElementVisible selector="{{section.backgroundImage(index, backgroundImage.fileName)}}" stepKey="waitForBackgroundImage"/> |
| 76 | + <grabAttributeFrom selector="{{section.backgroundImage(index, backgroundImage.fileName)}}" userInput="style" stepKey="contentTypeStyle"/> |
| 77 | + <!-- Grab base URL --> |
| 78 | + <executeJS function="return '{{pageNamePrefix}}'" stepKey="pageNamePrefix"/> |
| 79 | + <grabFromCurrentUrl regex="/(^.+(?=\/$pageNamePrefix))/" stepKey="baseURL"/> |
| 80 | + <!-- Return the string value of background-image --> |
| 81 | + <executeJS function="return '$contentTypeStyle'.match(/((?<=(background-image: url\(("|\'))).+(?=("|\')\);))/)[0]" stepKey="backgroundImageValue"/> |
| 82 | + <!-- Convert all characters in string variables to regex friendly strings --> |
| 83 | + <executeJS function="return '$baseURL'.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\\\^\\$\|]/g, '\\\\$&')" stepKey="regexBaseURL"/> |
| 84 | + <executeJS function="return '{{backgroundImage.path}}'.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\\\^\\$\|]/g, '\\\\$&')" stepKey="regexFilePath"/> |
| 85 | + <assertRegExp stepKey="assertBackgroundImageContainsFileInformation"> |
| 86 | + <expectedResult type="string">/{$regexBaseURL}\/pub\/media.*{$regexFilePath}\/{{backgroundImage.fileName}}(_\d+)?\.{{backgroundImage.extension}}/</expectedResult> |
| 87 | + <actualResult type="variable">$backgroundImageValue</actualResult> |
| 88 | + </assertRegExp> |
| 89 | + </actionGroup> |
| 90 | + <actionGroup name="validateBackgroundMobileImage"> |
| 91 | + <arguments> |
| 92 | + <argument name="section"/> |
| 93 | + <argument name="pageNamePrefix" type="string"/> |
| 94 | + <argument name="backgroundMobileImage"/> |
| 95 | + <argument name="index" defaultValue="1" type="string"/> |
| 96 | + </arguments> |
| 97 | + <comment userInput="validateBackgroundMobileImage" stepKey="comment"/> |
| 98 | + <waitForElementVisible selector="{{section.base(index)}}" stepKey="waitForBaseElement"/> |
| 99 | + <waitForElement selector="{{section.backgroundMobileImage(index, backgroundMobileImage.fileName)}}" stepKey="waitForBackgroundMobileImage"/> |
| 100 | + <dontSeeElement selector="{{section.backgroundMobileImage(index, backgroundMobileImage.fileName)}}" stepKey="dontSeeBackgroundMobileImage"/> |
| 101 | + <grabAttributeFrom selector="{{section.backgroundMobileImage(index, backgroundMobileImage.fileName)}}" userInput="style" stepKey="contentTypeStyle"/> |
| 102 | + <!-- Grab base URL --> |
| 103 | + <executeJS function="return '{{pageNamePrefix}}'" stepKey="pageNamePrefix"/> |
| 104 | + <grabFromCurrentUrl regex="/(^.+(?=\/$pageNamePrefix))/" stepKey="baseURL"/> |
| 105 | + <!-- Return the string value of background-image --> |
| 106 | + <executeJS function="return '$contentTypeStyle'.match(/((?<=(background-image: url\(("|\'))).+(?=("|\')\);))/)[0]" stepKey="backgroundMobileImageValue"/> |
| 107 | + <!-- Convert all characters in string variables to regex friendly strings --> |
| 108 | + <executeJS function="return '$baseURL'.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\\\^\\$\|]/g, '\\\\$&')" stepKey="regexBaseURL"/> |
| 109 | + <executeJS function="return '{{backgroundMobileImage.path}}'.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\\\^\\$\|]/g, '\\\\$&')" stepKey="regexFilePath"/> |
| 110 | + <assertRegExp stepKey="assertBackgroundMobileImageContainsFileInformation"> |
| 111 | + <expectedResult type="string">/{$regexBaseURL}\/pub\/media.*{$regexFilePath}\/{{backgroundMobileImage.fileName}}(_\d+)?\.{{backgroundMobileImage.extension}}/</expectedResult> |
| 112 | + <actualResult type="variable">$backgroundMobileImageValue</actualResult> |
| 113 | + </assertRegExp> |
| 114 | + <resizeWindow width="767" height="1000" stepKey="resizeWindowToMobile"/> |
| 115 | + <waitForElementVisible selector="{{section.backgroundMobileImage(index, backgroundMobileImage.fileName)}}" stepKey="waitForBackgroundMobileImageVisible"/> |
| 116 | + <resizeWindow width="1280" height="1024" stepKey="resizeWindowToDesktop"/> |
| 117 | + </actionGroup> |
| 118 | +</actionGroups> |
0 commit comments