Skip to content

Commit f8ca650

Browse files
committed
MC-132: add advance catalog search for simple 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 86e0d11)
1 parent 3822ca4 commit f8ca650

File tree

3 files changed

+180
-4
lines changed

3 files changed

+180
-4
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/CatalogSearch/ActionGroup/StorefrontCatalogSearchActionGroup.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,46 @@
5151
<waitForPageLoad stepKey="waitForPageLoad"/>
5252
</actionGroup>
5353

54+
<!-- Storefront advanced catalog search by product name -->
55+
<actionGroup name="StorefrontAdvancedCatalogSearchByProductNameActionGroup">
56+
<arguments>
57+
<argument name="name" type="string"/>
58+
</arguments>
59+
<fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fill"/>
60+
<click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/>
61+
<waitForPageLoad stepKey="waitForPageLoad"/>
62+
</actionGroup>
63+
64+
<!-- Storefront advanced catalog search by product sku -->
65+
<actionGroup name="StorefrontAdvancedCatalogSearchByProductSkuActionGroup">
66+
<arguments>
67+
<argument name="sku" type="string"/>
68+
</arguments>
69+
<fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.SKU}}" userInput="{{sku}}" stepKey="fill"/>
70+
<click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/>
71+
<waitForPageLoad stepKey="waitForPageLoad"/>
72+
</actionGroup>
73+
74+
<!-- Storefront advanced catalog search by product description -->
75+
<actionGroup name="StorefrontAdvancedCatalogSearchByDescriptionActionGroup">
76+
<arguments>
77+
<argument name="description" type="string"/>
78+
</arguments>
79+
<fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.Description}}" userInput="{{description}}" stepKey="fill"/>
80+
<click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/>
81+
<waitForPageLoad stepKey="waitForPageLoad"/>
82+
</actionGroup>
83+
84+
<!-- Storefront advanced catalog search by product short description -->
85+
<actionGroup name="StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup">
86+
<arguments>
87+
<argument name="shortDescription" type="string"/>
88+
</arguments>
89+
<fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ShortDescription}}" userInput="{{shortDescription}}" stepKey="fill"/>
90+
<click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/>
91+
<waitForPageLoad stepKey="waitForPageLoad"/>
92+
</actionGroup>
93+
5494
<!-- Storefront advanced catalog search by product name and price -->
5595
<actionGroup name="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup">
5696
<arguments>
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="AdvanceCatalogSearchSimpleProductByNameTest">
12+
<annotations>
13+
<features value="CatalogSearch"/>
14+
<stories value="Advanced catalog search for simple products"/>
15+
<title value="Advanced catalog search for simple products by product name"/>
16+
<description value="Advanced catalog search for simple products by product name"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-132"/>
19+
<group value="CatalogSearch"/>
20+
</annotations>
21+
<before>
22+
<createData entity="ApiProductWithDescription" 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="AdvanceCatalogSearchSimpleProductBySkuTest">
36+
<annotations>
37+
<features value="CatalogSearch"/>
38+
<stories value="Advanced catalog search for simple products"/>
39+
<title value="Advanced catalog search for simple products by product sku"/>
40+
<description value="Advanced catalog search for simple products by product sku"/>
41+
<severity value="MAJOR"/>
42+
<testCaseId value="MC-133"/>
43+
<group value="CatalogSearch"/>
44+
</annotations>
45+
<before>
46+
<createData entity="ApiProductWithDescription" 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="AdvanceCatalogSearchSimpleProductByDescriptionTest">
61+
<annotations>
62+
<features value="CatalogSearch"/>
63+
<stories value="Advanced catalog search for simple products"/>
64+
<title value="Advanced catalog search for simple products by product description"/>
65+
<description value="Advanced catalog search for simple products by product description"/>
66+
<severity value="MAJOR"/>
67+
<testCaseId value="MC-134"/>
68+
<group value="CatalogSearch"/>
69+
</annotations>
70+
<before>
71+
<createData entity="ApiProductWithDescription" 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="AdvanceCatalogSearchSimpleProductByShortDescriptionTest">
86+
<annotations>
87+
<features value="CatalogSearch"/>
88+
<stories value="Advanced catalog search for simple products"/>
89+
<title value="Advanced catalog search for simple products by product short description"/>
90+
<description value="Advanced catalog search for simple products by product short description"/>
91+
<severity value="MAJOR"/>
92+
<testCaseId value="MC-135"/>
93+
<group value="CatalogSearch"/>
94+
</annotations>
95+
<before>
96+
<createData entity="ApiProductWithDescription" 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="AdvanceCatalogSearchSimpleProductByPriceTest">
111+
<annotations>
112+
<features value="CatalogSearch"/>
113+
<stories value="Advanced catalog search for simple products"/>
114+
<title value="Advanced catalog search for simple products by product price"/>
115+
<description value="Advanced catalog search for simple products by price"/>
116+
<severity value="MAJOR"/>
117+
<testCaseId value="MC-136"/>
118+
<group value="CatalogSearch"/>
119+
</annotations>
120+
<before>
121+
<createData entity="ApiProductWithDescription" 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>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/CatalogSearch/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
},
1313
"require": {
1414
"magento/magento2-functional-testing-framework": "1.0.0",
15+
"magento/magento2-functional-test-module-backend": "100.0.0-dev",
1516
"magento/magento2-functional-test-module-catalog": "100.0.0-dev",
17+
"magento/magento2-functional-test-module-eav": "100.0.0-dev",
1618
"magento/magento2-functional-test-module-search": "100.0.0-dev",
1719
"magento/magento2-functional-test-module-theme": "100.0.0-dev",
1820
"magento/magento2-functional-test-module-ui": "100.0.0-dev",
1921
"magento/magento2-functional-test-module-store": "100.0.0-dev",
22+
"magento/magento2-functional-test-module-catalog-inventory": "100.0.0-dev",
2023
"php": "~7.1.3||~7.2.0"
2124
},
2225
"suggest": {
23-
"magento/magento2-functional-test-module-backend": "100.0.0-dev",
24-
"magento/magento2-functional-test-module-catalog-inventory": "100.0.0-dev",
2526
"magento/magento2-functional-test-module-customer": "100.0.0-dev",
26-
"magento/magento2-functional-test-module-directory": "100.0.0-dev",
27-
"magento/magento2-functional-test-module-eav": "100.0.0-dev"
27+
"magento/magento2-functional-test-module-directory": "100.0.0-dev"
2828
},
2929
"autoload": {
3030
"psr-4": {

0 commit comments

Comments
 (0)