Skip to content

Commit 3f43759

Browse files
Created MFTF test for the show password functionality
1 parent cd336ea commit 3f43759

10 files changed

+209
-0
lines changed
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="AssertPasswordFieldActionGroup">
12+
<annotations>
13+
<description>Validate the password is visible as plain text.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="fieldSelector" type="string"/>
17+
<argument name="passwordFieldType" type="string" defaultValue="text"/>
18+
</arguments>
19+
20+
<assertElementContainsAttribute stepKey="assertPasswordFieldType">
21+
<expectedResult selector="{{fieldSelector}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
22+
</assertElementContainsAttribute>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 21 additions & 0 deletions
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="StorefrontClickShowPasswordActionGroup">
12+
<annotations>
13+
<description>Click on the show password checkbox</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="fieldSelector" type="string"/>
17+
</arguments>
18+
19+
<click stepKey="clickShowPasswordCheckbox" selector="{{fieldSelector}}"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="StorefrontFillChangePasswordFormActionGroup">
12+
<annotations>
13+
<description>Fills in the provided Customer details on the Storefront Customer change password form.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customer" type="entity"/>
17+
</arguments>
18+
19+
<fillField stepKey="fillCurrentPassword" userInput="{{customer.password}}" selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}"/>
20+
<fillField stepKey="fillNewPassword" userInput="{{customer.password}}" selector="{{StorefrontCustomerAccountInformationSection.newPassword}}"/>
21+
<fillField stepKey="fillNewConfirmPassword" userInput="{{customer.password}}" selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="StorefrontOpenCustomerChangePasswordPageActionGroup">
12+
<annotations>
13+
<description>Goes to the Storefront Customer Change Password page.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{StorefrontCustomerAccountChangePasswordPage.url}}" stepKey="goToCustomerAccountChangePasswordPage"/>
17+
<waitForPageLoad stepKey="waitForPageLoaded"/>
18+
</actionGroup>
19+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<element name="currentPassword" type="input" selector="#current-password"/>
1919
<element name="newPassword" type="input" selector="#password"/>
2020
<element name="confirmNewPassword" type="input" selector="#password-confirmation"/>
21+
<element name="showPasswordCheckbox" type="input" selector="#show-password"/>
2122
<element name="confirmNewPasswordError" type="text" selector="#password-confirmation-error"/>
2223
<element name="email" type="input" selector=".form-edit-account input[name='email']" />
2324
<element name="emailErrorMessage" type="text" selector="#email-error"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<element name="emailField" type="input" selector="#email_address"/>
1717
<element name="passwordField" type="input" selector="#password"/>
1818
<element name="confirmPasswordField" type="input" selector="#password-confirmation"/>
19+
<element name="showPasswordCheckbox" type="input" selector="#show-password"/>
1920
<element name="createAccountButton" type="button" selector="button.action.submit.primary" timeout="30"/>
2021
<element name="passwordErrorMessages" type="text" selector="#password-error"/>
2122
</section>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<section name="StorefrontCustomerSignInFormSection">
1111
<element name="emailField" type="input" selector="#email"/>
1212
<element name="passwordField" type="input" selector="#pass"/>
13+
<element name="showPasswordCheckbox" type="input" selector="#show-password"/>
1314
<element name="signInAccountButton" type="button" selector="#send2" timeout="30"/>
1415
<element name="forgotPasswordLink" type="button" selector=".action.remind" timeout="10"/>
1516
<element name="customerLoginBlock" type="text" selector=".login-container .block.block-customer-login"/>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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="StorefrontChangePasswordFormShowPasswordTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<stories value="Customer Password Update"/>
15+
<title value="Show Password Checkbox"/>
16+
<description value="Check Show Password Functionality in Customer Password Update Form"/>
17+
<group value="Customer"/>
18+
</annotations>
19+
<before>
20+
<createData stepKey="customer" entity="Simple_US_Customer"/>
21+
</before>
22+
<after>
23+
<deleteData stepKey="deleteCustomer" createDataKey="customer" />
24+
</after>
25+
26+
<actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/>
27+
<actionGroup ref="StorefrontFillCustomerLoginFormActionGroup" stepKey="fillLoginFormWithCorrectCredentials">
28+
<argument name="customer" value="$$customer$$"/>
29+
</actionGroup>
30+
<actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButton" />
31+
<actionGroup ref="StorefrontOpenCustomerChangePasswordPageActionGroup" stepKey="openCustomerPasswordUpdatePage"/>
32+
<actionGroup ref="StorefrontFillChangePasswordFormActionGroup" stepKey="fillChangePasswordForm">
33+
<argument name="customer" value="Simple_US_Customer"/>
34+
</actionGroup>
35+
<actionGroup ref="StorefrontClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox">
36+
<argument name="fieldSelector" value="{{StorefrontCustomerAccountInformationSection.showPasswordCheckbox}}"/>
37+
</actionGroup>
38+
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertCurrentPasswordField">
39+
<argument name="fieldSelector" value="{{StorefrontCustomerAccountInformationSection.currentPassword}}" />
40+
</actionGroup>
41+
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertNewPasswordField">
42+
<argument name="fieldSelector" value="{{StorefrontCustomerAccountInformationSection.newPassword}}" />
43+
</actionGroup>
44+
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertNewConfirmPasswordField">
45+
<argument name="fieldSelector" value="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" />
46+
</actionGroup>
47+
</test>
48+
</tests>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="StorefrontCreateCustomerFormShowPasswordTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<stories value="Customer Creation"/>
15+
<title value="Show Password Checkbox"/>
16+
<description value="Check Show Password Functionality in Customer Creation Form"/>
17+
<group value="Customer"/>
18+
</annotations>
19+
20+
<actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/>
21+
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm">
22+
<argument name="customer" value="Simple_US_Customer"/>
23+
</actionGroup>
24+
<actionGroup ref="StorefrontClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox">
25+
<argument name="fieldSelector" value="{{StorefrontCustomerCreateFormSection.showPasswordCheckbox}}"/>
26+
</actionGroup>
27+
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertPasswordField">
28+
<argument name="fieldSelector" value="{{StorefrontCustomerCreateFormSection.passwordField}}" />
29+
</actionGroup>
30+
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertConfirmPasswordField">
31+
<argument name="fieldSelector" value="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}" />
32+
</actionGroup>
33+
</test>
34+
</tests>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="StorefrontLoginFormShowPasswordTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<stories value="Customer Login"/>
15+
<title value="Show Password Checkbox"/>
16+
<description value="Check Show Password Functionality"/>
17+
<group value="Customer"/>
18+
</annotations>
19+
<before>
20+
<createData stepKey="customer" entity="Simple_US_Customer"/>
21+
</before>
22+
<after>
23+
<deleteData stepKey="deleteCustomer" createDataKey="customer" />
24+
</after>
25+
26+
<actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/>
27+
<actionGroup ref="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" stepKey="fillLoginFormWithCustomerData">
28+
<argument name="customer" value="$$customer$$"/>
29+
</actionGroup>
30+
<actionGroup ref="StorefrontClickShowPasswordActionGroup" stepKey="clickShowPasswordCheckbox">
31+
<argument name="fieldSelector" value="{{StorefrontCustomerSignInFormSection.showPasswordCheckbox}}"/>
32+
</actionGroup>
33+
<actionGroup ref="AssertPasswordFieldActionGroup" stepKey="AssertPasswordField">
34+
<argument name="fieldSelector" value="{{StorefrontCustomerSignInFormSection.passwordField}}" />
35+
</actionGroup>
36+
</test>
37+
</tests>

0 commit comments

Comments
 (0)