Skip to content

Commit

Permalink
Merge pull request magento#118 from magento-pangolin/MC-4772
Browse files Browse the repository at this point in the history
MC-4772
  • Loading branch information
soumyau authored May 24, 2019
2 parents fd6cb8d + dcd068c commit 367f236
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<element name="reorder" type="button" selector="#order_reorder" timeout="30"/>
<element name="edit" type="button" selector="#order_edit" timeout="30"/>
<element name="modalOk" type="button" selector=".action-accept"/>
<element name="unhold" type="button" selector="#order-view-unhold-button" timeout="30"/>
<element name="invoiceBtn" type="button" selector="//button[@title='Invoice']"/>
<element name="shipBtn" type="button" selector="//button[@title='Ship']"/>
<element name="shipmentsTab" type="button" selector="#sales_order_view_tabs_order_shipments"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminHoldCreatedOrderTest">
<annotations>
<group value="sales"/>
<stories value="Hold Created Order"/>
<title value="Hold the created order"/>
<description value="Create an order and hold the order"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-16160"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>

<!--Set default flat rate shipping method settings-->
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>

<!--Create simple customer-->
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/>

<!-- Create Simple Products -->
<createData entity="SimpleProduct2" stepKey="simpleProduct">
<field key="price">10.00</field>
</createData>
<createData entity="SimpleProduct2" stepKey="simpleProduct1">
<field key="price">20.00</field>
</createData>
</before>
<after>
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Create new customer order-->
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
<argument name="customer" value="$$simpleCustomer$$"/>
</actionGroup>

<!--Add Simple product to order-->
<actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder">
<argument name="product" value="$$simpleProduct$$"/>
</actionGroup>

<!--Add second product to order-->
<actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProductToTheOrder">
<argument name="product" value="$$simpleProduct1$$"/>
</actionGroup>

<!--Select FlatRate shipping method-->
<actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>

<!-- Submit order -->
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/>

<!-- Verify order information -->
<actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/>
<grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/>

<!-- Hold the Order -->
<click selector="{{AdminOrderDetailsMainActionsSection.hold}}" stepKey="clickOnHoldButton"/>
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You put the order on hold" stepKey="seeSuccessHoldMessage"/>

<!--Assert Order Status and Unhold button-->
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="On Hold" stepKey="seeOrderStatusOnHold"/>
<seeElement selector="{{AdminOrderDetailsMainActionsSection.unhold}}" stepKey="seeUnholdButton"/>

<!--Assert invoice, cancel, reorder, ship, and edit buttons are unavailable-->
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="dontSeeInvoiceButton"/>
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="dontSeeCancelButton"/>
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.reorder}}" stepKey="dontSeeReorderButton"/>
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="dontSeeShipButton"/>
<dontSeeElement selector="{{AdminOrderDetailsMainActionsSection.edit}}" stepKey="dontSeeEditButton"/>

<!--Log in to Storefront as Customer -->
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp">
<argument name="Customer" value="$$simpleCustomer$$"/>
</actionGroup>

<!-- Assert OrderId and status in frontend order grid -->
<click selector="{{StorefrontCustomerSidebarSection.sidebarCurrentTab('My Orders')}}" stepKey="clickOnMyOrders"/>
<waitForPageLoad stepKey="waitForOrderDetailsToLoad"/>
<seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'On Hold')}}" stepKey="seeOrderStatusInGrid"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<data name="order/data/entity_id/products" xsi:type="string">catalogProductSimple::default,catalogProductSimple::default</data>
<data name="orderButtonsUnavailable" xsi:type="string">Invoice,Cancel,Reorder,Ship,Edit</data>
<data name="status" xsi:type="string">On Hold</data>
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
<constraint name="Magento\Sales\Test\Constraint\AssertOrderOnHoldSuccessMessage" />
<constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsUnavailable" />
<constraint name="Magento\Sales\Test\Constraint\AssertUnholdButton" />
Expand Down

0 comments on commit 367f236

Please sign in to comment.