Skip to content

Commit 09aec3d

Browse files
committed
MC-37657: A saved VAT Number is not displayed when placing an order by Admin on a Customer behalf
1 parent df50d63 commit 09aec3d

File tree

4 files changed

+61
-24
lines changed

4 files changed

+61
-24
lines changed

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,7 @@
233233
<data key="website_id">0</data>
234234
<requiredEntity type="address">UK_Not_Default_Address</requiredEntity>
235235
</entity>
236-
<entity name="Customer_With_Vat_Number" type="customer">
237-
<data key="group_id">1</data>
238-
<data key="email" unique="prefix">[email protected]</data>
239-
<data key="firstname">John</data>
240-
<data key="lastname">Doe</data>
241-
<data key="fullname">John Doe</data>
242-
<data key="password">pwdTest123!</data>
243-
<data key="store_id">0</data>
244-
<data key="website_id">0</data>
236+
<entity name="Customer_With_Vat_Number" type="customer" extends="Simple_Customer_Without_Address">
245237
<requiredEntity type="address">US_With_Vat_Number</requiredEntity>
246238
</entity>
247239
<entity name="Customer_With_Different_Default_Billing_Shipping_Addresses" type="customer">
Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,53 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="AssertAdminFieldsFilledDefaultBillingAddressActionGroup">
10+
<actionGroup name="AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup">
1111
<annotations>
1212
<description>Admin assert fields filled default billing address from customer</description>
1313
</annotations>
1414
<arguments>
15-
<argument name="firstName" type="string" defaultValue="John"/>
16-
<argument name="lastName" type="string" defaultValue="Doe"/>
17-
<argument name="company" type="string" defaultValue="Magento"/>
18-
<argument name="streetLine1" type="string" defaultValue="7700 West Parmer Lane"/>
19-
<argument name="streetLine2" type="string" defaultValue="113"/>
20-
<argument name="city" type="string" defaultValue="Los Angeles"/>
21-
<argument name="postcode" type="string" defaultValue="90001"/>
22-
<argument name="phone" type="string" defaultValue="512-345-6789"/>
23-
<argument name="vatNumber" type="string" defaultValue="U1234567891"/>
15+
<argument name="namePrefix" type="string" defaultValue=""/>
16+
<argument name="firstName" type="string" defaultValue="{{US_Address_CA.firstname}}"/>
17+
<argument name="middleName" type="string" defaultValue=""/>
18+
<argument name="lastName" type="string" defaultValue="{{US_Address_CA.lastname}}"/>
19+
<argument name="nameSuffix" type="string" defaultValue=""/>
20+
<argument name="company" type="string" defaultValue="{{US_Address_CA.company}}"/>
21+
<argument name="streetLine1" type="string" defaultValue="{{US_Address_CA.street[0]}}"/>
22+
<argument name="streetLine2" type="string" defaultValue="{{US_Address_CA.street[1]}}"/>
23+
<argument name="country" type="string" defaultValue="{{US_Address_CA.country}}"/>
24+
<argument name="state" type="string" defaultValue="{{US_Address_CA.state}}"/>
25+
<argument name="province" type="string" defaultValue=""/>
26+
<argument name="city" type="string" defaultValue="{{US_Address_CA.city}}"/>
27+
<argument name="postcode" type="string" defaultValue="{{US_Address_CA.postcode}}"/>
28+
<argument name="phone" type="string" defaultValue="{{US_Address_CA.telephone}}"/>
29+
<argument name="fax" type="string" defaultValue=""/>
30+
<argument name="vatNumber" type="string" defaultValue="{{US_With_Vat_Number.vat_id}}"/>
2431
</arguments>
32+
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.NamePrefix}}" stepKey="getNamePrefix"/>
33+
<assertEquals stepKey="assertNamePrefix">
34+
<expectedResult type="string">{{namePrefix}}</expectedResult>
35+
<actualResult type="variable">getNamePrefix</actualResult>
36+
</assertEquals>
2537
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="getFirstName"/>
2638
<assertEquals stepKey="assertFirstName">
2739
<expectedResult type="string">{{firstName}}</expectedResult>
2840
<actualResult type="variable">getFirstName</actualResult>
2941
</assertEquals>
42+
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.MiddleName}}" stepKey="getMiddleName"/>
43+
<assertEquals stepKey="assertMiddleName">
44+
<expectedResult type="string">{{middleName}}</expectedResult>
45+
<actualResult type="variable">getMiddleName</actualResult>
46+
</assertEquals>
3047
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="getLastName"/>
3148
<assertEquals stepKey="assertLastName">
3249
<expectedResult type="string">{{lastName}}</expectedResult>
3350
<actualResult type="variable">getLastName</actualResult>
3451
</assertEquals>
52+
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.NameSuffix}}" stepKey="getNameSuffix"/>
53+
<assertEquals stepKey="assertNameSuffix">
54+
<expectedResult type="string">{{nameSuffix}}</expectedResult>
55+
<actualResult type="variable">getNameSuffix</actualResult>
56+
</assertEquals>
3557
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Company}}" stepKey="getCompany"/>
3658
<assertEquals stepKey="assertCompany">
3759
<expectedResult type="string">{{company}}</expectedResult>
@@ -47,21 +69,41 @@
4769
<expectedResult type="string">{{streetLine2}}</expectedResult>
4870
<actualResult type="variable">getStreetLine2</actualResult>
4971
</assertEquals>
72+
<grabTextFrom selector="{{AdminOrderFormBillingAddressSection.countrySelectedOption}}" stepKey="getCountrySelectedOption"/>
73+
<assertEquals stepKey="assertCountrySelectedOption">
74+
<expectedResult type="string">{{country}}</expectedResult>
75+
<actualResult type="variable">getCountrySelectedOption</actualResult>
76+
</assertEquals>
77+
<grabTextFrom selector="{{AdminOrderFormBillingAddressSection.stateSelectedOption}}" stepKey="getStateSelectedOption"/>
78+
<assertEquals stepKey="assertStateSelectedOption">
79+
<expectedResult type="string">{{state}}</expectedResult>
80+
<actualResult type="variable">getStateSelectedOption</actualResult>
81+
</assertEquals>
82+
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Province}}" stepKey="getProvince"/>
83+
<assertEquals stepKey="assertProvince">
84+
<expectedResult type="string">{{province}}</expectedResult>
85+
<actualResult type="variable">getProvince</actualResult>
86+
</assertEquals>
5087
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="getCity"/>
5188
<assertEquals stepKey="assertCity">
5289
<expectedResult type="string">{{city}}</expectedResult>
5390
<actualResult type="variable">getCity</actualResult>
5491
</assertEquals>
55-
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="getPostcode"/>
56-
<assertEquals stepKey="assertPostcode">
92+
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="getPostCode"/>
93+
<assertEquals stepKey="assertPostCode">
5794
<expectedResult type="string">{{postcode}}</expectedResult>
58-
<actualResult type="variable">getPostcode</actualResult>
95+
<actualResult type="variable">getPostCode</actualResult>
5996
</assertEquals>
6097
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="getPhone"/>
6198
<assertEquals stepKey="assertPhone">
6299
<expectedResult type="string">{{phone}}</expectedResult>
63100
<actualResult type="variable">getPhone</actualResult>
64101
</assertEquals>
102+
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.Fax}}" stepKey="getFax"/>
103+
<assertEquals stepKey="assertFax">
104+
<expectedResult type="string">{{fax}}</expectedResult>
105+
<actualResult type="variable">getFax</actualResult>
106+
</assertEquals>
65107
<grabValueFrom selector="{{AdminOrderFormBillingAddressSection.VatNumber}}" stepKey="getVatNumber"/>
66108
<assertEquals stepKey="assertVatNumber">
67109
<expectedResult type="string">{{vatNumber}}</expectedResult>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormBillingAddressSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
<element name="StreetLine2" type="input" selector="#order-billing_address_street1" timeout="30"/>
2121
<element name="City" type="input" selector="#order-billing_address_city" timeout="30"/>
2222
<element name="Country" type="select" selector="#order-billing_address_country_id" timeout="30"/>
23+
<element name="countrySelectedOption" type="select" selector="#order-billing_address_country_id option:checked"/>
2324
<element name="State" type="select" selector="#order-billing_address_region_id" timeout="30"/>
25+
<element name="stateSelectedOption" type="select" selector="#order-billing_address_region_id option:checked"/>
2426
<element name="Province" type="input" selector="#order-billing_address_region" timeout="30"/>
2527
<element name="PostalCode" type="input" selector="#order-billing_address_postcode" timeout="30"/>
2628
<element name="Phone" type="input" selector="#order-billing_address_telephone" timeout="30"/>

app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingFieldsFilledFromDefaultBillingAddressCustomerInNewOrderTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
<severity value="AVERAGE"/>
1717
<testCaseId value="MC-40646"/>
1818
<useCaseId value="MC-37657"/>
19-
<group value="Sales"/>
19+
<group value="sales"/>
20+
<group value="customer"/>
2021
</annotations>
2122
<before>
2223
<createData entity="Customer_With_Vat_Number" stepKey="createCustomer"/>
@@ -30,6 +31,6 @@
3031
<actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer">
3132
<argument name="customer" value="$createCustomer$"/>
3233
</actionGroup>
33-
<actionGroup ref="AssertAdminFieldsFilledDefaultBillingAddressActionGroup" stepKey="assertFieldsFilled"/>
34+
<actionGroup ref="AssertAdminBillingAddressFieldsOnOrderCreateFormActionGroup" stepKey="assertFieldsFilled"/>
3435
</test>
3536
</tests>

0 commit comments

Comments
 (0)