Skip to content

Commit 86074d8

Browse files
DmitryTsymbalokolesnyk
authored andcommitted
refactoring
1 parent 117a045 commit 86074d8

7 files changed

+130
-30
lines changed

app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerDontSeePasswordFieldsActionGroup.xml renamed to app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertAccountPasswordFieldsNotAvailableActionGroup.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
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}}" />
11+
<actionGroup name="StorefrontAssertAccountPasswordFieldsNotAvailableActionGroup">
12+
<dontSee stepKey="dontSeeCurrentPasswordField" selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}"/>
13+
<dontSee stepKey="dontSeeNewPasswordField" selector="{{StorefrontCustomerAccountInformationSection.newPassword}}"/>
14+
<dontSee stepKey="dontSeeConfirmPasswordField" selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}"/>
1515
</actionGroup>
1616
</actionGroups>

app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerChangePasswordActionGroup.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
<argument name="password" type="string" />
1414
</arguments>
1515

16-
<conditionalClick selector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" dependentSelector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" visible="true" stepKey="openAccountInfoTab" />
17-
<waitForPageLoad stepKey="waitForAccountInfoTabOpened" />
1816
<checkOption selector="{{StorefrontCustomerAccountInformationSection.changePassword}}" stepKey="clickChangePasswordlCheckbox" />
1917
<fillField selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" userInput="{{password}}" stepKey="fillCurrentPassword" />
2018
<fillField selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" userInput="{{password}}" stepKey="fillNewPassword" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="StorefrontNavigateToAccountInformationChangeActionGroup">
12+
<amOnPage url="{{StorefrontCustomerEditPage.url}}" stepKey="goToCustomerEditPage"/>
13+
<waitForPageLoad stepKey="waitForEditPage"/>
14+
<conditionalClick selector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" dependentSelector="{{StorefrontCustomerSidebarSection.sidebarTab('Account Information')}}" visible="true" stepKey="openAccountInfoTab" />
15+
<waitForPageLoad stepKey="waitForAccountInfoTabOpened"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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="StorefrontAccountPasswordFieldsNotAvailableTest">
12+
<annotations>
13+
<features value="Security"/>
14+
<stories value="Password Fields not Available on Frontend Until Checkbox Change Password Unchecked"/>
15+
<title value="Password Fields not Available"/>
16+
<description value="User Cannot Change Password Until Checkbox Change Password Unchecked"/>
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 "Change Account Information" tab -->
36+
<actionGroup ref="StorefrontNavigateToAccountInformationChangeActionGroup" stepKey="goToCustomerEditPage"/>
37+
<!-- Assert Account Password Fields not Available -->
38+
<actionGroup ref="StorefrontAssertAccountPasswordFieldsNotAvailableActionGroup" stepKey="uncheckedCheckbox"/>
39+
<!-- END TEST BODY -->
40+
41+
</test>
42+
</tests>

app/code/Magento/Security/Test/Mftf/Test/StorefrontChangingCustomerPasswordTest.xml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,36 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="StorefrontChangingCustomerPasswordTest">
1212
<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" />
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 value"/>
17+
<group value="security"/>
18+
<group value="mtf_migrated"/>
1919
</annotations>
2020

2121
<before>
22-
<createData entity="Simple_US_Customer" stepKey="customer" />
22+
<createData entity="Simple_US_Customer" stepKey="customer"/>
2323
</before>
2424
<after>
25-
<deleteData createDataKey="customer" stepKey="deleteCustomer" />
25+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
2626
</after>
2727

2828
<!-- TEST BODY -->
2929
<!-- Go to storefront home page -->
30-
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage" />
30+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/>
3131
<!-- Login as created customer -->
3232
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
33-
<argument name="Customer" value="$$customer$$" />
33+
<argument name="Customer" value="$$customer$$"/>
3434
</actionGroup>
35-
<!-- Navigate to "Account Information" tab -->
36-
<actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageFirstTime" />
35+
<!-- Navigate to "Change Account Information" tab -->
36+
<actionGroup ref="StorefrontNavigateToAccountInformationChangeActionGroup" stepKey="goToCustomerEditPage"/>
3737
<!-- Change Password with Correct Data -->
3838
<actionGroup ref="StorefrontCustomerChangePasswordActionGroup" stepKey="changePasswordWithCorrectData">
39-
<argument name="password" value="$$customer.password$$" />
39+
<argument name="password" value="$$customer.password$$"/>
4040
</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" />
41+
<!-- See Success Message -->
42+
<actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertAccountMessageSuccess"/>
5243
<!-- END TEST BODY -->
5344

5445
</test>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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="StorefrontChangingCustomerPasswordTestWithIncorrectDataTest">
12+
<annotations>
13+
<features value="Security"/>
14+
<stories value="Changing Customer's Password With Incorrect Current Password"/>
15+
<title value="Changing Customer Password Test with Incorrect Data"/>
16+
<description value="Changing Customer's password using Incorrect Current Password"/>
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 "Change Account Information" tab -->
36+
<actionGroup ref="StorefrontNavigateToAccountInformationChangeActionGroup" stepKey="goToCustomerEditPage"/>
37+
<!-- Change Password with InCorrect Current Password -->
38+
<actionGroup ref="StorefrontCustomerChangePasswordActionGroup" stepKey="changePasswordWithInCorrectData">
39+
<argument name="password" value="{{Colorado_US_Customer.password}}"/>
40+
</actionGroup>
41+
<!-- See Error Message -->
42+
<actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="assertAccountMessageFirstAttempt">
43+
<argument name="message" value="The password doesn't match this account. Verify the password and try again."/>
44+
<argument name="messageType" value="error"/>
45+
</actionGroup>
46+
<!-- END TEST BODY -->
47+
48+
</test>
49+
</tests>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<data name="check" xsi:type="string">1</data>
1717
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerInfoSuccessSavedMessage" />
1818
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerPasswordChanged" />
19+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1920
</variation>
2021
<variation name="SecureChangingPasswordV2" summary="Change Password checkbox is checked, enter wrong password">
2122
<data name="tag" xsi:type="string">severity:S2</data>
@@ -25,12 +26,14 @@
2526
<data name="customer/data/password_confirmation" xsi:type="string">123123Qa</data>
2627
<data name="check" xsi:type="string">1</data>
2728
<constraint name="Magento\Customer\Test\Constraint\AssertChangePasswordFailMessage" />
29+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
2830
</variation>
2931
<variation name="SecureChangingPasswordV3" summary="Change Password checkbox is unchecked">
3032
<data name="tag" xsi:type="string">severity:S3</data>
3133
<data name="initialCustomer/dataset" xsi:type="string">default</data>
3234
<data name="check" xsi:type="string">0</data>
3335
<constraint name="Magento\Security\Test\Constraint\AssertDefaultAccountInformation" />
36+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
3437
</variation>
3538
</testCase>
3639
</config>

0 commit comments

Comments
 (0)