Skip to content

Commit 2302d11

Browse files
committed
Convert ResetCustomerPasswordFailedTest to MFTF
1 parent 931f2ea commit 2302d11

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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>

dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetCustomerPasswordFailedTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Security\Test\TestCase\ResetCustomerPasswordFailedTest" summary="Reset customer password.">
1010
<variation name="ResetPasswordTestVariation">
11+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1112
<data name="tag" xsi:type="string">severity:S1</data>
1213
<data name="customer/dataset" xsi:type="string">customer_US</data>
1314
<data name="attempts" xsi:type="string">2</data>

0 commit comments

Comments
 (0)