Skip to content

Commit ed52bd9

Browse files
committed
ACP2E-1854: Attribute that is not searchable but used in Search Results works incorrectly
- added mftf test
1 parent 427f2e3 commit ed52bd9

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="QuickSearchProductByAttributeNotSearchableUsedInLayeredNavigation">
11+
<annotations>
12+
<stories value="Search Product on Storefront"/>
13+
<title value="User should be able to use Quick Search to find products"/>
14+
<description value="A product should not be searchable by attribute value if attribute has 'Use in search' to 'No' even if 'Use in Layered Navigation is set"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="AC-9146"/>
17+
<group value="CatalogSearch"/>
18+
</annotations>
19+
<before>
20+
<!--Create category, attribute set with multiselect product attribute with two options-->
21+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
22+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
23+
<createData entity="multipleSelectProductAttribute" stepKey="createMultiselectAttribute"/>
24+
<createData entity="ProductAttributeOption10" stepKey="firstMultiselectOption">
25+
<requiredEntity createDataKey="createMultiselectAttribute"/>
26+
</createData>
27+
<createData entity="ProductAttributeOption11" stepKey="secondMultiselectOption">
28+
<requiredEntity createDataKey="createMultiselectAttribute"/>
29+
</createData>
30+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstMultiselectOption">
31+
<requiredEntity createDataKey="createMultiselectAttribute"/>
32+
</getData>
33+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getSecondMultiselectOption">
34+
<requiredEntity createDataKey="createMultiselectAttribute"/>
35+
</getData>
36+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
37+
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createAttributeSet.attribute_set_id$/" stepKey="onAttributeSetEdit"/>
38+
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
39+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignMultiselectAttributeToGroup">
40+
<argument name="group" value="Product Details"/>
41+
<argument name="attribute" value="$createMultiselectAttribute.attribute_code$"/>
42+
</actionGroup>
43+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/>
44+
45+
<!-- Create simple product with multiselect attribute -->
46+
<createData entity="SimpleOne" storeCode="all" stepKey="createFirstSimpleProduct">
47+
<field key="attribute_set_id">$createAttributeSet.attribute_set_id$</field>
48+
<requiredEntity createDataKey="createMultiselectAttribute"/>
49+
<requiredEntity createDataKey="getFirstMultiselectOption"/>
50+
<requiredEntity createDataKey="createCategory"/>
51+
</createData>
52+
</before>
53+
<after>
54+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
55+
<deleteData createDataKey="createMultiselectAttribute" stepKey="deleteMultiselectAttribute"/>
56+
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
57+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
58+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
59+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
60+
</after>
61+
62+
<!-- Set Use in layered navigation for attribute to Filterable -->
63+
<actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="goToDropdownAttributePage">
64+
<argument name="productAttributeCode" value="$createMultiselectAttribute.attribute_code$"/>
65+
</actionGroup>
66+
<actionGroup ref="AdminSetUseInSearchValueForProductAttributeActionGroup" stepKey="makeAttributeUnsearchableInAQuickSearch">
67+
<argument name="useInSearchValue" value="No"/>
68+
</actionGroup>
69+
<actionGroup ref="AdminSetProductAttributeUseInLayeredNavigationOptionActionGroup" stepKey="setDropdownUseInLayeredNavigationNoResults">
70+
<argument name="useInLayeredNavigationValue" value="Filterable (no results)"/>
71+
</actionGroup>
72+
<actionGroup ref="AdminProductAttributeSaveActionGroup" stepKey="saveMultiSelectAttribute"/>
73+
74+
<!-- Perform search with attribute value -->
75+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToFrontPage"/>
76+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront">
77+
<argument name="phrase" value="$getFirstMultiselectOption.label$"/>
78+
</actionGroup>
79+
80+
<!-- Should not see any search results -->
81+
<dontSee userInput="$$createFirstSimpleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/>
82+
<see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/>
83+
</test>
84+
</tests>

0 commit comments

Comments
 (0)