Skip to content

Commit b4f59cd

Browse files
committed
MC-137: add advance catalog search for virtual product tests.
- search by product name - search by product sku - search by product description - search by product short description - search by price (cherry picked from commit 063899d)
1 parent f8ca650 commit b4f59cd

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,4 +239,18 @@
239239
<requiredEntity type="product_option">ProductOptionDateTime</requiredEntity>
240240
<requiredEntity type="product_option">ProductOptionTime</requiredEntity>
241241
</entity>
242+
<entity name="ApiVirtualProductWithDescription" type="product">
243+
<data key="sku" unique="suffix">api-virtual-product</data>
244+
<data key="type_id">virtual</data>
245+
<data key="attribute_set_id">4</data>
246+
<data key="visibility">4</data>
247+
<data key="name" unique="suffix">Api Virtual Product</data>
248+
<data key="price">123.00</data>
249+
<data key="urlKey" unique="suffix">api-virtual-product</data>
250+
<data key="status">1</data>
251+
<data key="quantity">100</data>
252+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
253+
<requiredEntity type="custom_attribute_array">ApiProductDescription</requiredEntity>
254+
<requiredEntity type="custom_attribute_array">ApiProductShortDescription</requiredEntity>
255+
</entity>
242256
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdvanceCatalogSearchVirtualProductByNameTest">
12+
<annotations>
13+
<features value="CatalogSearch"/>
14+
<stories value="Advanced catalog search for virtual products"/>
15+
<title value="Advanced catalog search for virtual products by product name"/>
16+
<description value="Advanced catalog search for virtual products by product name"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-137"/>
19+
<group value="CatalogSearch"/>
20+
</annotations>
21+
<before>
22+
<createData entity="ApiVirtualProductWithDescription" stepKey="createProductOne"/>
23+
</before>
24+
<after>
25+
<deleteData createDataKey="createProductOne" stepKey="deleteProductOne"/>
26+
</after>
27+
28+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
29+
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameActionGroup" stepKey="search">
30+
<argument name="name" value="$$createProductOne.name$$"/>
31+
</actionGroup>
32+
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResult"/>
33+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
34+
</test>
35+
<test name="AdvanceCatalogSearchVirtualProductBySkuTest">
36+
<annotations>
37+
<features value="CatalogSearch"/>
38+
<stories value="Advanced catalog search for virtual products"/>
39+
<title value="Advanced catalog search for virtual products by product sku"/>
40+
<description value="Advanced catalog search for virtual products by product sku"/>
41+
<severity value="MAJOR"/>
42+
<testCaseId value="MC-162"/>
43+
<group value="CatalogSearch"/>
44+
</annotations>
45+
<before>
46+
<createData entity="ApiVirtualProductWithDescription" stepKey="createProductOne"/>
47+
</before>
48+
<after>
49+
<deleteData createDataKey="createProductOne" stepKey="deleteProductOne"/>
50+
</after>
51+
52+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
53+
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductSkuActionGroup" stepKey="search">
54+
<argument name="sku" value="$$createProductOne.sku$$"/>
55+
</actionGroup>
56+
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResult"/>
57+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
58+
</test>
59+
60+
<test name="AdvanceCatalogSearchVirtualProductByDescriptionTest">
61+
<annotations>
62+
<features value="CatalogSearch"/>
63+
<stories value="Advanced catalog search for virtual products"/>
64+
<title value="Advanced catalog search for virtual products by product description"/>
65+
<description value="Advanced catalog search for virtual products by product description"/>
66+
<severity value="MAJOR"/>
67+
<testCaseId value="MC-163"/>
68+
<group value="CatalogSearch"/>
69+
</annotations>
70+
<before>
71+
<createData entity="ApiVirtualProductWithDescription" stepKey="createProductOne"/>
72+
</before>
73+
<after>
74+
<deleteData createDataKey="createProductOne" stepKey="deleteProductOne"/>
75+
</after>
76+
77+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
78+
<actionGroup ref="StorefrontAdvancedCatalogSearchByDescriptionActionGroup" stepKey="search">
79+
<argument name="description" value="$$createProductOne.custom_attributes[description]$$"/>
80+
</actionGroup>
81+
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResult"/>
82+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
83+
</test>
84+
85+
<test name="AdvanceCatalogSearchVirtualProductByShortDescriptionTest">
86+
<annotations>
87+
<features value="CatalogSearch"/>
88+
<stories value="Advanced catalog search for virtual products"/>
89+
<title value="Advanced catalog search for virtual products by product short description"/>
90+
<description value="Advanced catalog search for virtual products by product short description"/>
91+
<severity value="MAJOR"/>
92+
<testCaseId value="MC-164"/>
93+
<group value="CatalogSearch"/>
94+
</annotations>
95+
<before>
96+
<createData entity="ApiVirtualProductWithDescription" stepKey="createProductOne"/>
97+
</before>
98+
<after>
99+
<deleteData createDataKey="createProductOne" stepKey="deleteProductOne"/>
100+
</after>
101+
102+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
103+
<actionGroup ref="StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup" stepKey="search">
104+
<argument name="shortDescription" value="$$createProductOne.custom_attributes[short_description]$$"/>
105+
</actionGroup>
106+
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResult"/>
107+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
108+
</test>
109+
110+
<test name="AdvanceCatalogSearchVirtualProductByPriceTest">
111+
<annotations>
112+
<features value="CatalogSearch"/>
113+
<stories value="Advanced catalog search for virtual products"/>
114+
<title value="Advanced catalog search for virtual products by product price"/>
115+
<description value="Advanced catalog search for virtual products by price"/>
116+
<severity value="MAJOR"/>
117+
<testCaseId value="MC-165"/>
118+
<group value="CatalogSearch"/>
119+
</annotations>
120+
<before>
121+
<createData entity="ApiVirtualProductWithDescription" stepKey="createProductOne"/>
122+
</before>
123+
<after>
124+
<deleteData createDataKey="createProductOne" stepKey="deleteProductOne"/>
125+
</after>
126+
127+
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/>
128+
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup" stepKey="search">
129+
<argument name="name" value="$$createProductOne.name$$"/>
130+
<argument name="priceFrom" value="$$createProductOne.price$$"/>
131+
<argument name="priceTo" value="$$createProductOne.price$$"/>
132+
</actionGroup>
133+
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResult"/>
134+
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="see"/>
135+
</test>
136+
</tests>

0 commit comments

Comments
 (0)