Skip to content

Commit 3708732

Browse files
author
Nikita Fomin
committed
MC-227: Customer should be able to see search results when searching for bundle products by keyword
1 parent 794977a commit 3708732

File tree

4 files changed

+191
-0
lines changed

4 files changed

+191
-0
lines changed

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,35 @@
107107
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
108108
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
109109
</entity>
110+
<entity name="DynamicBundleProductCustomDescription" type="product2">
111+
<data key="name" unique="suffix">Test 123 Dynamic </data>
112+
<data key="sku" unique="suffix">test-dynamic-bundle-product</data>
113+
<data key="type_id">bundle</data>
114+
<data key="attribute_set_id">4</data>
115+
<data key="visibility">4</data>
116+
<data key="status">1</data>
117+
<data key="urlKey" unique="suffix">test-dynamic-bundle-product</data>
118+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
119+
<requiredEntity type="custom_attribute">CustomDynamicProductDescription</requiredEntity>
120+
<requiredEntity type="custom_attribute">CustomDynamicProductShortDescription</requiredEntity>
121+
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
122+
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
123+
</entity>
124+
<entity name="FixedBundleProductCustomDescription" type="product2">
125+
<data key="name" unique="suffix">Test 123 Fixed </data>
126+
<data key="sku" unique="suffix">test-fixed-bundle-product</data>
127+
<data key="type_id">bundle</data>
128+
<data key="attribute_set_id">4</data>
129+
<data key="price">10</data>
130+
<data key="visibility">4</data>
131+
<data key="status">1</data>
132+
<data key="urlKey" unique="suffix">api-fixed-bundle-product</data>
133+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
134+
<requiredEntity type="custom_attribute">CustomFixedProductDescription</requiredEntity>
135+
<requiredEntity type="custom_attribute">CustomFixedProductShortDescription</requiredEntity>
136+
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
137+
<requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity>
138+
<requiredEntity type="custom_attribute">CustomAttributeFixWeight</requiredEntity>
139+
<requiredEntity type="custom_attribute">CustomAttributeFixSku</requiredEntity>
140+
</entity>
110141
</entities>
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
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="StorefrontCustomerSearchBundleProductsByKeywordsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Bundle products list on Storefront"/>
15+
<title value="Customer should be able to see search results when searching for bundle products by keyword"/>
16+
<description value="Customer should be able to see search results when searching for bundle products by keyword"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-227"/>
19+
<group value="bundle"/>
20+
</annotations>
21+
<before>
22+
<createData entity="SimpleProductNotVisibleIndividually" stepKey="createSimpleProduct"/>
23+
<createData entity="DynamicBundleProductCustomDescription" stepKey="createDynamicBundle"/>
24+
<createData entity="DropDownBundleOption" stepKey="dynamicBundleOption">
25+
<requiredEntity createDataKey="createDynamicBundle"/>
26+
</createData>
27+
<createData entity="ApiBundleLink" stepKey="createDynamicBundleLink">
28+
<requiredEntity createDataKey="createDynamicBundle"/>
29+
<requiredEntity createDataKey="dynamicBundleOption"/>
30+
<requiredEntity createDataKey="createSimpleProduct"/>
31+
</createData>
32+
<createData entity="SimpleProductNotVisibleIndividually" stepKey="createSimpleProductTwo"/>
33+
<createData entity="FixedBundleProductCustomDescription" stepKey="createFixedBundle"/>
34+
<createData entity="DropDownBundleOption" stepKey="fixedBundleOption">
35+
<requiredEntity createDataKey="createFixedBundle"/>
36+
</createData>
37+
<createData entity="ApiBundleLink" stepKey="createFixedBundleLink">
38+
<requiredEntity createDataKey="createFixedBundle"/>
39+
<requiredEntity createDataKey="fixedBundleOption"/>
40+
<requiredEntity createDataKey="createSimpleProductTwo"/>
41+
</createData>
42+
<magentoCLI command="indexer:reindex" arguments="cataloginventory_stock catalogsearch_fulltext" stepKey="reindex"/>
43+
</before>
44+
<after>
45+
<deleteData createDataKey="createDynamicBundle" stepKey="deleteDynamicBundleProduct"/>
46+
<deleteData createDataKey="createFixedBundle" stepKey="deleteFixedBundleProduct"/>
47+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
48+
<deleteData createDataKey="createSimpleProductTwo" stepKey="createSimpleProductTwo"/>
49+
</after>
50+
<!-- 1. Go to storefront home page -->
51+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/>
52+
<!-- 2. Fill quick search bar with test values unique for dynamic bundle product and click search -->
53+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchDynamic">
54+
<argument name="phrase" value="Dynamic"/>
55+
</actionGroup>
56+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDynamic">
57+
<argument name="productName" value="$createDynamicBundle.name$"/>
58+
</actionGroup>
59+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="assertFixedBundleInSearchResultByDynamic">
60+
<argument name="productName" value="$createFixedBundle.name$"/>
61+
</actionGroup>
62+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescription">
63+
<argument name="phrase" value="Dynamicscription"/>
64+
</actionGroup>
65+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDescription">
66+
<argument name="productName" value="$createDynamicBundle.name$"/>
67+
</actionGroup>
68+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByDescription">
69+
<argument name="productName" value="$createFixedBundle.name$"/>
70+
</actionGroup>
71+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShortDescription">
72+
<argument name="phrase" value="Dynamictest"/>
73+
</actionGroup>
74+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByShortDescription">
75+
<argument name="productName" value="$createDynamicBundle.name$"/>
76+
</actionGroup>
77+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByShortDescription">
78+
<argument name="productName" value="$createFixedBundle.name$"/>
79+
</actionGroup>
80+
<!-- 3. Fill quick search bar with test values mutual for both products and click search -->
81+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTest123">
82+
<argument name="phrase" value="Test 123"/>
83+
</actionGroup>
84+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTest123">
85+
<argument name="productName" value="$createDynamicBundle.name$"/>
86+
</actionGroup>
87+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTest123">
88+
<argument name="productName" value="$createFixedBundle.name$"/>
89+
</actionGroup>
90+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTesting321">
91+
<argument name="phrase" value="Testing 321"/>
92+
</actionGroup>
93+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTesting321">
94+
<argument name="productName" value="$createDynamicBundle.name$"/>
95+
</actionGroup>
96+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTesting321">
97+
<argument name="productName" value="$createFixedBundle.name$"/>
98+
</actionGroup>
99+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShort555">
100+
<argument name="phrase" value="Short 555"/>
101+
</actionGroup>
102+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByShort555">
103+
<argument name="productName" value="$createDynamicBundle.name$"/>
104+
</actionGroup>
105+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShort555">
106+
<argument name="productName" value="$createFixedBundle.name$"/>
107+
</actionGroup>
108+
<!-- 4. Fill quick search bar with test values unique for fixed bundle product and click search -->
109+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByFixed">
110+
<argument name="phrase" value="Fixed"/>
111+
</actionGroup>
112+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByFixed">
113+
<argument name="productName" value="$createFixedBundle.name$"/>
114+
</actionGroup>
115+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByFixed">
116+
<argument name="productName" value="$createDynamicBundle.name$"/>
117+
</actionGroup>
118+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescriptionForFixed">
119+
<argument name="phrase" value="Fixedscription"/>
120+
</actionGroup>
121+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByDescriptionForFixed">
122+
<argument name="productName" value="$createFixedBundle.name$"/>
123+
</actionGroup>
124+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicProductByDescriptionForFixed">
125+
<argument name="productName" value="$createDynamicBundle.name$"/>
126+
</actionGroup>
127+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByShortDescriptionForFixed">
128+
<argument name="phrase" value="Fixedtest"/>
129+
</actionGroup>
130+
<actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShortDescriptionForFixed">
131+
<argument name="productName" value="$createFixedBundle.name$"/>
132+
</actionGroup>
133+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed">
134+
<argument name="productName" value="$createDynamicBundle.name$"/>
135+
</actionGroup>
136+
</test>
137+
</tests>

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,20 @@
3535
<data key="attribute_code">news_from_date</data>
3636
<data key="value">2018-05-17 00:00:00</data>
3737
</entity>
38+
<entity name="CustomDynamicProductDescription" type="custom_attribute">
39+
<data key="attribute_code">description</data>
40+
<data key="value">Dynamicscription testing 321</data>
41+
</entity>
42+
<entity name="CustomDynamicProductShortDescription" type="custom_attribute">
43+
<data key="attribute_code">short_description</data>
44+
<data key="value">Short dynamictest 555</data>
45+
</entity>
46+
<entity name="CustomFixedProductDescription" type="custom_attribute">
47+
<data key="attribute_code">description</data>
48+
<data key="value">Fixedscription testing 321</data>
49+
</entity>
50+
<entity name="CustomFixedProductShortDescription" type="custom_attribute">
51+
<data key="attribute_code">short_description</data>
52+
<data key="value">Short Fixedtest 555</data>
53+
</entity>
3854
</entities>

app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@
6464
<see selector="{{StorefrontQuickSearchResultsSection.productByIndex(index)}}" userInput="{{productName}}" stepKey="seeProductName"/>
6565
</actionGroup>
6666

67+
<actionGroup name="StorefrontQuickSearchSeeProductByName">
68+
<arguments>
69+
<argument name="productName" type="string"/>
70+
</arguments>
71+
<see selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" userInput="{{productName}}" stepKey="seeProductName"/>
72+
</actionGroup>
73+
6774
<actionGroup name="StorefrontQuickSearchCheckProductNameNotInGrid">
6875
<arguments>
6976
<argument name="productName" type="string"/>

0 commit comments

Comments
 (0)