|
| 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="AdminCheckingProductQtyAfterOrderCancelTest"> |
| 11 | + <annotations> |
| 12 | + <features value="ConfigurableProduct"/> |
| 13 | + <stories value="Product quantity after order cancel"/> |
| 14 | + <title value="Products quantity return after order cancel"/> |
| 15 | + <description value="Checking product quantity after the order cancel"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MC-13790"/> |
| 18 | + <group value="configurableProduct"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!--Create category--> |
| 22 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 23 | + <!--Create configurable product and add it to the category--> |
| 24 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> |
| 25 | + <requiredEntity createDataKey="createCategory"/> |
| 26 | + </createData> |
| 27 | + <!--Create attribute--> |
| 28 | + <createData entity="productAttributeWithDropdownTwoOptions" stepKey="createConfigProductAttribute"/> |
| 29 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> |
| 30 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 31 | + </createData> |
| 32 | + <!--Add the attribute to default attribute set--> |
| 33 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 34 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 35 | + </createData> |
| 36 | + <!--Get the option of the attribute--> |
| 37 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption"> |
| 38 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 39 | + </getData> |
| 40 | + <!--Create simple product and give it the attribute with option--> |
| 41 | + <createData entity="ApiSimpleWithQty100" stepKey="createConfigChildProduct"> |
| 42 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 43 | + <requiredEntity createDataKey="getConfigAttributeOption"/> |
| 44 | + </createData> |
| 45 | + <!--Create configurable product--> |
| 46 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> |
| 47 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 48 | + <requiredEntity createDataKey="createConfigProductAttribute"/> |
| 49 | + <requiredEntity createDataKey="getConfigAttributeOption"/> |
| 50 | + </createData> |
| 51 | + <!--Add simple product to the configurable product--> |
| 52 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild"> |
| 53 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 54 | + <requiredEntity createDataKey="createConfigChildProduct"/> |
| 55 | + </createData> |
| 56 | + <!--Create customer--> |
| 57 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 58 | + <!--Login--> |
| 59 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 60 | + </before> |
| 61 | + <after> |
| 62 | + <!--Clear grid filters--> |
| 63 | + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrderGridPage"/> |
| 64 | + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> |
| 65 | + <!--Delete entities--> |
| 66 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 67 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 68 | + <deleteData createDataKey="createConfigChildProduct" stepKey="deleteConfigChildProduct"/> |
| 69 | + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> |
| 70 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 71 | + <!--Logout--> |
| 72 | + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> |
| 73 | + <actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="logoutFromStorefront"/> |
| 74 | + </after> |
| 75 | + |
| 76 | + <!--Go to Storefront as Customer--> |
| 77 | + <actionGroup ref="CustomerLoginOnStorefront" stepKey="customerLogin"> |
| 78 | + <argument name="customer" value="$$createCustomer$$" /> |
| 79 | + </actionGroup> |
| 80 | + |
| 81 | + <!--Go to the configurable product page on Storefront--> |
| 82 | + <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.sku$$)}}" stepKey="goToProductPage"/> |
| 83 | + <!--Select option--> |
| 84 | + <selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption.label$$" stepKey="selectOption"/> |
| 85 | + <!--Add product to the Shopping cart--> |
| 86 | + <actionGroup ref="StorefrontAddProductToCartQuantityActionGroup" stepKey="addProductToCart"> |
| 87 | + <argument name="productName" value="$createConfigProduct.name$"/> |
| 88 | + <argument name="quantity" value="4"/> |
| 89 | + </actionGroup> |
| 90 | + |
| 91 | + <!--Open Shopping cart--> |
| 92 | + <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCartFromMinicart"/> |
| 93 | + <!--Place order--> |
| 94 | + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"> |
| 95 | + <argument name="shippingMethod" value="Flat Rate"/> |
| 96 | + <argument name="paymentMethod" value="Check / Money order"/> |
| 97 | + </actionGroup> |
| 98 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 99 | + |
| 100 | + <!--Open order--> |
| 101 | + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> |
| 102 | + <argument name="orderId" value="{$grabOrderNumber}"/> |
| 103 | + </actionGroup> |
| 104 | + <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="openOrderViewPage"/> |
| 105 | + <waitForPageLoad stepKey="waitForOrderViewPageOpen"/> |
| 106 | + |
| 107 | + <!--Create Invoice--> |
| 108 | + <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/> |
| 109 | + <fillField selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}" userInput="1" stepKey="changeQtyToInvoice"/> |
| 110 | + <waitForElementVisible selector="{{AdminInvoiceItemsSection.updateQtyEnabled}}" stepKey="waitForUpdateQtyEnabled"/> |
| 111 | + <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQty"/> |
| 112 | + <waitForLoadingMaskToDisappear stepKey="waitForQtyToUpdate"/> |
| 113 | + <waitForElementVisible selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="waitForSubmitInvoiceButton"/> |
| 114 | + <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> |
| 115 | + <!--Create Shipment--> |
| 116 | + <actionGroup ref="StartCreateShipmentFromOrderPage" stepKey="startCreateShipment"/> |
| 117 | + <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> |
| 118 | + <actionGroup ref="SubmitShipment" stepKey="submitShipment"/> |
| 119 | + |
| 120 | + <!--Cancel order--> |
| 121 | + <actionGroup ref="cancelCompleteOrder" stepKey="cancelOrder"/> |
| 122 | + <!--Check quantities in "Items Ordered" table--> |
| 123 | + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Invoiced 1" stepKey="seeInvoicedQuantity"/> |
| 124 | + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Shipped 1" stepKey="seeShippedQuantity"/> |
| 125 | + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Canceled 3" stepKey="seeCanceledQuantity"/> |
| 126 | + |
| 127 | + <!--Go to catalog products page on Admin--> |
| 128 | + <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> |
| 129 | + <actionGroup ref="filterProductGridBySku" stepKey="filterProductGrid"> |
| 130 | + <argument name="product" value="$$createConfigChildProduct$$"/> |
| 131 | + </actionGroup> |
| 132 | + |
| 133 | + <!--Check quantity of configurable child product--> |
| 134 | + <see selector="{{AdminProductGridSection.productGridCell('1', 'Quantity')}}" userInput="99" stepKey="seeProductSkuInGrid"/> |
| 135 | + </test> |
| 136 | +</tests> |
0 commit comments