Skip to content

Commit e6f3cae

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'AC-5453' into functional-testing-automation
2 parents 42e004b + 78971e2 commit e6f3cae

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,12 @@
5353
<data key="path">cataloginventory/item_options/manage_stock</data>
5454
<data key="value">0</data>
5555
</entity>
56+
<entity name="EnableInventoryCheckOnCartLoad">
57+
<data key="path">cataloginventory/options/enable_inventory_check</data>
58+
<data key="value">1</data>
59+
</entity>
60+
<entity name="DisableInventoryCheckOnCartLoad">
61+
<data key="path">cataloginventory/options/enable_inventory_check</data>
62+
<data key="value">0</data>
63+
</entity>
5664
</entities>
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,7 @@
6767
<element name="discount" type="block" selector="tr.totals.discount"/>
6868
<element name="discountPrice" type="text" selector=".discount .price"/>
6969
<element name="billingAddressSameAsShippingCashOnDeliveryCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-cashondelivery"/>
70+
<element name="errormessage" type="text" selector="//div[@data-ui-id='checkout-cart-validationmessages-message-error']"/>
71+
<element name="productQuantityInCartBlock" type="text" selector="//div[@class='details-qty']/span[@class='value']" />
7072
</section>
7173
</sections>

0 commit comments

Comments
 (0)