|
| 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="DisabledInventoryBackOrdersTest"> |
| 12 | + <annotations> |
| 13 | + <features value="[Disabled Inventory Check] Onepage Checkout and Enabled Backorders"/> |
| 14 | + <stories value="[Disabled Inventory Check] Onepage Checkout and Enabled Backorders"/> |
| 15 | + <title value="OnePageCheckoutAndEnabledBackOrders"/> |
| 16 | + <description value="[Disabled Inventory Check] Onepage Checkout and Enabled Backorders"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="AC-5245"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <!-- Enable Back Orders--> |
| 23 | + <magentoCLI command="config:set cataloginventory/item_options/backorders 1" stepKey="EnableBackorders"/> |
| 24 | + <!--Create Category--> |
| 25 | + <createData entity="_defaultCategory" stepKey="testCategory"/> |
| 26 | + <!-- Create SimpleProductwithPrice100 --> |
| 27 | + <createData entity="SimpleProduct_100" stepKey="simpleProductOne"> |
| 28 | + <requiredEntity createDataKey="testCategory"/> |
| 29 | + </createData> |
| 30 | + <!-- Assign SimpleProductOne to Category --> |
| 31 | + <createData entity="AssignProductToCategory" stepKey="assignSimpleProductOneToTestCategory"> |
| 32 | + <requiredEntity createDataKey="testCategory"/> |
| 33 | + <requiredEntity createDataKey="simpleProductOne"/> |
| 34 | + </createData> |
| 35 | + <!--Set Enable Inventory Check On Cart Load = No--> |
| 36 | + <magentoCLI command="config:set {{DisableInventoryCheckOnCartLoad.path}} {{DisableInventoryCheckOnCartLoad.value}}" stepKey="disableCartLoad"/> |
| 37 | + <!-- Cache Flush--> |
| 38 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> |
| 39 | + <argument name="tags" value="config"/> |
| 40 | + </actionGroup> |
| 41 | + </before> |
| 42 | + <!--Delete Category, Product and Set Enable Inventory Check On Cart Load = Yes--> |
| 43 | + <after> |
| 44 | + <magentoCLI command="config:set {{EnableInventoryCheckOnCartLoad.path}} {{EnableInventoryCheckOnCartLoad.value}}" stepKey="enableCartLoad"/> |
| 45 | + <magentoCLI command="config:set cataloginventory/item_options/backorders 0" stepKey="EnableBackorders"/> |
| 46 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 47 | + <deleteData createDataKey="simpleProductOne" stepKey="deleteProduct"/> |
| 48 | + <deleteData createDataKey="testCategory" stepKey="deleteTestCategory"/> |
| 49 | + </after> |
| 50 | + <!--Go to product page--> |
| 51 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> |
| 52 | + <argument name="productUrlKey" value="$simpleProductOne.custom_attributes[url_key]$"/> |
| 53 | + </actionGroup> |
| 54 | + <!--Add Product to Shopping Cart--> |
| 55 | + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> |
| 56 | + <argument name="productName" value="$$simpleProductOne.name$$"/> |
| 57 | + <argument name="productQty" value="2"/> |
| 58 | + </actionGroup> |
| 59 | + <actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openViewAndEditCart"/> |
| 60 | + <!--Go to Checkout--> |
| 61 | + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="gotocheckout"/> |
| 62 | + <!--Filling shipping information and click next--> |
| 63 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> |
| 64 | + <argument name="shippingMethod" value="Flat Rate"/> |
| 65 | + <argument name="customerVar" value="Simple_US_Customer_NY"/> |
| 66 | + <argument name="customerAddressVar" value="US_Address_NY"/> |
| 67 | + </actionGroup> |
| 68 | + <!--Select Payment Method--> |
| 69 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> |
| 70 | + <!-- Open and switch to a new browser tab. --> |
| 71 | + <openNewTab stepKey="openNewTab"/> |
| 72 | + <!-- Open Product From AdminPage--> |
| 73 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 74 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPageinNewTab"> |
| 75 | + <argument name="productId" value="$simpleProductOne.id$"/> |
| 76 | + </actionGroup> |
| 77 | + <actionGroup ref="AdminFillProductQtyOnProductFormActionGroup" stepKey="fillVirtualProductQuantity"> |
| 78 | + <argument name="productQty" value="1"/> |
| 79 | + </actionGroup> |
| 80 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="clicksaveProduct"/> |
| 81 | + <!-- Switch to Previous tab and Check Error message There are no source items with the in stock status* is displayed --> |
| 82 | + <switchToPreviousTab stepKey="switchToPreviousTab"/> |
| 83 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> |
| 84 | + <waitForPageLoad stepKey="waitForSuccessMessage"/> |
| 85 | + <!--See success messages--> |
| 86 | + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/> |
| 87 | + <see selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/> |
| 88 | + |
| 89 | + <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogPage"/> |
| 90 | + <!--Apply Name Filter--> |
| 91 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> |
| 92 | + <argument name="product" value="$$simpleProductOne$$"/> |
| 93 | + </actionGroup> |
| 94 | + <!--Check Simple qty changed to negative value "-1"--> |
| 95 | + <see selector="{{AdminProductGridSection.productSalableQty('1', _defaultStock.name)}}" userInput="-1" stepKey="checkSalableQtyAfterPlaceOrder"/> |
| 96 | + </test> |
| 97 | +</tests> |
0 commit comments