Skip to content

Commit 85c48b7

Browse files
committed
MC-37496: Create automated test for "Reorder Order from Admin for Offline Payment Methods"
1 parent 97191ce commit 85c48b7

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminAssertOrderShippingMethodActionGroup">
12+
<annotations>
13+
<description>Assert that shipping method and shipping price is present for the order.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="shippingMethod" type="string" defaultValue="Flat Rate - Fixed"/>
17+
<argument name="shippingPrice" type="string"/>
18+
</arguments>
19+
<see selector="{{AdminOrderShippingInformationSection.shippingMethod}}" userInput="{{shippingMethod}}" stepKey="seeShippingMethod"/>
20+
<see selector="{{AdminOrderShippingInformationSection.shippingPrice}}" userInput="{{shippingPrice}}" stepKey="seeShippingMethodPrice"/>
21+
</actionGroup>
22+
</actionGroups>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<data key="postcode">78758</data>
2525
<data key="email" unique="prefix">[email protected]</data>
2626
<data key="telephone">512-345-6789</data>
27+
<data key="country">United States</data>
2728
</entity>
2829
<entity name="BillingAddressTX" type="billing_address">
2930
<data key="firstname">Joe</data>
@@ -41,5 +42,6 @@
4142
<data key="postcode">78758</data>
4243
<data key="email" unique="prefix">[email protected]</data>
4344
<data key="telephone">512-345-6789</data>
45+
<data key="country">United States</data>
4446
</entity>
4547
</entities>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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="AdminReorderOrderWithOfflinePaymentMethodTest">
12+
<annotations>
13+
<features value="Sales"/>
14+
<stories value="Reorder"/>
15+
<title value="Reorder Order from Admin for Offline Payment Methods"/>
16+
<description value="Create reorder for order with two products and Check Money payment method"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-37495"/>
19+
<group value="sales"/>
20+
</annotations>
21+
<before>
22+
<magentoCLI command="config:set {{enabledCheckMoneyOrder.label}} {{enabledCheckMoneyOrder.value}}" stepKey="enableCheckMoneyOrder"/>
23+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
24+
<createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/>
25+
<createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct"/>
26+
<createData entity="SimpleProduct2" stepKey="createSecondSimpleProduct"/>
27+
<createData entity="CustomerCart" stepKey="createCartForCustomer">
28+
<requiredEntity createDataKey="createCustomer"/>
29+
</createData>
30+
<createData entity="CustomerCartItem" stepKey="addFirstProductToCustomerCart">
31+
<requiredEntity createDataKey="createCartForCustomer"/>
32+
<requiredEntity createDataKey="createFirstSimpleProduct"/>
33+
</createData>
34+
<createData entity="CustomerCartItem" stepKey="addSecondProductToCustomerCart">
35+
<requiredEntity createDataKey="createCartForCustomer"/>
36+
<requiredEntity createDataKey="createSecondSimpleProduct"/>
37+
</createData>
38+
<createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress">
39+
<requiredEntity createDataKey="createCartForCustomer"/>
40+
</createData>
41+
<updateData createDataKey="createCartForCustomer" entity="CustomerOrderPaymentMethod" stepKey="sendCustomerPaymentInformation">
42+
<requiredEntity createDataKey="createCartForCustomer"/>
43+
</updateData>
44+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
45+
</before>
46+
<after>
47+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
48+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
49+
<deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
50+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminPanel"/>
51+
</after>
52+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrderById">
53+
<argument name="entityId" value="$createCartForCustomer.return$"/>
54+
</actionGroup>
55+
<click selector="{{AdminOrderDetailsMainActionsSection.reorder}}" stepKey="clickReorderButton"/>
56+
<actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitReorder"/>
57+
<actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/>
58+
<actionGroup ref="AssertOrderAddressInformationActionGroup" stepKey="verifyOrderInformation">
59+
<argument name="customer" value="$createCustomer$"/>
60+
<argument name="shippingAddress" value="ShippingAddressTX"/>
61+
<argument name="billingAddress" value="BillingAddressTX"/>
62+
</actionGroup>
63+
<see selector="{{AdminOrderDetailsInformationSection.paymentInformation}}" userInput="Check / Money order" stepKey="seePaymentMethod"/>
64+
<actionGroup ref="AdminAssertOrderShippingMethodActionGroup" stepKey="assertShippingOrderInformation">
65+
<argument name="shippingPrice" value="$10.00"/>
66+
</actionGroup>
67+
<actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeFirstProductInItemsOrdered">
68+
<argument name="product" value="$createFirstSimpleProduct$"/>
69+
</actionGroup>
70+
<actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeSecondProductInItemsOrdered">
71+
<argument name="product" value="$createSecondSimpleProduct$"/>
72+
</actionGroup>
73+
</test>
74+
</tests>

0 commit comments

Comments
 (0)