|
| 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="StorefrontResetCustomerPasswordFailedTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Customer"/> |
| 14 | + <title value="Customer tries to reset password several times"/> |
| 15 | + <description value="Customer tries to reset password several times"/> |
| 16 | + <group value="Customer"/> |
| 17 | + <group value="security"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <magentoCLI command="config:set customer/captcha/enable 0" stepKey="disableCaptcha"/> |
| 22 | + <createData stepKey="customer" entity="Simple_US_Customer"/> |
| 23 | + </before> |
| 24 | + <after> |
| 25 | + <deleteData stepKey="deleteCustomer" createDataKey="customer" /> |
| 26 | + </after> |
| 27 | + <!-- Go to login page, and click on the forgot password link --> |
| 28 | + <amOnPage stepKey="amOnSignInPage1" url="{{StorefrontCustomerSignInPage.url}}"/> |
| 29 | + <click stepKey="clickForgotPasswordLink1" selector="{{StorefrontCustomerSignInFormSection.forgotPasswordLink}}"/> |
| 30 | + <see stepKey="seePageTitle1" userInput="Forgot Your Password" selector="{{StorefrontForgotPasswordSection.pageTitle}}"/> |
| 31 | + <!-- Enter email and submit the forgot password form --> |
| 32 | + <fillField stepKey="enterEmail1" userInput="$$customer.email$$" selector="{{StorefrontForgotPasswordSection.email}}"/> |
| 33 | + <click stepKey="clickResetPassword1" selector="{{StorefrontForgotPasswordSection.resetMyPasswordButton}}"/> |
| 34 | + <seeInCurrentUrl stepKey="seeInSignInPage" url="account/login"/> |
| 35 | + <waitForElementVisible selector="{{StorefrontCustomerLoginMessagesSection.successMessage}}" stepKey="waitForSuccessMessage" /> |
| 36 | + <see stepKey="seeSuccessMessage" userInput="If there is an account associated with $$customer.email$$ you will receive an email with a link to reset your password." selector="{{StorefrontCustomerLoginMessagesSection.successMessage}}"/> |
| 37 | + <!-- Repeat the procedure once again and ensure that on a second attempt customer sees an error --> |
| 38 | + <amOnPage stepKey="amOnSignInPage2" url="{{StorefrontCustomerSignInPage.url}}"/> |
| 39 | + <click stepKey="clickForgotPasswordLink2" selector="{{StorefrontCustomerSignInFormSection.forgotPasswordLink}}"/> |
| 40 | + <see stepKey="seePageTitle2" userInput="Forgot Your Password" selector="{{StorefrontForgotPasswordSection.pageTitle}}"/> |
| 41 | + <fillField stepKey="enterEmail2" userInput="$$customer.email$$" selector="{{StorefrontForgotPasswordSection.email}}"/> |
| 42 | + <click stepKey="clickResetPassword2" selector="{{StorefrontForgotPasswordSection.resetMyPasswordButton}}"/> |
| 43 | + <seeInCurrentUrl stepKey="seeInForgotPasswordPage" url="account/forgotpassword"/> |
| 44 | + <waitForElementVisible selector="{{StorefrontCustomerLoginMessagesSection.errorMessage}}" stepKey="waitForFailMessage" /> |
| 45 | + < see stepKey= "seeFailMessage" userInput= "We received too many requests for password resets. Please wait and try again later or contact [email protected]." selector= "{{StorefrontCustomerLoginMessagesSection.errorMessage}}"/> |
| 46 | + </test> |
| 47 | +</tests> |
0 commit comments