Skip to content

Commit 4249d2e

Browse files
DmitryTsymbalokolesnyk
authored andcommitted
refactoring
1 parent 090b9c7 commit 4249d2e

File tree

3 files changed

+28
-39
lines changed

3 files changed

+28
-39
lines changed

app/code/Magento/Customer/Test/Mftf/ActionGroup/StoreFrontCustomerChangeEmailWithIncorrectActionGroup.xml

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

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

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,52 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="SecureChangingCustomerEmailTest">
1212
<annotations>
13-
<features value="Security" />
14-
<stories value="Changing Customer's email" />
15-
<title value="Changing Customer Email Test" />
16-
<description value="Changing Customer's email with correct and wrong passwords" />
17-
<group value="security" />
18-
<group value="mtf_migrated" />
13+
<features value="Security"/>
14+
<stories value="Changing Customer's email"/>
15+
<title value="Changing Customer Email Test"/>
16+
<description value="Changing Customer's email with correct and wrong passwords"/>
17+
<group value="security"/>
18+
<group value="mtf_migrated"/>
1919
</annotations>
2020

2121
<before>
22-
<createData entity="Simple_US_Customer" stepKey="customer" />
22+
<createData entity="Simple_US_Customer" stepKey="customer"/>
2323
</before>
2424
<after>
25-
<deleteData createDataKey="customer" stepKey="deleteCustomer" />
25+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
2626
</after>
2727

2828
<!-- TEST BODY -->
2929
<!-- Go to storefront home page -->
30-
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage" />
30+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/>
3131
<!-- Login as created customer -->
3232
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
33-
<argument name="Customer" value="$$customer$$" />
33+
<argument name="Customer" value="$$customer$$"/>
3434
</actionGroup>
3535
<!-- Navigate to "Account Information" tab First Time-->
36-
<actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageFirstTime" />
36+
<actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageFirstTime"/>
3737
<!-- Checking Email checkbox, entering new email, saving with correct password -->
3838
<actionGroup ref="StorefrontCustomerChangeEmailActionGroup" stepKey="changeEmailCorrectAttempt">
39-
<argument name="email" value="$$customer.email$$" />
40-
<argument name="password" value="$$customer.password$$" />
39+
<argument name="email" value="$$customer.email$$"/>
40+
<argument name="password" value="$$customer.password$$"/>
41+
</actionGroup>
42+
<!-- See Success Notify-->
43+
<actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="seeSuccessMessage">
44+
<argument name="message" value="You saved the account information."/>
4145
</actionGroup>
4246
<!-- Navigate to "Account Information" tab Second Time-->
4347
<actionGroup ref="StorefrontOpenCustomerAccountInfoEditPageActionGroup" stepKey="goToCustomerEditPageSecondTime" />
4448
<!-- Checking Email checkbox, entering new email, saving with incorrect password -->
45-
<actionGroup ref="StoreFrontCustomerChangeEmailWithIncorrectActionGroup" stepKey="changeEmailWrongAttempt">
46-
<argument name="email" value="$$customer.email$$" />
47-
<argument name="password" value="{incorrect.password}" />
49+
<actionGroup ref="StorefrontCustomerChangeEmailActionGroup" stepKey="changeEmailWrongAttempt">
50+
<argument name="email" value="$$customer.email$$"/>
51+
<argument name="password" value="{incorrect.password}"/>
52+
</actionGroup>
53+
<!-- See Failure Message-->
54+
<actionGroup ref="AssertMessageCustomerChangeAccountInfoActionGroup" stepKey="seeFailureMessage">
55+
<argument name="message" value="The password doesn't match this account. Verify the password and try again."/>
56+
<argument name="messageType" value="error"/>
4857
</actionGroup>
58+
4959
<!-- END TEST BODY -->
5060

5161
</test>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
<data name="customer/data/current_password" xsi:type="string">123123^q</data>
1515
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerInfoSuccessSavedMessage" />
1616
<constraint name="Magento\Security\Test\Constraint\AssertCustomerEmailChanged" />
17+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1718
</variation>
1819
<variation name="SecureChangingEmailV2" summary="Change Email checkbox is checked, enter new email, wrong password">
1920
<data name="tag" xsi:type="string">severity:S2</data>
2021
<data name="initialCustomer/dataset" xsi:type="string">default</data>
2122
<data name="customer/data/email" xsi:type="string">JaneDoe_%isolation%@example.com</data>
2223
<data name="customer/data/current_password" xsi:type="string">123123123</data>
2324
<constraint name="Magento\Customer\Test\Constraint\AssertChangePasswordFailMessage" />
25+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
2426
</variation>
2527
</testCase>
2628
</config>

0 commit comments

Comments
 (0)