|
| 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="DisabledInventoryCheckOnePageCheckoutTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Disabled Inventory Check Onepage Checkout with Out of Stock Product"/> |
| 14 | + <stories value="Disabled Inventory Check Onepage Checkout with Out of Stock Product"/> |
| 15 | + <title value="OnePageCheckoutWithOutOfStockProducts"/> |
| 16 | + <description value="Disabling Inventory and Doing Checkout For Out Of Stock Products"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="AC-5453"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> |
| 23 | + <!--Create Category--> |
| 24 | + <createData entity="_defaultCategory" stepKey="testCategory"/> |
| 25 | + <!-- Create SimpleProductwithPrice100 --> |
| 26 | + <createData entity="SimpleProduct_100" stepKey="simpleProductOne"> |
| 27 | + <requiredEntity createDataKey="testCategory"/> |
| 28 | + </createData> |
| 29 | + <!-- Assign SimpleProductOne to Category --> |
| 30 | + <createData entity="AssignProductToCategory" stepKey="assignSimpleProductOneToTestCategory"> |
| 31 | + <requiredEntity createDataKey="testCategory"/> |
| 32 | + <requiredEntity createDataKey="simpleProductOne"/> |
| 33 | + </createData> |
| 34 | + <!--Set Enable Inventory Check On Cart Load = No--> |
| 35 | + <magentoCLI command="config:set {{DisableInventoryCheckOnCartLoad.path}} {{DisableInventoryCheckOnCartLoad.value}}" stepKey="disableCartLoad"/> |
| 36 | + <!-- Cache Flush--> |
| 37 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushConfigCache"> |
| 38 | + <argument name="tags" value="config"/> |
| 39 | + </actionGroup> |
| 40 | + </before> |
| 41 | + <!--Delete Category, Product and Set Enable Inventory Check On Cart Load = Yes--> |
| 42 | + <after> |
| 43 | + <magentoCLI command="config:set {{EnableInventoryCheckOnCartLoad.path}} {{EnableInventoryCheckOnCartLoad.value}}" stepKey="enableCartLoad"/> |
| 44 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 45 | + <deleteData createDataKey="simpleProductOne" stepKey="deleteProduct"/> |
| 46 | + <deleteData createDataKey="testCategory" stepKey="deleteTestCategory"/> |
| 47 | + </after> |
| 48 | + |
| 49 | + <!--Go to product page--> |
| 50 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> |
| 51 | + <argument name="productUrlKey" value="$simpleProductOne.custom_attributes[url_key]$"/> |
| 52 | + </actionGroup> |
| 53 | + <!--Add Product to Shopping Cart--> |
| 54 | + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> |
| 55 | + <argument name="productName" value="$simpleProductOne.name$"/> |
| 56 | + </actionGroup> |
| 57 | + <!--Open MiniCart--> |
| 58 | + <actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openViewAndEditCart"/> |
| 59 | + <!--Go to Checkout--> |
| 60 | + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="gotocheckout"/> |
| 61 | + <!--Filling shipping information and click next--> |
| 62 | + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> |
| 63 | + <argument name="shippingMethod" value="Flat Rate"/> |
| 64 | + <argument name="customerVar" value="Simple_US_Customer_NY"/> |
| 65 | + <argument name="customerAddressVar" value="US_Address_NY"/> |
| 66 | + </actionGroup> |
| 67 | + <!--Select Payment Method--> |
| 68 | + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectPaymentMethod"/> |
| 69 | + <!-- Open and switch to a new browser tab. --> |
| 70 | + <openNewTab stepKey="openNewTab"/> |
| 71 | + <!-- Open Product From AdminPage--> |
| 72 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 73 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPageinNewTab"> |
| 74 | + <argument name="productId" value="$simpleProductOne.id$"/> |
| 75 | + </actionGroup> |
| 76 | + <!-- Set Stock Status of Product to Out Of Stock--> |
| 77 | + <actionGroup ref="AdminSetStockStatusActionGroup" stepKey="outOfStockStatus"> |
| 78 | + <argument name="stockStatus" value="Out of Stock"/> |
| 79 | + </actionGroup> |
| 80 | + <!-- Save Product--> |
| 81 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="clicksaveProduct"/> |
| 82 | + <!-- Switch to Previous tab and Check Error message There are no source items with the in stock status* is displayed --> |
| 83 | + <switchToPreviousTab stepKey="switchToPreviousTab"/> |
| 84 | + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> |
| 85 | + <see selector="{{CheckoutPaymentSection.errormessage}}" userInput="There are no source items with the in stock status" stepKey="seeErrorMessage"/> |
| 86 | + <click selector="{{CheckoutPaymentSection.cartItemsArea}}" stepKey="clickCartItemsArea"/> |
| 87 | + <see selector="{{CheckoutPaymentSection.productQuantityInCartBlock}}" userInput="1" stepKey="seeItemQty"/> |
| 88 | + |
| 89 | + </test> |
| 90 | +</tests> |
0 commit comments