Skip to content

Commit b16de4e

Browse files
DeepthiPulluruDeepthiPulluru
authored andcommitted
ACQE-6408:AC-3918:AdminLowStockProductTest
Display Low Stock Products
1 parent 7e0e558 commit b16de4e

File tree

5 files changed

+106
-0
lines changed

5 files changed

+106
-0
lines changed

app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminInventoryProductStockOptionsConfigSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
<element name="maxSaleQtyInherit" type="checkbox" selector="#cataloginventory_item_options_max_sale_qty_inherit" timeout="30"/>
1313
<element name="maxSaleQty" type="input" selector="#cataloginventory_item_options_max_sale_qty"/>
1414
<element name="maxSaleQtyError" type="input" selector="#cataloginventory_item_options_max_sale_qty-error"/>
15+
<element name="notifyQty" type="input" selector="//input[@id='cataloginventory_item_options_notify_stock_qty']"/>
16+
<element name="saveConfig" type="button" selector="//span[text()='Save Config']"/>
17+
<element name="systemValue" type="input" selector="//input[@id='cataloginventory_item_options_notify_stock_qty_inherit']"/>
1518
</section>
1619
</sections>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminLowStockReportActionGroup">
12+
<amOnPage url="{{LowStockReportPage.url}}" stepKey="navigateToLowStockReportPageWithZeroQuantity"/>
13+
<fillField selector="{{LowStockProductGridSection.enterProduct}}" userInput="$$createSimpleProduct.name$$" stepKey="fillProductName"/>
14+
<waitForElementClickable selector="{{LowStockProductGridSection.search($$createSimpleProduct.name$$)}}" stepKey="waitForSearchProduct"/>
15+
<click selector="{{LowStockProductGridSection.search($$createSimpleProduct.name$$)}}" stepKey="searchForProduct"/>
16+
</actionGroup>
17+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToInventoryConfigurationActionGroup">
12+
<amOnPage url="{{AdminInventoryProductStockOptionsConfigPage.url}}" stepKey="openInventoryConfigPage"/>
13+
<uncheckOption selector="{{AdminInventoryProductStockOptionsConfigSection.systemValue}}" stepKey="uncheckSystemValue"/>
14+
<fillField selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" userInput="2" stepKey="fillNotifyQty"/>
15+
<waitForElementClickable selector="{{AdminInventoryProductStockOptionsConfigSection.saveConfig}}" stepKey="waitForSaveConfig1"/>
16+
<click selector="{{AdminInventoryProductStockOptionsConfigSection.saveConfig}}" stepKey="saveConfig1"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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="AdminLowStockProductTest">
12+
<annotations>
13+
<features value="LowStock"/>
14+
<stories value="Display low stock products"/>
15+
<title value="Display low stock products"/>
16+
<description value="Display low stock products after Configuration"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-3918"/>
19+
<group value="lowStock"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
</before>
24+
25+
<after>
26+
<magentoCLI command="config:set cataloginventory/item_options/notify_stock_qty 1" stepKey="checkSystemValue1"/>
27+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
28+
</after>
29+
30+
<!-- Go to Inventory configuration page -->
31+
<actionGroup ref="AdminNavigateToInventoryConfigurationActionGroup" stepKey="navigateToInventoryConfiguration"/>
32+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCachesAfterModulesDisabled">
33+
<argument name="tags" value="" />
34+
</actionGroup>
35+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAndFlushCache">
36+
<argument name="indices" value=""/>
37+
</actionGroup>
38+
<!--Create Category-->
39+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
40+
<!--Create Simple Product-->
41+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
42+
<requiredEntity createDataKey="createCategory"/>
43+
</createData>
44+
<!-- Open Product Index Page-->
45+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
46+
<!-- Select Created Product-->
47+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku">
48+
<argument name="product" value="$$createSimpleProduct$$"/>
49+
</actionGroup>
50+
<waitForElementClickable selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}" stepKey="waitForOpenFirstProduct"/>
51+
<click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/>
52+
<waitForPageLoad stepKey="waitForProductToLoad"/>
53+
<actionGroup ref="AdminFillProductQtyOnProductFormActionGroup" stepKey="fillProductQty">
54+
<argument name="productQty" value="1"/>
55+
</actionGroup>
56+
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="saveTheProduct"/>
57+
<!--Navigate to low stock-->
58+
<actionGroup ref="AdminLowStockReportActionGroup" stepKey="navigateToLowStockReport"/>
59+
<!-- Verify Product-->
60+
<waitForText userInput="$$createSimpleProduct.name$$" selector="{{LowStockProductGridSection.productName}}" time="30" stepKey="assertProductName1"/>
61+
<!-- Verify Product Sku-->
62+
<waitForText userInput="$$createSimpleProduct.sku$$" selector="{{LowStockProductGridSection.productSku}}" time="30" stepKey="assertProductSku1"/>
63+
<!-- Verify Product Qty-->
64+
<waitForText userInput="1" selector="{{LowStockProductGridSection.productQty}}" time="30" stepKey="assertProductQty1"/>
65+
</test>
66+
</tests>

app/code/Magento/Reports/Test/Mftf/Section/LowStockProductGridSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212
<element name="productSku" type="input" selector="//tr[1]/td[@data-column='sku']"/>
1313
<element name="productName" type="input" selector="//tr[1]/td[@data-column='name']"/>
1414
<element name="productQty" type="input" selector="//tr[1]/td[@data-column='qty']"/>
15+
<element name="search" type="input" selector="//span[text()='Search']"/>
16+
<element name="enterProduct" type="input" selector="//input[@id='gridLowstock_filter_name']"/>
1517
</section>
1618
</sections>

0 commit comments

Comments
 (0)