Skip to content

Commit c6a93af

Browse files
ENGCOM-8812: show or hide password widget created #31482
2 parents 7357eb9 + 9ee45f5 commit c6a93af

21 files changed

+386
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="AssertCustomerEditFormPasswordFieldActionGroup">
12+
<annotations>
13+
<description>Validate the password is visible as plain text in customer account edit form.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="passwordFieldType" type="string" defaultValue="text"/>
17+
</arguments>
18+
19+
<assertElementContainsAttribute stepKey="assertCurrentPasswordFieldType">
20+
<expectedResult selector="{{StorefrontCustomerAccountInformationSection.currentPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
21+
</assertElementContainsAttribute>
22+
<assertElementContainsAttribute stepKey="assertNewPasswordFieldType">
23+
<expectedResult selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
24+
</assertElementContainsAttribute>
25+
<assertElementContainsAttribute stepKey="assertConfirmNewPasswordFieldType">
26+
<expectedResult selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
27+
</assertElementContainsAttribute>
28+
</actionGroup>
29+
</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="AssertLoginFormPasswordFieldActionGroup">
12+
<annotations>
13+
<description>Validate the password is visible as plain text in login form.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="passwordFieldType" type="string" defaultValue="text"/>
17+
</arguments>
18+
19+
<assertElementContainsAttribute stepKey="assertPasswordFieldType">
20+
<expectedResult selector="{{StorefrontCustomerSignInFormSection.passwordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
21+
</assertElementContainsAttribute>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="AssertRegistrationFormPasswordFieldActionGroup">
12+
<annotations>
13+
<description>Validate the password is visible as plain text on customer registration form.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="passwordFieldType" type="string" defaultValue="text"/>
17+
</arguments>
18+
19+
<assertElementContainsAttribute stepKey="assertPasswordFieldType">
20+
<expectedResult selector="{{StorefrontCustomerCreateFormSection.passwordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
21+
</assertElementContainsAttribute>
22+
<assertElementContainsAttribute stepKey="assertConfirmPasswordFieldType">
23+
<expectedResult selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}" attribute="type" type="string">{{passwordFieldType}}</expectedResult>
24+
</assertElementContainsAttribute>
25+
</actionGroup>
26+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontCustomerEditFormClickShowPasswordActionGroup">
12+
<annotations>
13+
<description>Click on the show password checkbox in customer account information form</description>
14+
</annotations>
15+
16+
<click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerAccountInformationSection.showPasswordCheckbox}}"/>
17+
</actionGroup>
18+
</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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontLoginFormClickShowPasswordActionGroup">
12+
<annotations>
13+
<description>Click on the show password checkbox in login form</description>
14+
</annotations>
15+
16+
<click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerSignInFormSection.showPasswordCheckbox}}"/>
17+
</actionGroup>
18+
</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>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontRegistrationFormClickShowPasswordActionGroup">
12+
<annotations>
13+
<description>Click on the show password checkbox in registration form</description>
14+
</annotations>
15+
16+
<click stepKey="clickShowPasswordCheckbox" selector="{{StorefrontCustomerCreateFormSection.showPasswordCheckbox}}"/>
17+
</actionGroup>
18+
</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>

0 commit comments

Comments
 (0)