|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2021 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="StorefrontCaptchaOnEmailToFriendFormTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Captcha"/> |
| 14 | + <stories value="Sending email about products in store with enabled captcha"/> |
| 15 | + <title value="Captcha on email to friend form"/> |
| 16 | + <description value="Customer should be able send email to friend about product with enabled captcha"/> |
| 17 | + <severity value="MINOR"/> |
| 18 | + <group value="captcha"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 22 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 23 | + <requiredEntity createDataKey="createCategory"/> |
| 24 | + </createData> |
| 25 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 26 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength"/> |
| 27 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols"/> |
| 28 | + <magentoCLI command="config:set {{StorefrontCaptchaOnEmailToFriendFormConfigData.path}} {{StorefrontCaptchaOnEmailToFriendFormConfigData.value}}" stepKey="enableEmailToFriendCaptcha"/> |
| 29 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="setCaptchaAlwaysVisible"/> |
| 30 | + <magentoCLI command="config:set {{EnableCatalogEmailToFriendOptionConfigData.path}} {{EnableCatalogEmailToFriendOptionConfigData.value}}" stepKey="enableSendToFriend"/> |
| 31 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 32 | + <argument name="tags" value="config full_page"/> |
| 33 | + </actionGroup> |
| 34 | + </before> |
| 35 | + <after> |
| 36 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 37 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 38 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> |
| 39 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 40 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength"/> |
| 41 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols"/> |
| 42 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="setCaptchaDefaultVisibility"/> |
| 43 | + <magentoCLI command="config:set {{StorefrontCaptchaOnCustomerLoginConfigData.path}} {{StorefrontCaptchaOnCustomerLoginConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms"/> |
| 44 | + <magentoCLI command="config:set {{DisableCatalogEmailToFriendOptionConfigData.path}} {{DisableCatalogEmailToFriendOptionConfigData.value}}" stepKey="disableSendToFriend"/> |
| 45 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 46 | + <argument name="tags" value="config full_page"/> |
| 47 | + </actionGroup> |
| 48 | + </after> |
| 49 | + |
| 50 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 51 | + <argument name="Customer" value="$createCustomer$"/> |
| 52 | + </actionGroup> |
| 53 | + <actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory"> |
| 54 | + <argument name="category" value="$createCategory$"/> |
| 55 | + <argument name="product" value="$createProduct$"/> |
| 56 | + </actionGroup> |
| 57 | + <actionGroup ref="StorefrontClickEmailToFriendButtonOnProductPageActionGroup" stepKey="clickEmailButton"/> |
| 58 | + <actionGroup ref="AssertCaptchaVisibleOnEmailToFriendFormActionGroup" stepKey="seeCaptchaOnEmailToFriendForm"/> |
| 59 | + <actionGroup ref="StorefrontFillFieldsOnEmailToFriendFormActionGroup" stepKey="fillFieldsOnForm"> |
| 60 | + <argument name="senderName" value="{{Simple_US_Customer.firstname}}"/> |
| 61 | + <argument name="senderEmail" value="{{Simple_US_Customer.email}}"/> |
| 62 | + <argument name="message" value="{{EmailToFriendValidValues.shareInfo_message}}"/> |
| 63 | + <argument name="recipientName" value="{{EmailToFriendValidValues.recipient_name}}"/> |
| 64 | + <argument name="recipientEmail" value="{{EmailToFriendValidValues.shareInfo_email}}"/> |
| 65 | + </actionGroup> |
| 66 | + <actionGroup ref="StorefrontFillCaptchaOnEmailToFriendFormActionGroup" stepKey="fillCaptchaFieldWithIncorrectValues"> |
| 67 | + <argument name="captcha" value="{{WrongCaptcha.value}}"/> |
| 68 | + </actionGroup> |
| 69 | + <actionGroup ref="StorefrontClickSendEmailButtonOnEmailToFriendFormActionGroup" stepKey="submitEmailToFriendForm"/> |
| 70 | + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertErrorMessage"> |
| 71 | + <argument name="message" value="Incorrect CAPTCHA"/> |
| 72 | + <argument name="messageType" value="error"/> |
| 73 | + </actionGroup> |
| 74 | + <actionGroup ref="StorefrontFillFieldsOnEmailToFriendFormActionGroup" stepKey="fillFieldsOnEmailToFriendForm"> |
| 75 | + <argument name="senderName" value="{{Simple_US_Customer.firstname}}"/> |
| 76 | + <argument name="senderEmail" value="{{Simple_US_Customer.email}}"/> |
| 77 | + <argument name="message" value="{{EmailToFriendValidValues.shareInfo_message}}"/> |
| 78 | + <argument name="recipientName" value="{{EmailToFriendValidValues.recipient_name}}"/> |
| 79 | + <argument name="recipientEmail" value="{{EmailToFriendValidValues.shareInfo_email}}"/> |
| 80 | + </actionGroup> |
| 81 | + <actionGroup ref="StorefrontFillCaptchaOnEmailToFriendFormActionGroup" stepKey="fillCaptchaFieldWithCorrectValues"> |
| 82 | + <argument name="captcha" value="{{PreconfiguredCaptcha.value}}"/> |
| 83 | + </actionGroup> |
| 84 | + <actionGroup ref="StorefrontClickSendEmailButtonOnEmailToFriendFormActionGroup" stepKey="submitEmailToFriendFormWithValidValues"/> |
| 85 | + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertSuccessMessage"> |
| 86 | + <argument name="message" value="The link to a friend was sent."/> |
| 87 | + </actionGroup> |
| 88 | + </test> |
| 89 | +</tests> |
0 commit comments