|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="StorefrontCaptchaChangeCustomerPasswordTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Captcha"/> |
| 14 | + <stories value="Change customer password with enabled captcha"/> |
| 15 | + <title value="Enabled captcha on changing customer password form"/> |
| 16 | + <description value="Customer should be able change the password with enabled captcha"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <group value="captcha"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <magentoCLI command="config:set {{StorefrontCaptchaOnCustomerChangePasswordConfigData.path}} {{StorefrontCaptchaOnCustomerChangePasswordConfigData.value}}" stepKey="enableUserEditCaptcha"/> |
| 22 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength"/> |
| 23 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols"/> |
| 24 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="setCaptchaAlwaysVisible"/> |
| 25 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 26 | + <argument name="tags" value="config full_page"/> |
| 27 | + </actionGroup> |
| 28 | + <createData entity="Simple_US_Customer" stepKey="customer"/> |
| 29 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 30 | + <argument name="Customer" value="$$customer$$"/> |
| 31 | + </actionGroup> |
| 32 | + </before> |
| 33 | + <after> |
| 34 | + <magentoCLI command="config:set {{StorefrontCaptchaOnCustomerLoginConfigData.path}} {{StorefrontCaptchaOnCustomerLoginConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms"/> |
| 35 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength"/> |
| 36 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols"/> |
| 37 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="setCaptchaDefaultVisibility"/> |
| 38 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> |
| 39 | + <argument name="tags" value="config full_page"/> |
| 40 | + </actionGroup> |
| 41 | + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> |
| 42 | + </after> |
| 43 | + |
| 44 | + <actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPage"/> |
| 45 | + <actionGroup ref="AssertCaptchaVisibleOnCustomerAccountInfoActionGroup" stepKey="assertCaptchaVisible"/> |
| 46 | + <actionGroup ref="StorefrontCustomerChangePasswordWithCaptchaActionGroup" stepKey="changePasswordWithIncorrectCaptcha"> |
| 47 | + <argument name="currentPassword" value="{{Simple_US_Customer.password}}"/> |
| 48 | + <argument name="newPassword" value="{{Colorado_US_Customer.password}}"/> |
| 49 | + <argument name="captcha" value="{{WrongCaptcha.value}}"/> |
| 50 | + </actionGroup> |
| 51 | + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertErrorMessage"> |
| 52 | + <argument name="message" value="Incorrect CAPTCHA"/> |
| 53 | + <argument name="messageType" value="error"/> |
| 54 | + </actionGroup> |
| 55 | + <actionGroup ref="StorefrontCustomerChangePasswordWithCaptchaActionGroup" stepKey="changePasswordWithCorrectValues"> |
| 56 | + <argument name="currentPassword" value="{{Simple_US_Customer.password}}"/> |
| 57 | + <argument name="newPassword" value="{{Colorado_US_Customer.password}}"/> |
| 58 | + <argument name="captcha" value="{{PreconfiguredCaptcha.value}}"/> |
| 59 | + </actionGroup> |
| 60 | + <actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertSuccessMessage"> |
| 61 | + <argument name="message" value="You saved the account information."/> |
| 62 | + </actionGroup> |
| 63 | + </test> |
| 64 | +</tests> |
0 commit comments