Skip to content

Commit 4fc6000

Browse files
committed
AC-6395: Catalog shown entire catalog items count if show_of_stock_option enabled
1 parent 7792c18 commit 4fc6000

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@
4141
<element name="productNameByPosition" type="text" selector=".products-grid li:nth-of-type({{position}}) .product-item-name a" parameterized="true"/>
4242
<element name="sidebarAdditional" type="block" selector="#maincontent .sidebar.sidebar-additional"/>
4343
<element name="searchStore" type="input" selector="//div/input[@id='search']" />
44+
<element name="productAttributeName" type="button" selector="//div[@class='filter-options-title' and contains(text(),'{{var1}}')]" parameterized="true"/>
45+
<element name="productAttributeOptionValue" type="button" selector="//div[@id='narrow-by-list']//a[contains(text(), '{{var1}}')]" parameterized="true"/>
4446
</section>
4547
</sections>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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="StoreFrontSearchWithProductAttributeOptionValue">
12+
<annotations>
13+
<stories value="Store front search product when display out of stock products to yes"/>
14+
<title value="Catalog shown entire catalog items count if show_of_stock_option enabled"/>
15+
<description value="Catalog shown entire catalog items count if show_of_stock_option enabled"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-6395"/>
18+
<group value="catalog_search"/>
19+
</annotations>
20+
<before>
21+
<magentoCLI command="config:set cataloginventory/options/show_out_of_stock 1" stepKey="setOutOfStockToYes"/>
22+
<magentoCLI command="cache:clean config" stepKey="cacheClean"/>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
24+
25+
<createData entity="_defaultCategory" stepKey="createCategory"/>
26+
<createData entity="SimpleProduct" stepKey="createProduct01">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
31+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
32+
<requiredEntity createDataKey="createConfigProductAttribute"/>
33+
</createData>
34+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
35+
<requiredEntity createDataKey="createConfigProductAttribute"/>
36+
</createData>
37+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
38+
<requiredEntity createDataKey="createConfigProductAttribute"/>
39+
</createData>
40+
41+
<createData entity="SimpleProduct" stepKey="createProduct02">
42+
<requiredEntity createDataKey="createCategory"/>
43+
</createData>
44+
45+
<createData entity="AssignProductToCategory" stepKey="assignTestCategoryToTestProduct">
46+
<requiredEntity createDataKey="createCategory"/>
47+
<requiredEntity createDataKey="createProduct01"/>
48+
<requiredEntity createDataKey="createProduct02"/>
49+
</createData>
50+
</before>
51+
<after>
52+
<magentoCLI command="config:set cataloginventory/options/show_out_of_stock 0" stepKey="setOutOfStockToNo"/>
53+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
54+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
55+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
56+
<deleteData createDataKey="createProduct01" stepKey="deleteProduct1"/>
57+
<deleteData createDataKey="createProduct02" stepKey="deleteProduct2"/>
58+
</after>
59+
60+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="goToStorefrontCreatedCategoryPage"/>
61+
<click selector="{{StorefrontCategoryMainSection.productAttributeName('attribute')}}" stepKey="selectProductAttribute"/>
62+
<wait time="2" stepKey="waitForLoad"/>
63+
<click selector="{{StorefrontCategoryMainSection.productAttributeOptionValue('option')}}" stepKey="selectProductAttributeOptionValue"/>
64+
</test>
65+
</tests>

0 commit comments

Comments
 (0)