Skip to content

Commit f030131

Browse files
Merge branch 'ACQE-7310' into ACQE-functional-deployment-version5
2 parents 1e72665 + 60e3406 commit f030131

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="StorefrontAssertStockStatusForDisplayOutOfStockEnabledTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Manage Out Of Stock products In Storefront"/>
15+
<title value="Ensure Catalog Display with 'Out of Stock Products' Enabled"/>
16+
<description value="Verifying catalog data when display out of stock products is enabled In Storefront"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-6393"/>
19+
</annotations>
20+
<before>
21+
<!--Create Category-->
22+
<createData entity="CategoryB" stepKey="createCategory"/>
23+
<!--Create Simple Product-->
24+
<createData entity="productA" stepKey="createOutStockProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
<field key="price">15.00</field>
27+
<field key="quantity">0</field>
28+
</createData>
29+
<createData entity="productA" stepKey="createProduct">
30+
<requiredEntity createDataKey="createCategory"/>
31+
<field key="price">20.00</field>
32+
<field key="quantity">0</field>
33+
</createData>
34+
<createData entity="productA" stepKey="createSimpleOutStockProduct">
35+
<requiredEntity createDataKey="createCategory"/>
36+
<field key="price">25.00</field>
37+
<field key="quantity">0</field>
38+
</createData>
39+
<createData entity="productA" stepKey="createProductNoQuantity">
40+
<requiredEntity createDataKey="createCategory"/>
41+
<field key="price">30.00</field>
42+
<field key="quantity">0</field>
43+
</createData>
44+
</before>
45+
<after>
46+
<!-- Set Magento back to default configuration -->
47+
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/>
48+
<!-- Delete created entity -->
49+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
50+
<deleteData createDataKey="createOutStockProduct" stepKey="deleteFirstProduct"/>
51+
<deleteData createDataKey="createSimpleOutStockProduct" stepKey="deleteSecondProduct"/>
52+
<deleteData createDataKey="createProductNoQuantity" stepKey="deleteThirdProduct"/>
53+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
54+
<!-- Logout From Customer and Admin -->
55+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer" />
56+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
57+
</after>
58+
<!-- Step1: Login as admin -->
59+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
60+
<!-- Step2: Stores - Configuration - Catalog - Inventory - Stock options - Enable display out of stock products to yes -->
61+
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockEnable.path}} {{CatalogInventoryOptionsShowOutOfStockEnable.value}}" stepKey="setConfigShowOutOfStockTrue"/>
62+
<!-- Step3: Clear cache and verify catalog on front end all categories -->
63+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
64+
<argument name="tags" value="config full_page"/>
65+
</actionGroup>
66+
<!-- Go to storefront category page -->
67+
<actionGroup ref="GoToStorefrontCategoryPageByParametersActionGroup" stepKey="GoToStorefrontCategoryPage3">
68+
<argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/>
69+
<argument name="mode" value="list"/>
70+
<argument name="numOfProductsPerPage" value="10"/>
71+
<argument name="sortBy" value="price"/>
72+
<argument name="sort" value="desc"/>
73+
</actionGroup>
74+
<waitForText userInput="$$createProductNoQuantity.name$$" selector="{{StorefrontCategoryMainSection.lineProductName('1')}}" stepKey="seeFirstProductNameLine"/>
75+
<waitForText userInput="$$createSimpleOutStockProduct.name$$" selector="{{StorefrontCategoryMainSection.lineProductName('2')}}" stepKey="seeSecondProductNameLine"/>
76+
<waitForText userInput="$$createProduct.name$$" selector="{{StorefrontCategoryMainSection.lineProductName('3')}}" stepKey="seeThirdProductNameLine"/>
77+
<waitForText userInput="$$createOutStockProduct.name$$" selector="{{StorefrontCategoryMainSection.lineProductName('4')}}" stepKey="seeForthProductNameLine"/>
78+
<!-- Step4: Apply filters and verify catalog -->
79+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToFirstProductPage">
80+
<argument name="productUrlKey" value="$createProductNoQuantity.custom_attributes[url_key]$"/>
81+
</actionGroup>
82+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeFirstProductStatusInStoreFront">
83+
<argument name="productStockStatus" value="In Stock"/>
84+
</actionGroup>
85+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToSecondProductPage">
86+
<argument name="productUrlKey" value="$createSimpleOutStockProduct.custom_attributes[url_key]$"/>
87+
</actionGroup>
88+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeSecondProductStatusInStoreFront">
89+
<argument name="productStockStatus" value="In Stock"/>
90+
</actionGroup>
91+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToThirdProductPage">
92+
<argument name="productUrlKey" value="$createProduct.custom_attributes[url_key]$"/>
93+
</actionGroup>
94+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeThirdProductStatusInStoreFront">
95+
<argument name="productStockStatus" value="In Stock"/>
96+
</actionGroup>
97+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
98+
<argument name="productUrlKey" value="$createOutStockProduct.custom_attributes[url_key]$"/>
99+
</actionGroup>
100+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="seeProductStatusInStoreFront">
101+
<argument name="productStockStatus" value="In Stock"/>
102+
</actionGroup>
103+
</test>
104+
</tests>

0 commit comments

Comments
 (0)