Skip to content

Commit b6cd741

Browse files
committed
MC-139: Guest customer should be able to advance search bundle product with product name
MC-143: Guest customer should be able to advance search bundle product with product sku MC-242: Guest customer should be able to advance search bundle product with product description MC-250: Guest customer should be able to advance search bundle product with product short description MC-251: Guest customer should be able to advance search bundle product with product price - added mftf tests
1 parent 44f9541 commit b6cd741

File tree

9 files changed

+368
-0
lines changed

9 files changed

+368
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="ApiBundleLink" type="bundle_link">
12+
<var key="sku" entityKey="sku" entityType="product2"/>
13+
<var key="option_id" entityKey="option_id" entityType="bundle_options"/>
14+
<var key="sku" entityKey="sku" entityType="product"/>
15+
<data key="qty">1</data>
16+
<data key="is_default">1</data>
17+
<data key="price">1.11</data>
18+
<data key="price_type">1</data>
19+
<data key="can_change_quantity">1</data>
20+
</entity>
21+
</entities>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="DropdownBundleOption" type="bundle_option">
12+
<data key="title" unique="suffix">bundle-option-dropdown</data>
13+
<data key="required">true</data>
14+
<data key="type">dropdown</data>
15+
<data key="position">1</data>
16+
<var key="sku" entityKey="sku" entityType="product2"/>
17+
</entity>
18+
<entity name="AllBundleOptions" type="bundle_options">
19+
<var key="sku" entityKey="sku" entityType="product"/>
20+
</entity>
21+
</entities>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
10+
<entity name="CustomAttributeDynamicPrice" type="custom_attribute">
11+
<data key="attribute_code">price_type</data>
12+
<data key="value">0</data>
13+
</entity>
14+
<entity name="CustomAttributeFixPrice" type="custom_attribute">
15+
<data key="attribute_code">price_type</data>
16+
<data key="value">1</data>
17+
</entity>
18+
<entity name="CustomAttributePriceView" type="custom_attribute">
19+
<data key="attribute_code">price_view</data>
20+
<data key="value">1</data>
21+
</entity>
22+
</entities>

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,18 @@
1919
<data key="status">1</data>
2020
<data key="urlKey" unique="suffix">bundleproduct</data>
2121
</entity>
22+
<entity name="ApiBundleProduct" type="product2">
23+
<data key="name" unique="suffix">Api Bundle Product</data>
24+
<data key="sku" unique="suffix">api-bundle-product</data>
25+
<data key="type_id">bundle</data>
26+
<data key="attribute_set_id">4</data>
27+
<data key="visibility">4</data>
28+
<data key="status">1</data>
29+
<data key="urlKey" unique="suffix">api-bundle-product</data>
30+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
31+
<requiredEntity type="custom_attribute">ApiProductDescription</requiredEntity>
32+
<requiredEntity type="custom_attribute">ApiProductShortDescription</requiredEntity>
33+
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
34+
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
35+
</entity>
2236
</entities>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
11+
<operation name="CreateBundleLink" dataType="bundle_link" type="create" auth="adminOauth" url="/V1/bundle-products/{sku}/links/{option_id}" method="POST">
12+
<contentType>application/json</contentType>
13+
<object dataType="bundle_link" key="linkedProduct">
14+
<field key="sku">string</field>
15+
<field key="option_id">integer</field>
16+
<field key="qty">integer</field>
17+
<field key="position">integer</field>
18+
<field key="is_default">boolean</field>
19+
<field key="price">number</field>
20+
<field key="price_type">integer</field>
21+
<field key="can_change_quantity">integer</field>
22+
</object>
23+
</operation>
24+
</operations>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
11+
<operation name="CreateBundleOption" dataType="bundle_option" type="create" auth="adminOauth" url="/V1/bundle-products/options/add" method="POST">
12+
<contentType>application/json</contentType>
13+
<object dataType="bundle_option" key="option">
14+
<field key="title">string</field>
15+
<field key="required">boolean</field>
16+
<field key="type">string</field>
17+
<field key="position">integer</field>
18+
<field key="sku">string</field>
19+
</object>
20+
</operation>
21+
</operations>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
11+
<operation name="GetAllBundleOptions" dataType="bundle_options" type="get" auth="adminOauth" url="/V1/bundle-products/{sku}/options/all" method="GET">
12+
<contentType>application/json</contentType>
13+
</operation>
14+
</operations>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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="AdvanceCatalogSearchBundleByNameTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
12+
<annotations>
13+
<group value="Catalog"/>
14+
</annotations>
15+
<before>
16+
<createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/>
17+
<createData entity="ApiProductWithDescription" stepKey="simple2" before="createProductOne"/>
18+
<createData entity="ApiBundleProduct" stepKey="createProductOne"/>
19+
<createData entity="DropdownBundleOption" stepKey="bundleOption">
20+
<requiredEntity createDataKey="createProductOne"/>
21+
</createData>
22+
<getData entity="AllBundleOptions" index="0" stepKey="getBundleOption">
23+
<requiredEntity createDataKey="createProductOne"/>
24+
</getData>
25+
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
26+
<requiredEntity createDataKey="createProductOne"/>
27+
<requiredEntity createDataKey="getBundleOption"/>
28+
<requiredEntity createDataKey="simple1"/>
29+
</createData>
30+
<createData entity="ApiBundleLink" stepKey="createBundleLink2">
31+
<requiredEntity createDataKey="createProductOne"/>
32+
<requiredEntity createDataKey="getBundleOption"/>
33+
<requiredEntity createDataKey="simple2"/>
34+
</createData>
35+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
36+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
37+
</before>
38+
</test>
39+
<test name="AdvanceCatalogSearchBundleBySkuTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
40+
<annotations>
41+
<group value="Catalog"/>
42+
</annotations>
43+
<before>
44+
<createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/>
45+
<createData entity="ApiProductWithDescription" stepKey="simple2" before="createProductOne"/>
46+
<createData entity="ApiBundleProduct" stepKey="createProductOne"/>
47+
<createData entity="DropdownBundleOption" stepKey="bundleOption">
48+
<requiredEntity createDataKey="createProductOne"/>
49+
</createData>
50+
<getData entity="AllBundleOptions" index="0" stepKey="getBundleOption">
51+
<requiredEntity createDataKey="createProductOne"/>
52+
</getData>
53+
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
54+
<requiredEntity createDataKey="createProductOne"/>
55+
<requiredEntity createDataKey="getBundleOption"/>
56+
<requiredEntity createDataKey="simple1"/>
57+
</createData>
58+
<createData entity="ApiBundleLink" stepKey="createBundleLink2">
59+
<requiredEntity createDataKey="createProductOne"/>
60+
<requiredEntity createDataKey="getBundleOption"/>
61+
<requiredEntity createDataKey="simple2"/>
62+
</createData>
63+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
64+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
65+
</before>
66+
</test>
67+
<test name="AdvanceCatalogSearchBundleByDescriptionTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
68+
<annotations>
69+
<group value="Catalog"/>
70+
</annotations>
71+
<before>
72+
<createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/>
73+
<createData entity="ApiProductWithDescription" stepKey="simple2" before="createProductOne"/>
74+
<createData entity="ApiBundleProduct" stepKey="createProductOne"/>
75+
<createData entity="DropdownBundleOption" stepKey="bundleOption">
76+
<requiredEntity createDataKey="createProductOne"/>
77+
</createData>
78+
<getData entity="AllBundleOptions" index="0" stepKey="getBundleOption">
79+
<requiredEntity createDataKey="createProductOne"/>
80+
</getData>
81+
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
82+
<requiredEntity createDataKey="createProductOne"/>
83+
<requiredEntity createDataKey="getBundleOption"/>
84+
<requiredEntity createDataKey="simple1"/>
85+
</createData>
86+
<createData entity="ApiBundleLink" stepKey="createBundleLink2">
87+
<requiredEntity createDataKey="createProductOne"/>
88+
<requiredEntity createDataKey="getBundleOption"/>
89+
<requiredEntity createDataKey="simple2"/>
90+
</createData>
91+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
92+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
93+
</before>
94+
</test>
95+
<test name="AdvanceCatalogSearchBundleByShortDescriptionTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
96+
<annotations>
97+
<group value="Catalog"/>
98+
</annotations>
99+
<before>
100+
<createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/>
101+
<createData entity="ApiProductWithDescription" stepKey="simple2" before="createProductOne"/>
102+
<createData entity="ApiBundleProduct" stepKey="createProductOne"/>
103+
<createData entity="DropdownBundleOption" stepKey="bundleOption">
104+
<requiredEntity createDataKey="createProductOne"/>
105+
</createData>
106+
<getData entity="AllBundleOptions" index="0" stepKey="getBundleOption">
107+
<requiredEntity createDataKey="createProductOne"/>
108+
</getData>
109+
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
110+
<requiredEntity createDataKey="createProductOne"/>
111+
<requiredEntity createDataKey="getBundleOption"/>
112+
<requiredEntity createDataKey="simple1"/>
113+
</createData>
114+
<createData entity="ApiBundleLink" stepKey="createBundleLink2">
115+
<requiredEntity createDataKey="createProductOne"/>
116+
<requiredEntity createDataKey="getBundleOption"/>
117+
<requiredEntity createDataKey="simple2"/>
118+
</createData>
119+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
120+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
121+
</before>
122+
</test>
123+
<test name="AdvanceCatalogSearchBundleByPriceTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
124+
<annotations>
125+
<group value="Catalog"/>
126+
</annotations>
127+
<before>
128+
<createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/>
129+
<createData entity="ApiProductWithDescription" stepKey="simple2" before="createProductOne"/>
130+
<createData entity="ApiBundleProduct" stepKey="createProductOne"/>
131+
<createData entity="DropdownBundleOption" stepKey="bundleOption">
132+
<requiredEntity createDataKey="createProductOne"/>
133+
</createData>
134+
<getData entity="AllBundleOptions" index="0" stepKey="getBundleOption">
135+
<requiredEntity createDataKey="createProductOne"/>
136+
</getData>
137+
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
138+
<requiredEntity createDataKey="createProductOne"/>
139+
<requiredEntity createDataKey="getBundleOption"/>
140+
<requiredEntity createDataKey="simple1"/>
141+
</createData>
142+
<createData entity="ApiBundleLink" stepKey="createBundleLink2">
143+
<requiredEntity createDataKey="createProductOne"/>
144+
<requiredEntity createDataKey="getBundleOption"/>
145+
<requiredEntity createDataKey="simple2"/>
146+
</createData>
147+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
148+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
149+
</before>
150+
</test>
151+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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="AdvanceCatalogSearchBundleByNameTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
12+
<annotations>
13+
<features value="CatalogSearch"/>
14+
<stories value="Advanced Catalog Product Search for all product types"/>
15+
<title value="Guest customer should be able to advance search Bundle product with product name"/>
16+
<description value="Guest customer should be able to advance search Bundle product with product name"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-139"/>
19+
<group value="CatalogSearch"/>
20+
</annotations>
21+
</test>
22+
<test name="AdvanceCatalogSearchBundleBySkuTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
23+
<annotations>
24+
<features value="CatalogSearch"/>
25+
<stories value="Advanced Catalog Product Search for all product types"/>
26+
<title value="Guest customer should be able to advance search Bundle product with product sku"/>
27+
<description value="Guest customer should be able to advance search Bundle product with product sku"/>
28+
<severity value="MAJOR"/>
29+
<testCaseId value="MC-143"/>
30+
<group value="CatalogSearch"/>
31+
</annotations>
32+
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductSkuActionGroup" stepKey="search">
33+
<argument name="sku" value="$$createProductOne.sku$$"/>
34+
</actionGroup>
35+
</test>
36+
<test name="AdvanceCatalogSearchBundleByDescriptionTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
37+
<annotations>
38+
<features value="CatalogSearch"/>
39+
<stories value="Advanced Catalog Product Search for all product types"/>
40+
<title value="Guest customer should be able to advance search Bundle product with product description"/>
41+
<description value="Guest customer should be able to advance search Bundle product with product description"/>
42+
<severity value="MAJOR"/>
43+
<testCaseId value="MC-242"/>
44+
<group value="CatalogSearch"/>
45+
</annotations>
46+
<actionGroup ref="StorefrontAdvancedCatalogSearchByDescriptionActionGroup" stepKey="search">
47+
<argument name="description" value="$$createProductOne.custom_attributes[description]$$"/>
48+
</actionGroup>
49+
</test>
50+
<test name="AdvanceCatalogSearchBundleByShortDescriptionTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
51+
<annotations>
52+
<features value="CatalogSearch"/>
53+
<stories value="Advanced Catalog Product Search for all product types"/>
54+
<title value="Guest customer should be able to advance search Bundle product with product short description"/>
55+
<description value="Guest customer should be able to advance search Bundle product with product short description"/>
56+
<severity value="MAJOR"/>
57+
<testCaseId value="MC-250"/>
58+
<group value="CatalogSearch"/>
59+
</annotations>
60+
<actionGroup ref="StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup" stepKey="search">
61+
<argument name="shortDescription" value="$$createProductOne.custom_attributes[short_description]$$"/>
62+
</actionGroup>
63+
</test>
64+
<test name="AdvanceCatalogSearchBundleByPriceTest" extends="AdvanceCatalogSearchSimpleProductByNameTest">
65+
<annotations>
66+
<features value="CatalogSearch"/>
67+
<stories value="Advanced Catalog Product Search for all product types"/>
68+
<title value="Guest customer should be able to advance search Bundle product with product price"/>
69+
<description value="Guest customer should be able to advance search Bundle product with product price"/>
70+
<severity value="MAJOR"/>
71+
<testCaseId value="MC-251"/>
72+
<group value="CatalogSearch"/>
73+
</annotations>
74+
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup" stepKey="search">
75+
<argument name="name" value="$$createProductOne.name$$"/>
76+
<argument name="priceFrom" value="$$simple1.price$$"/>
77+
<argument name="priceTo" value="$$simple1.price$$"/>
78+
</actionGroup>
79+
</test>
80+
</tests>

0 commit comments

Comments
 (0)