Skip to content

Commit 117a045

Browse files
DmitryTsymbalokolesnyk
authored andcommitted
SecureChangingCustomerEmailTest
1 parent 7f11fe7 commit 117a045

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="StorefrontCustomerChangePasswordActionGroup">
12+
<arguments>
13+
<argument name="password" type="string" />
14+
</arguments>
15+
16+
<conditionalClick selector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" dependentSelector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" visible="true" stepKey="openAccountInfoTab" />
17+
<waitForPageLoad stepKey="waitForAccountInfoTabOpened" />
18+
<checkOption selector="{{StorefrontCustomerAccountInformationSection.changePassword}}" stepKey="clickChangePasswordlCheckbox" />
19+
<fillField selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" userInput="{{password}}" stepKey="fillCurrentPassword" />
20+
<fillField selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" userInput="{{password}}" stepKey="fillNewPassword" />
21+
<fillField selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" userInput="{{password}}" stepKey="confirmNewPassword" />
22+
<click selector="{{StorefrontCustomerAccountInformationSection.saveButton}}" stepKey="saveChange" />
23+
<waitForPageLoad stepKey="waitForPageLoaded" />
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="StorefrontCustomerDontSeePasswordFieldsActionGroup">
12+
<dontSee stepKey="dontSeeCurrentPasswordField" selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" />
13+
<dontSee stepKey="dontSeeNewPasswordField" selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" />
14+
<dontSee stepKey="dontSeeConfirmPasswordField" selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" />
15+
</actionGroup>
16+
</actionGroups>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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="StorefrontChangingCustomerPasswordTest">
12+
<annotations>
13+
<features value="Security" />
14+
<stories value="Changing Customer's Password" />
15+
<title value="Changing Customer Password Test" />
16+
<description value="Changing Customer's password using correct and wrong passwords" />
17+
<group value="security" />
18+
<group value="mtf_migrated" />
19+
</annotations>
20+
21+
<before>
22+
<createData entity="Simple_US_Customer" stepKey="customer" />
23+
</before>
24+
<after>
25+
<deleteData createDataKey="customer" stepKey="deleteCustomer" />
26+
</after>
27+
28+
<!-- TEST BODY -->
29+
<!-- Go to storefront home page -->
30+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage" />
31+
<!-- Login as created customer -->
32+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
33+
<argument name="Customer" value="$$customer$$" />
34+
</actionGroup>
35+
<!-- Navigate to "Account Information" tab -->
36+
<actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageFirstTime" />
37+
<!-- Change Password with Correct Data -->
38+
<actionGroup ref="StorefrontCustomerChangePasswordActionGroup" stepKey="changePasswordWithCorrectData">
39+
<argument name="password" value="$$customer.password$$" />
40+
</actionGroup>
41+
<actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertAccountMessageSuccess" />
42+
<!-- Change Password with Incorrect Data -->
43+
<actionGroup ref="StorefrontCustomerChangePasswordActionGroup" stepKey="changePasswordWithInCorrectData">
44+
<argument name="password" value="{{Colorado_US_Customer.password}}" />
45+
</actionGroup>
46+
<actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertAccountMessageFirstAttempt">
47+
<argument name="message" value="The password doesn't match this account. Verify the password and try again." />
48+
<argument name="messageType" value="error" />
49+
</actionGroup>
50+
<!-- Change Password With Unchecked Checkbox -->
51+
<actionGroup ref="StorefrontCustomerDontSeePasswordFieldsActionGroup" stepKey="uncheckedCheckbox" />
52+
<!-- END TEST BODY -->
53+
54+
</test>
55+
</tests>

0 commit comments

Comments
 (0)