Skip to content

Commit d69195d

Browse files
committed
AC-5245
1 parent 0fdfe3c commit d69195d

File tree

2 files changed

+99
-57
lines changed

2 files changed

+99
-57
lines changed

app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryConfigData.xml

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

0 commit comments

Comments
 (0)