|
| 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="AdminCancelCreateOrderWithStoreCreditTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Credit balance entity"/> |
| 14 | + <features value="Sales"/> |
| 15 | + <title value="Customer balance is reverted after order is canceled"/> |
| 16 | + <description value="Admin can the order placed with store credit and balance is reverted after cancelling the order."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MC-27369"/> |
| 19 | + <group value="customerBalance"/> |
| 20 | + <group value="sales"/> |
| 21 | + </annotations> |
| 22 | + |
| 23 | + <before> |
| 24 | + <!--Set default flat rate shipping method settings--> |
| 25 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 26 | + <!--Create Product--> |
| 27 | + <createData entity="SimpleProduct2" stepKey="createProduct"> |
| 28 | + <field key="price">5</field> |
| 29 | + </createData> |
| 30 | + <!--Create customer--> |
| 31 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 32 | + <!--<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomerFromStorefront"/>--> |
| 33 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 34 | + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPageForUpdateStoreCreditBalance"> |
| 35 | + <argument name="customerId" value="$createCustomer.id$"/> |
| 36 | + </actionGroup> |
| 37 | + <!-- Update Store Credit --> |
| 38 | + <actionGroup ref="UpdateCustomerStoreCreditBalanceAdminActionGroup" stepKey="updateStoreCreditThirdCustomerFromAdmin"> |
| 39 | + <argument name="storeCredit" value="5" /> |
| 40 | + </actionGroup> |
| 41 | + </before> |
| 42 | + |
| 43 | + <after> |
| 44 | + <!--Delete product--> |
| 45 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 46 | + <!--Delete customer--> |
| 47 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 48 | + <!--Clear filters on orders grid--> |
| 49 | + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrdersFilters"/> |
| 50 | + <!-- <comment userInput="BIC workaround" stepKey="logoutCustomerFromStorefront"/>--> |
| 51 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 52 | + </after> |
| 53 | + |
| 54 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> |
| 55 | + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> |
| 56 | + <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/> |
| 57 | + <waitForPageLoad stepKey="waitForProductList"/> |
| 58 | + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addVirtualProductToOrder"> |
| 59 | + <argument name="product" value="$createProduct$"/> |
| 60 | + <argument name="productQty" value="1"/> |
| 61 | + </actionGroup> |
| 62 | + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> |
| 63 | + <argument name="customer" value="$createCustomer$"/> |
| 64 | + <argument name="address" value="US_Address_CA"/> |
| 65 | + </actionGroup> |
| 66 | + <actionGroup ref="AdminOrderCreateUseStoreCreditActionGroup" stepKey="useStoreCredit"/> |
| 67 | + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> |
| 68 | + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> |
| 69 | + <!-- Cancel the Order --> |
| 70 | + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> |
| 71 | + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> |
| 72 | + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPageForUpdateStoreCreditBalance"> |
| 73 | + <argument name="customerId" value="$createCustomer.id$"/> |
| 74 | + </actionGroup> |
| 75 | + <actionGroup ref="CheckCustomerStoreCreditFromAdminActionGroup" stepKey="checkCustomerInfStoreCreditFromAdmin1"> |
| 76 | + <argument name="storeCreditUsed" value="5"/> |
| 77 | + <argument name="storeCreditLeft" value="5"/> |
| 78 | + <argument name="orderNumber" value="$grabOrderId"/> |
| 79 | + </actionGroup> |
| 80 | + </test> |
| 81 | +</tests> |
0 commit comments