Skip to content

Commit ae6f485

Browse files
committed
MC-21228: Support partial word search in Elasticsearch
- Add MFTF test for partial word search
1 parent a154843 commit ae6f485

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
3636
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
3737
</entity>
38+
<entity name="ApiSimpleProductWithNoSpace" type="product" extends="ApiSimpleProduct">
39+
<data key="name">TestFooBar</data>
40+
<data key="sku" unique="suffix">foobar</data>
41+
</entity>
3842
<entity name="ApiSimpleProductWithSpecCharInName" type="product" extends="ApiSimpleProduct">
3943
<data key="name">Pursuit Lumaflex&#38;trade; Tone Band</data>
4044
<data key="sku" unique="suffix">x&#38;trade;</data>
@@ -68,6 +72,9 @@
6872
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
6973
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
7074
</entity>
75+
<entity name="ProductForPartialSearch" extends="SimpleProduct" type="product">
76+
<data key="sku">partialTestSku</data>
77+
</entity>
7178
<entity name="ProductWithSpecialSymbols" extends="SimpleProduct" type="product">
7279
<data key="name">SimpleProduct -+~/\\&lt;&gt;\’“:*\$#@()!,.?`=%&amp;^</data>
7380
</entity>

app/code/Magento/CatalogSearch/Test/Mftf/Test/MinimalQueryLengthForCatalogSearchTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
<useCaseId value="MAGETWO-58764"/>
2020
<group value="CatalogSearch"/>
2121
<group value="SearchEngineElasticsearch"/>
22-
<skip>
23-
<issueId value="MC-21228"/>
24-
</skip>
22+
2523
</annotations>
2624
<before>
2725
<createData entity="ApiCategory" stepKey="createCategory"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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="StorefrontPartialWordQuickSearchUsingElasticSearchTest">
12+
<annotations>
13+
<features value="Search"/>
14+
<stories value="Partial Word search using Elasticsearch"/>
15+
<title value="Support partial word search in Elasticsearch"/>
16+
<description value="User should be able to search decimal attribute using ElasticSearch"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-21228"/>
19+
<group value="SearchEngineElasticsearch" />
20+
</annotations>
21+
<before>
22+
<!-- Create subcategory -->
23+
<createData entity="SimpleSubCategory" stepKey="newCategory"/>
24+
<createData entity="ProductForPartialSearch" stepKey="product1">
25+
<requiredEntity createDataKey="newCategory"/>
26+
</createData>
27+
<createData entity="ApiSimpleProduct" stepKey="product2">
28+
<requiredEntity createDataKey="newCategory"/>
29+
</createData>
30+
<createData entity="ApiSimpleProductWithNoSpace" stepKey="product3">
31+
<requiredEntity createDataKey="newCategory"/>
32+
</createData>
33+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
34+
</before>
35+
<after>
36+
<deleteData createDataKey="product1" stepKey="deleteProduct1"/>
37+
<deleteData createDataKey="product2" stepKey="deleteProduct2"/>
38+
<deleteData createDataKey="product3" stepKey="deleteProduct3"/>
39+
<deleteData createDataKey="newCategory" stepKey="deleteCategory"/>
40+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
41+
</after>
42+
43+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomePage"/>
44+
45+
<!--Perform a quick seach using a partial word from product SKU-->
46+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchPartialSku">
47+
<argument name="phrase" value="partial"/>
48+
</actionGroup>
49+
50+
<!--Perform a case insensitive quick search of partial word using case product name -->
51+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchPartialCaseInSensitive">
52+
<argument name="phrase" value="simple"/>
53+
</actionGroup>
54+
<!--Perform a quick search using parts of the words from name/sku with additional characters-->
55+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchPartialWordsWithExtraChars">
56+
<argument name="phrase" value="barstool"/>
57+
</actionGroup>
58+
<actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptySearchResult"/>
59+
60+
</test>
61+
</tests>
62+

0 commit comments

Comments
 (0)