Skip to content

Commit 7c9b5f7

Browse files
committed
refactoring
1 parent 100a81e commit 7c9b5f7

File tree

8 files changed

+77
-38
lines changed

8 files changed

+77
-38
lines changed
Lines changed: 17 additions & 0 deletions
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontClickHeaderLinkActionGroup">
11+
<arguments>
12+
<argument name="LinkName" type="string" defaultValue="Create an Account"/>
13+
</arguments>
14+
<click stepKey="ClickTheLink" selector="{{StorefrontHeaderSection.HeaderLinkByText(LinkName)}}"/>
15+
<waitForPageLoad stepKey="Wait"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
<arguments>
1212
<argument name="LinkName" type="string" defaultValue="Create an Account"/>
1313
</arguments>
14-
1514
<see stepKey="SeeElement" selector="{{StorefrontHeaderSection.headerlinks}}" userInput="{{LinkName}}"/>
16-
<click stepKey="ClickLink" selector="{{StorefrontHeaderSection.HeaderLinkByText(LinkName)}}"/>
17-
<waitForPageLoad stepKey="Wait"/>
1815
</actionGroup>
1916
</actionGroups>
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="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup">
12+
<arguments>
13+
<argument name="message" type="string"/>
14+
</arguments>
15+
<see userInput="{{message}}" selector="{{StorefrontCustomerCreateFormSection.PasswordErrorMessages}}" stepKey="verifyMessage" />
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,24 @@
271271
<requiredEntity type="address">US_Address_TX</requiredEntity>
272272
<requiredEntity type="address">US_Address_NY_Not_Default_Address</requiredEntity>
273273
</entity>
274+
<entity name="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters" type="customer">
275+
<data key="group_id">1</data>
276+
<data key="email" unique="prefix">John.Doe@example.com</data>
277+
<data key="firstname">John</data>
278+
<data key="lastname">Doe</data>
279+
<data key="fullname">John Doe</data>
280+
<data key="password">123123</data>
281+
<data key="store_id">0</data>
282+
<data key="website_id">0</data>
283+
</entity>
284+
<entity name="Simple_Customer_With_Not_Secure_Password" type="customer">
285+
<data key="group_id">1</data>
286+
<data key="email" unique="prefix">John.Doe@example.com</data>
287+
<data key="firstname">John</data>
288+
<data key="lastname">Doe</data>
289+
<data key="fullname">John Doe</data>
290+
<data key="password">123123qa</data>
291+
<data key="store_id">0</data>
292+
<data key="website_id">0</data>
293+
</entity>
274294
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<element name="passwordField" type="input" selector="#password"/>
1818
<element name="confirmPasswordField" type="input" selector="#password-confirmation"/>
1919
<element name="createAccountButton" type="button" selector="button.action.submit.primary" timeout="30"/>
20+
<element name="PasswordErrorMessages" type="text" selector="#password-error"/>
2021
</section>
2122
<section name="StoreFrontCustomerAdvancedAttributesSection">
2223
<element name="textFieldAttribute" type="input" selector="//input[@id='{{var}}']" parameterized="true" />

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,28 @@
2121
<!-- TEST BODY -->
2222
<!-- Go to storefront home page -->
2323
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/>
24+
<!-- See the Registration Link -->
25+
<actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="SeeTheLink"/>
2426
<!-- Click the Registration Link -->
25-
<actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="ClickTheLink">
26-
<argument name="LinkName" value="Create an Account" />
27+
<actionGroup ref="StorefrontClickHeaderLinkActionGroup" stepKey="ClickTheLink">
28+
<argument name="LinkName" value="Create an Account"/>
29+
</actionGroup>
30+
<!-- Fill Registration Form with Password length is bellow 8 Characters -->
31+
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordLengthBellowEightCharacters">
32+
<argument name="customer" value="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters"/>
33+
</actionGroup>
34+
<!-- See the Error -->
35+
<actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordLength">
36+
<argument name="message" value="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored."/>
37+
</actionGroup>
38+
<!-- Fill Registration Form with not secure enough password -->
39+
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordNotSecure">
40+
<argument name="customer" value="Simple_Customer_With_Not_Secure_Password"/>
41+
</actionGroup>
42+
<!-- See the Error -->
43+
<actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordSecure">
44+
<argument name="message" value="Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters."/>
2745
</actionGroup>
28-
<!-- Fill Registry Form with Incorrect Password (Two variations) -->
29-
<actionGroup ref="StorefrontFillRegistryFormActionGroup" stepKey="FillRegistryForm"/>
3046
<!--Test Body END-->
3147

3248
</test>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<data name="customer/data/password" xsi:type="string">123123</data>
1717
<data name="customer/data/password_confirmation" xsi:type="string">123123</data>
1818
<constraint name="Magento\Security\Test\Constraint\AssertPasswordLengthErrorMessage" />
19+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1920
</variation>
2021
<variation name="PasswordComplexityTest" summary="Customer password is not secure enough">
2122
<data name="tag" xsi:type="string">severity:S1</data>
@@ -26,6 +27,7 @@
2627
<data name="customer/data/password" xsi:type="string">123123qa</data>
2728
<data name="customer/data/password_confirmation" xsi:type="string">123123qa</data>
2829
<constraint name="Magento\Security\Test\Constraint\AssertPasswordIsNotSecureEnoughMessage" />
30+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
2931
</variation>
3032
</testCase>
3133
</config>

0 commit comments

Comments
 (0)