Skip to content

Commit 878ee23

Browse files
ENGCOM-9066: MFTF: Change Customer Password With Enabled Captcha #32936
2 parents fa60661 + 96d8cf0 commit 878ee23

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontCustomerChangePasswordWithCaptchaActionGroup" extends="StorefrontEditCustomerPasswordActionGroup">
12+
<annotations>
13+
<description>EXTENDS: StorefrontEditCustomerPasswordActionGroup. Fills in the Captcha field on the Storefront Customer Information page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="captcha" type="string"/>
17+
</arguments>
18+
19+
<fillField selector="{{StorefrontCustomerAccountInformationSection.captchaField}}" userInput="{{captcha}}" stepKey="fillCaptchaField" after="confirmNewPassword"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontEditCustomerPasswordActionGroup">
12+
<arguments>
13+
<argument name="currentPassword" type="string"/>
14+
<argument name="newPassword" type="string"/>
15+
</arguments>
16+
17+
<checkOption selector="{{StorefrontCustomerAccountInformationSection.changePassword}}" stepKey="clickChangePasswordCheckbox"/>
18+
<fillField selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" userInput="{{currentPassword}}" stepKey="fillCurrentPassword"/>
19+
<fillField selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" userInput="{{newPassword}}" stepKey="fillNewPassword"/>
20+
<fillField selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" userInput="{{newPassword}}" stepKey="confirmNewPassword"/>
21+
<click selector="{{StorefrontCustomerAccountInformationSection.saveButton}}" stepKey="saveChange"/>
22+
<waitForPageLoad stepKey="waitForPageLoaded"/>
23+
</actionGroup>
24+
</actionGroups>

0 commit comments

Comments
 (0)