Skip to content

Commit b066cea

Browse files
committed
Test refactoring
1 parent dc5ecb8 commit b066cea

File tree

4 files changed

+74
-99
lines changed

4 files changed

+74
-99
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@
381381
</entity>
382382
<entity name="UK_With_State_Default_Billing" extends="UK_Not_Default_Address">
383383
<requiredEntity type="region">RegionUKGL</requiredEntity>
384+
<data key="country">United Kingdom</data>
384385
<data key="state">Greater London</data>
385386
<data key="default_billing">Yes</data>
386387
</entity>

app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AssertOrderAddressInformationActionGroup" extends="VerifyBasicOrderInformationActionGroup">
1212
<remove keyForRemoval="seeCustomerName"/>
1313
<remove keyForRemoval="seeCustomerEmail"/>
1414
<remove keyForRemoval="seeCustomerGroup"/>
1515
<remove keyForRemoval="seeBillingAddressCountry"/>
1616
<remove keyForRemoval="seeShippingAddressCountry"/>
1717
<see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country}}" stepKey="seeBillingCountry" after="seeBillingAddressCity"/>
18+
<see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.state}}" stepKey="seeBillingAddressState" after="seeBillingCountry"/>
1819
<see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country}}" stepKey="seeAddressCountry" after="seeShippingAddressCity"/>
20+
<see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.state}}" stepKey="seeShippingAddressState" after="seeAddressCountry"/>
1921
</actionGroup>
2022
</actionGroups>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="StorefrontCreateOrderWithDifferentAddressesTest">
10+
<annotations>
11+
<stories value="Order billing and shipping addresses should show correctly the entered data"/>
12+
<title value="Billing and Shipping addresses should show correct data on Admin Order View"/>
13+
<description value="Place order on Store Front with manually filled billing address state and selected shipping address state. Check that billing address show correct state on Admin Order View page"/>
14+
<severity value="MINOR"/>
15+
<group value="sales"/>
16+
</annotations>
17+
<before>
18+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
19+
<createData entity="Customer_UK_US" stepKey="createCustomer"/>
20+
</before>
21+
<after>
22+
<deleteData createDataKey="createCustomer" stepKey="deleteCreateCustomer"/>
23+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
24+
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
26+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
27+
</after>
28+
29+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPage">
30+
<argument name="productUrlKey" value="$createSimpleProduct.custom_attributes[url_key]$"/>
31+
</actionGroup>
32+
33+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart">
34+
<argument name="product" value="$$createSimpleProduct$$"/>
35+
<argument name="productCount" value="1"/>
36+
</actionGroup>
37+
38+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckout"/>
39+
<waitForPageLoad stepKey="waitForPaymentSelectionPageLoad"/>
40+
41+
<actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="loginAsCustomer">
42+
<argument name="customer" value="$$createCustomer$$"/>
43+
</actionGroup>
44+
45+
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="gotoPaymentStep"/>
46+
47+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder">
48+
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>
49+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
50+
</actionGroup>
51+
52+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumber"/>
53+
<assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderNumber">
54+
<actualResult type="const">$getOrderNumber</actualResult>
55+
</assertNotEmpty>
56+
57+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
58+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/>
59+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById">
60+
<argument name="orderId" value="$getOrderNumber"/>
61+
</actionGroup>
62+
63+
<actionGroup ref="AssertOrderAddressInformationActionGroup" stepKey="AssertOrderAddressInformation">
64+
<argument name="customer" value=""/>
65+
<argument name="shippingAddress" value="US_Address_NY_Default_Shipping"/>
66+
<argument name="billingAddress" value="UK_With_State_Default_Billing"/>
67+
</actionGroup>
68+
<dontSee selector="{{AdminShipmentAddressInformationSection.billingAddress}}" userInput="{{US_Address_NY_Default_Shipping.state}}" stepKey="dontSeeShippingAddressStateAtBillingAddress"/>
69+
</test>
70+
</tests>

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

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

0 commit comments

Comments
 (0)