Skip to content

Commit 0367ca4

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'AC-5262' into functional_testing_automation_ver1
2 parents 8217399 + ba92914 commit 0367ca4

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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="StoreFrontAddOutOfStockProductToShoppingCartTest">
12+
<annotations>
13+
<features value="[Disabled Inventory Check] Add Out of Stock Product to the Shopping Cart"/>
14+
<stories value="[Disabled Inventory Check] Add Out of Stock Product to the Shopping Cart"/>
15+
<title value="Checking Add Out of Stock Products to the Shopping Cart"/>
16+
<description value="Placing the order for out of stock products and zero quantity"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-5262"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Set Enable Inventory Check On Cart Load = No -->
23+
<magentoCLI command="config:set {{DisableInventoryCheckOnCartLoad.path}} {{DisableInventoryCheckOnCartLoad.value}}" stepKey="disableCartLoad"/>
24+
<!-- Create default category with subcategory -->
25+
<createData entity="ApiCategory" stepKey="createCategory"/>
26+
<createData entity="SubCategoryWithParent" stepKey="createSubcategory">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
<!-- Create SimpleProductwithPrice100 -->
30+
<createData entity="SimpleProductQty100" stepKey="simpleProductOne">
31+
<requiredEntity createDataKey="createSubcategory"/>
32+
</createData>
33+
<!-- Go To Subcategory Page-->
34+
<actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="goToCategoryC">
35+
<argument name="categoryName" value="$$createCategory.name$$"/>
36+
<argument name="subCategoryName" value="$$createSubcategory.name$$"/>
37+
</actionGroup>
38+
</before>
39+
<!-- Delete the Data after execution-->
40+
<after>
41+
<deleteData createDataKey="createCategory" stepKey="deleteProduct"/>
42+
<deleteData createDataKey="simpleProductOne" stepKey="deleteCategory"/>
43+
<magentoCLI command="config:set {{EnableInventoryCheckOnCartLoad.path}} {{EnableInventoryCheckOnCartLoad.value}}" stepKey="enableCartLoad"/>
44+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
45+
</after>
46+
<!-- Open New tab-->
47+
<openNewTab stepKey="openNewTab"/>
48+
<!-- Open Product From AdminPage-->
49+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
50+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPageinNewTab">
51+
<argument name="productId" value="$simpleProductOne.id$"/>
52+
</actionGroup>
53+
<!-- Set Stock Status of Product to Out Of Stock-->
54+
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="outOfStockStatus">
55+
<argument name="stockStatus" value="Out of Stock"/>
56+
</actionGroup>
57+
<!-- Save Product-->
58+
<actionGroup ref="SaveProductFormActionGroup" stepKey="clicksaveProduct"/>
59+
<!-- Switch to Previous tab and Check Error message Product that you are trying to add is not available -->
60+
<switchToPreviousTab stepKey="switchToPreviousTab"/>
61+
<!-- Mouse Hover Product On Category Page-->
62+
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/>
63+
<!-- Select Add to cart-->
64+
<click selector="{{StorefrontCategoryMainSection.addToCartButtonProductInfoHover}}" stepKey="toCategory"/>
65+
<waitForPageLoad stepKey="wait"/>
66+
<!-- Assert the Error Message-->
67+
<see selector="{{StorefrontProductPageSection.errorMsg}}" userInput="Product that you are trying to add is not available." stepKey="seeErrorMessage"/>
68+
</test>
69+
70+
</tests>

0 commit comments

Comments
 (0)