Skip to content

Commit aa11f4a

Browse files
Neil RautNeil Raut
authored andcommitted
ACQE-6680: Products low stock report
Test AC-11747 implemented, PR raised
1 parent de4dfb8 commit aa11f4a

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,4 +1538,14 @@
15381538
<requiredEntity type="product_option">ProductOptionCheckboxFor2</requiredEntity>
15391539
<requiredEntity type="product_option">ProductOptionNewField</requiredEntity>
15401540
</entity>
1541+
<entity name="SimpleProductWithQty1" type="product" extends="_defaultProduct">
1542+
<data key="name" unique="suffix">Simple Product 3</data>
1543+
<data key="price">1.00</data>
1544+
<data key="urlKey" unique="suffix">Simple Product 3</data>
1545+
<data key="status">1</data>
1546+
<data key="quantity">1</data>
1547+
<data key="weight">1</data>
1548+
<requiredEntity type="product_extension_attribute">EavStock1</requiredEntity>
1549+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
1550+
</entity>
15411551
</entities>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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="AdminProductsLowStockReportsTest">
12+
<annotations>
13+
<features value="Reports"/>
14+
<stories value="Products low stock report"/>
15+
<title value="Admin products low stock report test"/>
16+
<description value="Admin products should be displayed correctly in Low Stock report"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-11747"/>
19+
</annotations>
20+
<before>
21+
<!--Login as admin-->
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
23+
<!--Create product with quantity as 1-->
24+
<createData entity="SimpleProductWithQty1" stepKey="createProductWithQty1"/>
25+
</before>
26+
<after>
27+
<!--Delete product-->
28+
<deleteData createDataKey="createProductWithQty1" stepKey="deleteProduct"/>
29+
<!--Logout as admin-->
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/>
31+
</after>
32+
<!--Set Notify for Quantity Below is 2-->
33+
<magentoCLI command="config:set cataloginventory/item_options/notify_stock_qty 2" stepKey="setNotifyForQuantityBelowTwo"/>
34+
<!--Clear invalidated cache-->
35+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
36+
<argument name="tags" value="config full_page"/>
37+
</actionGroup>
38+
<!--Navigate to Report > Low Stock-->
39+
<amOnPage url="{{LowStockReportPage.url}}" stepKey="navigateToLowStockReportPage"/>
40+
<!--Filter product having quantity 1-->
41+
<actionGroup ref="AdminSearchLowStockReportByProductSkuAndSourceCodeActionGroup" stepKey="filterProductHavingQty1">
42+
<argument name="productSku" value="$$createProductWithQty1.sku$$"/>
43+
<argument name="sourceCode" value="{{_defaultSource.source_code}}"/>
44+
</actionGroup>
45+
<!--Assert product, sku and quantity having quantity as 1-->
46+
<actionGroup ref="AdminVerifyLowStockProductReportActionGroup" stepKey="verifyProductReport">
47+
<argument name="product" value="$$createProductWithQty1$$"/>
48+
<argument name="productQty" value="$$createProductWithQty1.quantity$$"/>
49+
</actionGroup>
50+
</test>
51+
</tests>

0 commit comments

Comments
 (0)