Skip to content

Commit e8f295c

Browse files
committed
Merge remote-tracking branch 'origin/MC-10916' into mtf-eol
2 parents a036338 + b9f9408 commit e8f295c

File tree

7 files changed

+140
-1
lines changed

7 files changed

+140
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="LoginToStorefrontWithEmailAndPassword">
11+
<arguments>
12+
<argument name="email" type="string"/>
13+
<argument name="password" type="string"/>
14+
</arguments>
15+
<amOnPage stepKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage.url}}"/>
16+
<fillField stepKey="fillEmail" userInput="{{email}}" selector="{{StorefrontCustomerSignInFormSection.emailField}}"/>
17+
<fillField stepKey="fillPassword" userInput="{{password}}" selector="{{StorefrontCustomerSignInFormSection.passwordField}}"/>
18+
<click stepKey="clickSignInAccountButton" selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="StorefrontCustomerAccountChangePasswordPage" url="/customer/account/edit/changepass/1/" area="storefront" module="Magento_Customer">
12+
<section name="StorefrontCustomerAccountInformationSection"/>
13+
</page>
14+
</pages>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
<element name="changeEmail" type="checkbox" selector="#change_email"/>
1515
<element name="changePassword" type="checkbox" selector="#change_password"/>
1616
<element name="testAddedAttributeFiled" type="input" selector="//input[contains(@id,'{{var}}')]" parameterized="true"/>
17-
<element name="saveButton" type="button" selector="#form-validate .action.save.primary"/>
17+
<element name="saveButton" type="button" selector="#form-validate .action.save.primary" timeout="30"/>
18+
<element name="currentPassword" type="input" selector="#current-password"/>
19+
<element name="newPassword" type="input" selector="#password"/>
20+
<element name="confirmNewPassword" type="input" selector="#password-confirmation"/>
21+
<element name="confirmNewPasswordError" type="text" selector="#password-confirmation-error"/>
1822
</section>
1923
</sections>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCustomerDashboardAccountInformationSection">
1212
<element name="ContactInformation" type="textarea" selector=".box.box-information .box-content"/>
13+
<element name="edit" type="link" selector=".action.edit" timeout="15"/>
14+
<element name="changePassword" type="link" selector=".action.change-password" timeout="15"/>
1315
</section>
1416
<section name="StorefrontCustomerAddressSection">
1517
<element name="firstName" type="input" selector="#firstname"/>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontCustomerMessagesSection">
12+
<element name="successMessage" type="text" selector=".message-success"/>
13+
<element name="errorMessage" type="text" selector=".message-error"/>
14+
</section>
15+
</sections>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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="StorefrontUpdateCustomerPasswordValidCurrentPasswordTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<stories value="Customer Update Password"/>
15+
<title value="Update Customer Password on Storefront, Valid Current Password"/>
16+
<description value="Update Customer Password on Storefront, Valid Current Password"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-10916"/>
19+
<group value="Customer"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<createData stepKey="customer" entity="Simple_US_Customer"/>
24+
</before>
25+
<after>
26+
<deleteData stepKey="deleteCustomer" createDataKey="customer" />
27+
</after>
28+
29+
<!--Log in to Storefront as Customer -->
30+
<actionGroup stepKey="login" ref="LoginToStorefrontActionGroup">
31+
<argument name="Customer" value="$$customer$$"/>
32+
</actionGroup>
33+
<seeInCurrentUrl stepKey="onCustomerAccountPage" url="customer/account"/>
34+
<click stepKey="clickChangePassword" selector="{{StorefrontCustomerDashboardAccountInformationSection.changePassword}}"/>
35+
<fillField stepKey="fillValidCurrentPassword" userInput="$$customer.password$$" selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}"/>
36+
<fillField stepKey="fillNewPassword" userInput="$$customer.password$$#" selector="{{StorefrontCustomerAccountInformationSection.newPassword}}"/>
37+
<fillField stepKey="fillNewPasswordConfirmation" userInput="$$customer.password$$#" selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}"/>
38+
<click stepKey="saveChange" selector="{{StorefrontCustomerAccountInformationSection.saveButton}}"/>
39+
<see stepKey="verifyMessage" userInput="You saved the account information." selector="{{StorefrontCustomerMessagesSection.successMessage}}"/>
40+
<actionGroup stepKey="logout" ref="StorefrontCustomerLogoutActionGroup"/>
41+
<actionGroup stepKey="loginWithNewPassword" ref="LoginToStorefrontWithEmailAndPassword">
42+
<argument name="email" value="$$customer.email$$"/>
43+
<argument name="password" value="$$customer.password$$#"/>
44+
</actionGroup>
45+
<see stepKey="seeMyEmail" userInput="$$customer.email$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}"/>
46+
</test>
47+
<test name="StorefrontUpdateCustomerPasswordInvalidCurrentPasswordTest" extends="StorefrontUpdateCustomerPasswordValidCurrentPasswordTest">
48+
<annotations>
49+
<features value="Customer"/>
50+
<stories value="Customer Update Password"/>
51+
<title value="Update Customer Password on Storefront, Invalid Current Password"/>
52+
<description value="Update Customer Password on Storefront, Invalid Current Password"/>
53+
<severity value="CRITICAL"/>
54+
<testCaseId value="MC-10917"/>
55+
<group value="Customer"/>
56+
<group value="mtf_migrated"/>
57+
</annotations>
58+
59+
<fillField stepKey="fillValidCurrentPassword" userInput="$$customer.password$$^" selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}"/>
60+
<see stepKey="verifyMessage" userInput="The password doesn't match this account. Verify the password and try again." selector="{{StorefrontCustomerMessagesSection.errorMessage}}"/>
61+
<remove keyForRemoval="loginWithNewPassword"/>
62+
<remove keyForRemoval="seeMyEmail"/>
63+
</test>
64+
<test name="StorefrontUpdateCustomerPasswordInvalidConfirmationPasswordTest" extends="StorefrontUpdateCustomerPasswordValidCurrentPasswordTest">
65+
<annotations>
66+
<features value="Customer"/>
67+
<stories value="Customer Update Password"/>
68+
<title value="Update Customer Password on Storefront, Invalid Confirmation Password"/>
69+
<description value="Update Customer Password on Storefront, Invalid Confirmation Password"/>
70+
<severity value="CRITICAL"/>
71+
<testCaseId value="MC-10918"/>
72+
<group value="Customer"/>
73+
<group value="mtf_migrated"/>
74+
</annotations>
75+
76+
<fillField stepKey="fillNewPasswordConfirmation" userInput="$$customer.password$$^" selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}"/>
77+
<see stepKey="verifyMessage" userInput="Please enter the same value again." selector="{{StorefrontCustomerAccountInformationSection.confirmNewPasswordError}}"/>
78+
<remove keyForRemoval="loginWithNewPassword"/>
79+
<remove keyForRemoval="seeMyEmail"/>
80+
</test>
81+
</tests>

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<testCase name="Magento\Customer\Test\TestCase\ChangeCustomerPasswordTest" summary="Change Customer Password from My Account" ticketId="MAGETWO-29411">
1010
<variation name="ChangeCustomerPasswordTestVariation1">
1111
<data name="initialCustomer/dataset" xsi:type="string">default</data>
12+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1213
<data name="customer/data/current_password" xsi:type="string">123123^q</data>
1314
<data name="customer/data/password" xsi:type="string">123123^a</data>
1415
<data name="customer/data/password_confirmation" xsi:type="string">123123^a</data>
@@ -17,13 +18,15 @@
1718
</variation>
1819
<variation name="ChangeCustomerPasswordTestVariation2">
1920
<data name="initialCustomer/dataset" xsi:type="string">default</data>
21+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
2022
<data name="customer/data/current_password" xsi:type="string">123123</data>
2123
<data name="customer/data/password" xsi:type="string">123123^a</data>
2224
<data name="customer/data/password_confirmation" xsi:type="string">123123^a</data>
2325
<constraint name="Magento\Customer\Test\Constraint\AssertChangePasswordFailMessage" />
2426
</variation>
2527
<variation name="ChangeCustomerPasswordTestVariation3">
2628
<data name="initialCustomer/dataset" xsi:type="string">default</data>
29+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
2730
<data name="customer/data/current_password" xsi:type="string">123123^q</data>
2831
<data name="customer/data/password" xsi:type="string">123123^a</data>
2932
<data name="customer/data/password_confirmation" xsi:type="string">123123^d</data>

0 commit comments

Comments
 (0)