Skip to content

Commit 4164dfc

Browse files
committed
Convert CreateExistingCustomerFrontendEntity to MFTF
1 parent 7270d7e commit 4164dfc

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<arguments>
5858
<argument name="Address"/>
5959
</arguments>
60-
60+
6161
<amOnPage url="customer/address/new/" stepKey="goToAddressPage"/>
6262
<waitForPageLoad stepKey="waitForAddressPage"/>
6363
<fillField stepKey="fillFirstName" selector="{{StorefrontCustomerAddressSection.firstName}}" userInput="{{Address.firstname}}"/>
@@ -154,4 +154,11 @@
154154
<waitForPageLoad stepKey="waitForRegistered" after="clickCreateAccountButton"/>
155155
<remove keyForRemoval="seeThankYouMessage"/>
156156
</actionGroup>
157+
158+
<actionGroup name="SignUpNewCustomerNoAssertions" extends="SignUpNewUserFromStorefrontActionGroup">
159+
<remove keyForRemoval="seeThankYouMessage"/>
160+
<remove keyForRemoval="seeFirstName"/>
161+
<remove keyForRemoval="seeLastName"/>
162+
<remove keyForRemoval="seeEmail"/>
163+
</actionGroup>
157164
</actionGroups>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
<data key="disable_auto_group_change">0</data>
3434
<!--requiredEntity type="extension_attribute">ExtensionAttributeSimple</requiredEntity-->
3535
</entity>
36+
<entity name="CustomerEntityOneNotUniqueEmail" extends="CustomerEntityOne" type="customer">
37+
<data key="email">test@email.com</data>
38+
</entity>
3639
<entity name="Simple_US_Customer" type="customer">
3740
<data key="group_id">1</data>
3841
<data key="default_billing">true</data>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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="StorefrontCreateExistingCustomerTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<title value="Attempt to register customer on storefront with existing email"/>
15+
<description value="Attempt to register customer on storefront with existing email"/>
16+
<group value="customers"/>
17+
<group value="mtf_migrated"/>
18+
</annotations>
19+
<before>
20+
<createData stepKey="customer" entity="CustomerEntityOneNotUniqueEmail"/>
21+
</before>
22+
<after>
23+
<deleteData stepKey="deleteCustomer" createDataKey="customer" />
24+
</after>
25+
26+
<actionGroup ref="SignUpNewCustomerNoAssertions" stepKey="SignUpNewUser">
27+
<argument name="Customer" value="CustomerEntityOneNotUniqueEmail"/>
28+
</actionGroup>
29+
<waitForElementVisible selector="{{StorefrontCustomerMessagesSection.errorMessage}}" stepKey="waitForErrorMessage" />
30+
<see stepKey="seeErrorMessage" userInput="There is already an account with this email address." selector="{{StorefrontCustomerMessagesSection.errorMessage}}"/>
31+
</test>
32+
</tests>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<data name="customer/data/password" xsi:type="string">123123q#</data>
1515
<data name="customer/data/password_confirmation" xsi:type="string">123123q#</data>
1616
<data name="customer/data/website_id/dataset" xsi:type="string">default</data>
17+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1718
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerFailRegisterMessage" />
1819
</variation>
1920
</testCase>

0 commit comments

Comments
 (0)