|
| 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" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminAbleToShipPartiallyInvoicedItemsTest"> |
| 11 | + <annotations> |
| 12 | + <title value="Ship Action is available for remaining of the partially invoiced items "/> |
| 13 | + <description value="Admin should be able to ship remaining ordered items if some of them are already refunded"/> |
| 14 | + <severity value="CRITICAL"/> |
| 15 | + <testCaseId value="MAGETWO-93030"/> |
| 16 | + <group value="sales"/> |
| 17 | + |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 21 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 22 | + <requiredEntity createDataKey="createCategory"/> |
| 23 | + </createData> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 27 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 28 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 29 | + </after> |
| 30 | + |
| 31 | + <!--login to Admin--> |
| 32 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 33 | + <comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/> |
| 34 | + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> |
| 35 | + <waitForPageLoad stepKey="waitForIndexPageLoad"/> |
| 36 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> |
| 37 | + |
| 38 | + <!--Create new order--> |
| 39 | + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> |
| 40 | + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> |
| 41 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> |
| 42 | + <actionGroup ref="addSimpleProductToOrderWithCustomQuantity" stepKey="addSimpleProductToOrderWithUserDefinedQty"> |
| 43 | + <argument name="product" value="_defaultProduct"/> |
| 44 | + <argument name="quantity" value="10"/> |
| 45 | + </actionGroup> |
| 46 | + |
| 47 | + <!--Fill customer group and customer email which both are now required fields--> |
| 48 | + <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="addSimpleProductToOrderWithUserDefinedQty"/> |
| 49 | + <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> |
| 50 | + |
| 51 | + <!--Fill customer address information--> |
| 52 | + <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillCustomerEmail"> |
| 53 | + <argument name="customer" value="Simple_US_Customer"/> |
| 54 | + <argument name="address" value="US_Address_TX"/> |
| 55 | + </actionGroup> |
| 56 | + <!-- Select shipping --> |
| 57 | + <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> |
| 58 | + |
| 59 | + <!--Verify totals on Order page--> |
| 60 | + <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="$1,230.00" stepKey="seeOrderSubTotal" after="selectFlatRateShipping"/> |
| 61 | + <see selector="{{AdminOrderFormTotalSection.total('Shipping')}}" userInput="$50.00" stepKey="seeOrderShipping" after="seeOrderSubTotal"/> |
| 62 | + <scrollTo selector="{{AdminOrderFormTotalSection.grandTotal}}" stepKey="scrollToOrderGrandTotal"/> |
| 63 | + <see selector="{{AdminOrderFormTotalSection.grandTotal}}" userInput="$1,280.00" stepKey="seeCorrectGrandTotal" after="scrollToOrderGrandTotal"/> |
| 64 | + |
| 65 | + <!--Submit Order and verify information--> |
| 66 | + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder" after="seeCorrectGrandTotal"/> |
| 67 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskTodisappear"/> |
| 68 | + <waitForPageLoad stepKey="waitForOrderToProcess"/> |
| 69 | + <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage" after="clickSubmitOrder"/> |
| 70 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage" after="seeViewOrderPage"/> |
| 71 | + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeSuccessMessage"/> |
| 72 | + <scrollTo selector="{{AdminOrderItemsOrderedSection.qtyColumn}}" stepKey="scrollToItemsOrdered" after="getOrderId"/> |
| 73 | + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Ordered 10" stepKey="seeQtyOfItemsOrdered" after="scrollToItemsOrdered"/> |
| 74 | + |
| 75 | + <!--Create order invoice for first half of ordered items--> |
| 76 | + <comment userInput="Admin creates invoice for order" stepKey="adminCreateInvoiceComment" /> |
| 77 | + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceActionButton"/> |
| 78 | + <!--<seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl" after="clickInvoiceAction"/>--> |
| 79 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage" after="clickInvoiceActionButton"/> |
| 80 | + <scrollTo selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" stepKey="scrollToItemsInvoiced"/> |
| 81 | + |
| 82 | + <!--Verify items invoiced information--> |
| 83 | + <fillField selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" userInput="5" stepKey="invoiceHalfTheItems"/> |
| 84 | + <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQtyToBeInvoiced"/> |
| 85 | + <waitForLoadingMaskToDisappear stepKey="WaitForQtyToUpdate"/> |
| 86 | + <waitForElementVisible selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="waitforSubmitInvoiceBtn"/> |
| 87 | + |
| 88 | + <!--Submit Invoice--> |
| 89 | + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice"/> |
| 90 | + <waitForLoadingMaskToDisappear stepKey="WaitForInvoiceToSubmit"/> |
| 91 | + <!--<waitForElementVisible selector="{{AdminOrderDetailsMessagesSection.successMessage}}" stepKey="waitUntilInvoiceSucesssMsg"/>--> |
| 92 | + |
| 93 | + <!--Invoice created successfully--> |
| 94 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeInvoiceSuccessMessage"/> |
| 95 | + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoicesTab"/> |
| 96 | + <waitForLoadingMaskToDisappear stepKey="waitForInvoiceGridToLoad" after="clickInvoicesTab"/> |
| 97 | + <see selector="{{AdminOrderInvoicesTabSection.gridRow('1')}}" userInput="$665.00" stepKey="seeOrderInvoiceTabInGrid" after="waitForInvoiceGridToLoad"/> |
| 98 | + <click selector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" stepKey="clickToViewInvoice" after="seeOrderInvoiceTabInGrid"/> |
| 99 | + <click selector="{{AdminInvoiceOrderInformationSection.orderId}}" stepKey="clickOrderIdLinkOnInvoice"/> |
| 100 | + |
| 101 | + <!--Ship Order--> |
| 102 | + <comment userInput="Admin creates shipment" stepKey="adminCreatesShipmentComment" before="clickShip"/> |
| 103 | + <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShip" after="clickOrderIdLinkOnInvoice"/> |
| 104 | + <seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="OrderShipmentUrl" after="clickShip"/> |
| 105 | + <scrollTo selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" stepKey="scrollToItemsToShip"/> |
| 106 | + <see selector="{{AdminShipmentItemsSection.itemQty('1')}}" userInput="Invoiced 5" stepKey="see5itemsInvoiced"/> |
| 107 | + <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="5" stepKey="fillQtyOfItemsToShip"/> |
| 108 | + |
| 109 | + <!--Submit Shipment--> |
| 110 | + <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="submitShipment" after="fillQtyOfItemsToShip"/> |
| 111 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="successfullShipmentCreation" after="submitShipment"/> |
| 112 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="$getOrderId" stepKey="seeOrderIdInPageTitleAfterShip"/> |
| 113 | + |
| 114 | + <!--Verify Items Status and Shipped Qty in the Items Ordered section--> |
| 115 | + <scrollTo selector="{{AdminOrderItemsOrderedSection.itemStatus('1')}}" stepKey="scrollToItemsShipped"/> |
| 116 | + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Shipped 5" stepKey="see5itemsShipped"/> |
| 117 | + |
| 118 | + <!--Create Credit Memo--> |
| 119 | + <comment userInput="Admin creates credit memo" stepKey="createCreditMemoComment"/> |
| 120 | + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemo" after="createCreditMemoComment"/> |
| 121 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoInPageTitle"/> |
| 122 | + |
| 123 | + <!--Submit refund--> |
| 124 | + <scrollTo selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" stepKey="scrollToItemsToRefund"/> |
| 125 | + <!--<fillField selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" userInput="5" stepKey="fillQtyOfItemsToRefund" after="scrollToItemsToRefund"/>--> |
| 126 | + <!--<click selector="{{AdminCreditMemoItemsSection.updateQty}}" stepKey="updateRefundQty"/>--> |
| 127 | + <waitForLoadingMaskToDisappear stepKey="waitForRefundQtyToUpdate"/> |
| 128 | + <waitForElementVisible selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="seeSubmitRefundBtn"/> |
| 129 | + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="submitRefundOffline"/> |
| 130 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the credit memo." stepKey="seeCreditMemoSuccessMsg" after="submitRefundOffline"/> |
| 131 | + |
| 132 | + <!--Create invoice for rest of the ordered items--> |
| 133 | + <comment userInput="Admin creates invoice for rest of the items" stepKey="adminCreateInvoiceComment2" /> |
| 134 | + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceActionForRestOfItems"/> |
| 135 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage2" after="clickInvoiceActionForRestOfItems"/> |
| 136 | + |
| 137 | + <comment userInput="Qty To Invoice is 5" stepKey="seeRemainderInQtyToInvoice"/> |
| 138 | + <scrollTo selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" stepKey="scrollToItemsInvoiced2"/> |
| 139 | + <!--<see selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" stepKey="scrollToItemsInvoiced2"/>--> |
| 140 | + <seeInField userInput="5" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" stepKey="see5InTheQtyToInvoice"/> |
| 141 | + |
| 142 | + <!--Verify items invoiced information--> |
| 143 | + <see selector="{{AdminInvoiceItemsSection.itemQty('1')}}" userInput="Refunded 5" stepKey="seeQtyOfItemsRefunded"/> |
| 144 | + |
| 145 | + <!--Submit Invoice--> |
| 146 | + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice2" /> |
| 147 | + |
| 148 | + <!--Invoice created successfully for the rest of the ordered items--> |
| 149 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeInvoiceSuccessMessage2" after="submitInvoice2"/> |
| 150 | + |
| 151 | + <!--Verify Ship Action can be done for the rest of the invoiced items --> |
| 152 | + <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipActionForRestOfItems" after="seeInvoiceSuccessMessage2"/> |
| 153 | + |
| 154 | + <!--Verify Items To Ship section --> |
| 155 | + <scrollTo selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" stepKey="scrollToItemsToShip2"/> |
| 156 | + <see selector="{{AdminShipmentItemsSection.itemQty('1')}}" userInput="Invoiced 10" stepKey="SeeAll10ItemsInvoiced"/> |
| 157 | + <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="5" stepKey="fillRestOfItemsToShip"/> |
| 158 | + |
| 159 | + <!--Submit Shipment--> |
| 160 | + <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="submitShipment2" after="fillRestOfItemsToShip"/> |
| 161 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="successfullyCreatedShipment" after="submitShipment2"/> |
| 162 | + |
| 163 | + <!--Verify Items Status and Shipped Qty in the Items Ordered section--> |
| 164 | + <scrollTo selector="{{AdminOrderItemsOrderedSection.itemStatus('1')}}" stepKey="scrollToItemsOrdered2"/> |
| 165 | + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Shipped 10" stepKey="seeAllItemsShipped"/> |
| 166 | + </test> |
| 167 | +</tests> |
| 168 | + |
0 commit comments