Skip to content

Commit db5ee0a

Browse files
committed
Merge remote-tracking branch 'origin/MC-4544' into mtf-eol
2 parents eee25c6 + 21f2b5c commit db5ee0a

8 files changed

+135
-0
lines changed
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertAuthorizationPopUpPasswordAutoCompleteOffActionGroup">
11+
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.password}}" stepKey="waitPasswordFieldVisible"/>
12+
<assertElementContainsAttribute selector="{{StorefrontCustomerSignInPopupFormSection.password}}" attribute="autocomplete" expectedValue="off" stepKey="assertAuthorizationPopupPasswordAutocompleteOff"/>
13+
</actionGroup>
14+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontPasswordAutoCompleteOffActionGroup">
11+
<amOnPage stepKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage.url}}"/>
12+
<assertElementContainsAttribute selector="{{StorefrontCustomerSignInFormSection.passwordField}}" attribute="autocomplete" expectedValue="off" stepKey="assertSignInPasswordAutocompleteOff"/>
13+
</actionGroup>
14+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontPasswordAutoCompleteOffActionGroup">
11+
<amOnPage stepKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage.url}}"/>
12+
<assertElementContainsAttribute selector="{{StorefrontCustomerSignInFormSection.passwordField}}" attribute="autocomplete" expectedValue="off" stepKey="assertSignInPasswordAutocompleteOff"/>
13+
</actionGroup>
14+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontClickSignInButtonActionGroup">
12+
<click stepKey="signIn" selector="{{StorefrontPanelHeaderSection.customerLoginLink}}" />
13+
<waitForPageLoad stepKey="waitForStorefrontSignInPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontClickSignInButtonActionGroup">
12+
<click stepKey="signIn" selector="{{StorefrontPanelHeaderSection.customerLoginLink}}" />
13+
<waitForPageLoad stepKey="waitForStorefrontSignInPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<element name="notYouLink" type="button" selector=".greet.welcome span a"/>
1515
<element name="customerWelcome" type="text" selector=".panel.header .customer-welcome"/>
1616
<element name="customerWelcomeMenu" type="text" selector=".panel.header .customer-welcome .customer-menu"/>
17+
<element name="customerLoginLink" type="button" selector=".panel.header .header.links .authorization-link a" timeout="30"/>
1718
<element name="customerLogoutLink" type="text" selector=".panel.header .customer-welcome .customer-menu .authorization-link a" timeout="30"/>
1819
</section>
1920
</sections>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="PasswordAutocompleteOffTest">
11+
<annotations>
12+
<features value="Customer"/>
13+
<stories value="Customer Password Autocomplete"/>
14+
<title value="[Security] Autocomplete attribute with off value is added to password input"/>
15+
<description value="[Security] Autocomplete attribute with off value is added to password input"/>
16+
<testCaseId value="MC-13678"/>
17+
<severity value="CRITICAL"/>
18+
<group value="customers"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<!-- Configure Magento via CLI: disable_guest_checkout -->
23+
<magentoCLI command="config:set checkout/options/guest_checkout 0" stepKey="disableGuestCheckout"/>
24+
25+
<!-- Configure Magento via CLI: password_autocomplete_off-->
26+
<magentoCLI command="config:set customer/password/autocomplete_on_storefront 0" stepKey="turnPasswordAutocompleteOff"/>
27+
28+
<!-- Create a simple product -->
29+
<createData entity="SimpleSubCategory" stepKey="category"/>
30+
<createData entity="SimpleProduct" stepKey="product">
31+
<requiredEntity createDataKey="category"/>
32+
</createData>
33+
</before>
34+
<after>
35+
<!-- Set Magento configuration back to default values -->
36+
<magentoCLI command="config:set checkout/options/guest_checkout 1" stepKey="disableGuestCheckoutRollback"/>
37+
<magentoCLI command="config:set customer/password/autocomplete_on_storefront 1" stepKey="turnPasswordAutocompleteOffRollback"/>
38+
39+
<!-- Delete the simple product created in the before block -->
40+
<deleteData createDataKey="product" stepKey="deleteProduct"/>
41+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
42+
</after>
43+
44+
<!-- Go to the created product page and add it to the cart-->
45+
<actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart">
46+
<argument name="product" value="$$product$$"/>
47+
</actionGroup>
48+
49+
<!--Click Sign in - on the top right of the page -->
50+
<actionGroup ref="StorefrontClickSignInButtonActionGroup" stepKey="storeFrontClickSignInButton"/>
51+
52+
<!--Verify if the password field on store front sign-in page has the autocomplete attribute set to off -->
53+
<actionGroup ref="AssertStorefrontPasswordAutoCompleteOffActionGroup" stepKey="assertStorefrontPasswordAutoCompleteOff"/>
54+
55+
<!--Proceed to checkout-->
56+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
57+
58+
<!--Verify if the password field on the authorization popup has the autocomplete attribute set to off -->
59+
<actionGroup ref="AssertAuthorizationPopUpPasswordAutoCompleteOffActionGroup" stepKey="assertAuthorizationPopUpPasswordAutoCompleteOff"/>
60+
</test>
61+
</tests>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Customer\Test\TestCase\PasswordAutocompleteOffTest" summary="Test that autocomplete is off" ticketId="MAGETWO-45324">
1010
<variation name="RegisterCustomerFrontendEntityTestVariation1" summary="Test that autocomplete is off">
11+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1112
<data name="product/dataset" xsi:type="string">default</data>
1213
<data name="configData" xsi:type="string">disable_guest_checkout,password_autocomplete_off</data>
1314
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerPasswordAutocompleteOnAuthorizationPopup" />

0 commit comments

Comments
 (0)