Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit 367f236

Browse files
authored
Merge pull request #118 from magento-pangolin/MC-4772
MC-4772
2 parents fd6cb8d + dcd068c commit 367f236

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<element name="reorder" type="button" selector="#order_reorder" timeout="30"/>
2121
<element name="edit" type="button" selector="#order_edit" timeout="30"/>
2222
<element name="modalOk" type="button" selector=".action-accept"/>
23+
<element name="unhold" type="button" selector="#order-view-unhold-button" timeout="30"/>
2324
<element name="invoiceBtn" type="button" selector="//button[@title='Invoice']"/>
2425
<element name="shipBtn" type="button" selector="//button[@title='Ship']"/>
2526
<element name="shipmentsTab" type="button" selector="#sales_order_view_tabs_order_shipments"/>
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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="AdminHoldCreatedOrderTest">
12+
<annotations>
13+
<group value="sales"/>
14+
<stories value="Hold Created Order"/>
15+
<title value="Hold the created order"/>
16+
<description value="Create an order and hold the order"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-16160"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
25+
<!--Set default flat rate shipping method settings-->
26+
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
27+
28+
<!--Create simple customer-->
29+
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/>
30+
31+
<!-- Create Simple Products -->
32+
<createData entity="SimpleProduct2" stepKey="simpleProduct">
33+
<field key="price">10.00</field>
34+
</createData>
35+
<createData entity="SimpleProduct2" stepKey="simpleProduct1">
36+
<field key="price">20.00</field>
37+
</createData>
38+
</before>
39+
<after>
40+
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
41+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
42+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
43+
<actionGroup ref="logout" stepKey="logout"/>
44+
</after>
45+
46+
<!--Create new customer order-->
47+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
48+
<argument name="customer" value="$$simpleCustomer$$"/>
49+
</actionGroup>
50+
51+
<!--Add Simple product to order-->
52+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder">
53+
<argument name="product" value="$$simpleProduct$$"/>
54+
</actionGroup>
55+
56+
<!--Add second product to order-->
57+
<actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProductToTheOrder">
58+
<argument name="product" value="$$simpleProduct1$$"/>
59+
</actionGroup>
60+
61+
<!--Select FlatRate shipping method-->
62+
<actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>
63+
64+
<!-- Submit order -->
65+
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/>
66+
67+
<!-- Verify order information -->
68+
<actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/>
69+
<grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/>
70+
71+
<!-- Hold the Order -->
72+
<click selector="{{AdminOrderDetailsMainActionsSection.hold}}" stepKey="clickOnHoldButton"/>
73+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You put the order on hold" stepKey="seeSuccessHoldMessage"/>
74+
75+
<!--Assert Order Status and Unhold button-->
76+
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="On Hold" stepKey="seeOrderStatusOnHold"/>
77+
<seeElement selector="{{AdminOrderDetailsMainActionsSection.unhold}}" stepKey="seeUnholdButton"/>
78+
79+
<!--Assert invoice, cancel, reorder, ship, and edit buttons are unavailable-->
80+
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="dontSeeInvoiceButton"/>
81+
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="dontSeeCancelButton"/>
82+
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.reorder}}" stepKey="dontSeeReorderButton"/>
83+
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="dontSeeShipButton"/>
84+
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.edit}}" stepKey="dontSeeEditButton"/>
85+
86+
<!--Log in to Storefront as Customer -->
87+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp">
88+
<argument name="Customer" value="$$simpleCustomer$$"/>
89+
</actionGroup>
90+
91+
<!-- Assert OrderId and status in frontend order grid -->
92+
<click selector="{{StorefrontCustomerSidebarSection.sidebarCurrentTab('My Orders')}}" stepKey="clickOnMyOrders"/>
93+
<waitForPageLoad stepKey="waitForOrderDetailsToLoad"/>
94+
<seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'On Hold')}}" stepKey="seeOrderStatusInGrid"/>
95+
</test>
96+
</tests>

dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/HoldCreatedOrderTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</data>
1414
<data name="orderButtonsUnavailable" xsi:type="string">Invoice,Cancel,Reorder,Ship,Edit</data>
1515
<data name="status" xsi:type="string">On Hold</data>
16+
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
1617
<constraint name="Magento\Sales\Test\Constraint\AssertOrderOnHoldSuccessMessage" />
1718
<constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsUnavailable" />
1819
<constraint name="Magento\Sales\Test\Constraint\AssertUnholdButton" />

0 commit comments

Comments
 (0)