Skip to content

Commit 3a41c26

Browse files
committed
Merge branch 'MC-249' into RE-develop
2 parents c06629e + 4d8ff88 commit 3a41c26

File tree

6 files changed

+273
-1
lines changed

6 files changed

+273
-1
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,25 @@
9494
<data key="used_for_sort_by">true</data>
9595
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
9696
</entity>
97+
<entity name="productAttributeMultiselectTwoOptions" type="ProductAttribute">
98+
<data key="attribute_code" unique="suffix">attribute</data>
99+
<data key="frontend_input">multiselect</data>
100+
<data key="scope">global</data>
101+
<data key="is_required">false</data>
102+
<data key="is_unique">false</data>
103+
<data key="is_searchable">true</data>
104+
<data key="is_visible">true</data>
105+
<data key="is_visible_in_advanced_search">true</data>
106+
<data key="is_visible_on_front">true</data>
107+
<data key="is_filterable">true</data>
108+
<data key="is_filterable_in_search">true</data>
109+
<data key="used_in_product_listing">true</data>
110+
<data key="is_used_for_promo_rules">true</data>
111+
<data key="is_comparable">true</data>
112+
<data key="is_used_in_grid">true</data>
113+
<data key="is_visible_in_grid">true</data>
114+
<data key="is_filterable_in_grid">true</data>
115+
<data key="used_for_sort_by">true</data>
116+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
117+
</entity>
97118
</entities>

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,38 @@
2424
<requiredEntity type="StoreLabel">Option2Store0</requiredEntity>
2525
<requiredEntity type="StoreLabel">Option2Store1</requiredEntity>
2626
</entity>
27+
<entity name="productAttributeOption3" type="ProductAttributeOption">
28+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
29+
<data key="label" unique="suffix">option3</data>
30+
<data key="is_default">false</data>
31+
<data key="sort_order">2</data>
32+
<requiredEntity type="StoreLabel">Option3Store0</requiredEntity>
33+
<requiredEntity type="StoreLabel">Option3Store1</requiredEntity>
34+
</entity>
35+
<entity name="productAttributeOption4" type="ProductAttributeOption">
36+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
37+
<data key="label" unique="suffix">option4</data>
38+
<data key="is_default">false</data>
39+
<data key="sort_order">3</data>
40+
<requiredEntity type="StoreLabel">Option4Store0</requiredEntity>
41+
<requiredEntity type="StoreLabel">Option4Store1</requiredEntity>
42+
</entity>
43+
<entity name="productAttributeOption5" type="ProductAttributeOption">
44+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
45+
<data key="label" unique="suffix">option5</data>
46+
<data key="is_default">false</data>
47+
<data key="sort_order">4</data>
48+
<requiredEntity type="StoreLabel">Option5Store0</requiredEntity>
49+
<requiredEntity type="StoreLabel">Option5Store1</requiredEntity>
50+
</entity>
51+
<entity name="productAttributeOption6" type="ProductAttributeOption">
52+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
53+
<data key="label" unique="suffix">option6</data>
54+
<data key="is_default">false</data>
55+
<data key="sort_order">5</data>
56+
<requiredEntity type="StoreLabel">Option6Store0</requiredEntity>
57+
<requiredEntity type="StoreLabel">Option6Store1</requiredEntity>
58+
</entity>
2759
<entity name="ProductAttributeOptionGetter" type="ProductAttributeOption">
2860
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
2961
</entity>

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,19 @@
119119
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
120120
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
121121
</entity>
122+
<entity name="ApiSimpleOneHidden" type="product2">
123+
<data key="sku" unique="suffix">api-simple-product</data>
124+
<data key="type_id">simple</data>
125+
<data key="attribute_set_id">4</data>
126+
<data key="visibility">1</data>
127+
<data key="name" unique="suffix">Api Simple Product</data>
128+
<data key="price">123.00</data>
129+
<data key="urlKey" unique="suffix">api-simple-product</data>
130+
<data key="status">1</data>
131+
<data key="quantity">100</data>
132+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
133+
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
134+
</entity>
122135
<entity name="ApiSimpleTwo" type="product2">
123136
<data key="sku" unique="suffix">api-simple-product-two</data>
124137
<data key="type_id">simple</data>
@@ -132,6 +145,19 @@
132145
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
133146
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
134147
</entity>
148+
<entity name="ApiSimpleTwoHidden" type="product2">
149+
<data key="sku" unique="suffix">api-simple-product-two</data>
150+
<data key="type_id">simple</data>
151+
<data key="attribute_set_id">4</data>
152+
<data key="visibility">1</data>
153+
<data key="name" unique="suffix">Api Simple Product Two</data>
154+
<data key="price">234.00</data>
155+
<data key="urlKey" unique="suffix">api-simple-product-two</data>
156+
<data key="status">1</data>
157+
<data key="quantity">100</data>
158+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
159+
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
160+
</entity>
135161
<entity name="VirtualProduct" type="product">
136162
<data key="sku" unique="suffix">virtualproduct</data>
137163
<data key="type_id">virtual</data>

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,36 @@
2424
<data key="store_id">1</data>
2525
<data key="label">option2</data>
2626
</entity>
27+
<entity name="Option3Store0" type="StoreLabel">
28+
<data key="store_id">0</data>
29+
<data key="label">option3</data>
30+
</entity>
31+
<entity name="Option3Store1" type="StoreLabel">
32+
<data key="store_id">1</data>
33+
<data key="label">option3</data>
34+
</entity>
35+
<entity name="Option4Store0" type="StoreLabel">
36+
<data key="store_id">0</data>
37+
<data key="label">option4</data>
38+
</entity>
39+
<entity name="Option4Store1" type="StoreLabel">
40+
<data key="store_id">1</data>
41+
<data key="label">option4</data>
42+
</entity>
43+
<entity name="Option5Store0" type="StoreLabel">
44+
<data key="store_id">0</data>
45+
<data key="label">option5</data>
46+
</entity>
47+
<entity name="Option5Store1" type="StoreLabel">
48+
<data key="store_id">1</data>
49+
<data key="label">option5</data>
50+
</entity>
51+
<entity name="Option6Store0" type="StoreLabel">
52+
<data key="store_id">0</data>
53+
<data key="label">option6</data>
54+
</entity>
55+
<entity name="Option6Store1" type="StoreLabel">
56+
<data key="store_id">1</data>
57+
<data key="label">option6</data>
58+
</entity>
2759
</entities>
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="StorefrontConfigurableProductChildSearchTest">
12+
<annotations>
13+
<features value="ConfigurableProduct"/>
14+
<stories value="View configurable product details in storefront"/>
15+
<title value="Guest customer should be able to search configurable product by attributes of child products"/>
16+
<description value="Guest customer should be able to search configurable product by attributes of child products"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-249"/>
19+
<group value="ConfigurableProduct"/>
20+
</annotations>
21+
<before>
22+
<!-- TODO: This should be converted to an actionGroup once MQE-993 is fixed. -->
23+
<!-- Create the category -->
24+
<createData entity="ApiCategory" stepKey="createCategory"/>
25+
26+
<!-- Create the configurable product and add it to the category -->
27+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
28+
<requiredEntity createDataKey="createCategory"/>
29+
</createData>
30+
31+
<!-- Create an attribute with two options to be used in the first child product -->
32+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
33+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
34+
<requiredEntity createDataKey="createConfigProductAttribute"/>
35+
</createData>
36+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
37+
<requiredEntity createDataKey="createConfigProductAttribute"/>
38+
</createData>
39+
40+
<!-- Create an attribute with two options to be used in the second child product -->
41+
<createData entity="productAttributeMultiselectTwoOptions" stepKey="createConfigProductAttributeMultiSelect"/>
42+
<createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption1Multiselect">
43+
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
44+
</createData>
45+
<createData entity="productAttributeOption4" stepKey="createConfigProductAttributeOption2Multiselect">
46+
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
47+
</createData>
48+
49+
<!-- Add the attribute we just created to default attribute set -->
50+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
51+
<requiredEntity createDataKey="createConfigProductAttribute"/>
52+
</createData>
53+
54+
<!-- Add the second attribute we just created to default attribute set -->
55+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet2">
56+
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
57+
</createData>
58+
59+
<!-- Get the first option of the attribute we created -->
60+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
61+
<requiredEntity createDataKey="createConfigProductAttribute"/>
62+
</getData>
63+
64+
<!-- Get the first option of the second attribute we created -->
65+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption2">
66+
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
67+
</getData>
68+
69+
<!-- Create a simple product and give it the attribute with the first option -->
70+
<createData entity="ApiSimpleOneHidden" stepKey="createConfigChildProduct1">
71+
<requiredEntity createDataKey="createConfigProductAttribute"/>
72+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
73+
</createData>
74+
<updateData entity="ApiSimpleProductUpdateDescription" stepKey="updateSimpleProduct1" createDataKey="createConfigChildProduct1"/>
75+
76+
<!-- Create a simple product and give it the attribute with the second option -->
77+
<createData entity="ApiSimpleTwoHidden" stepKey="createConfigChildProduct2">
78+
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
79+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
80+
</createData>
81+
82+
<!-- Create the configurable product -->
83+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
84+
<requiredEntity createDataKey="createConfigProduct"/>
85+
<requiredEntity createDataKey="createConfigProductAttribute"/>
86+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
87+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
88+
</createData>
89+
90+
<!-- Add the first simple product to the configurable product -->
91+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
92+
<requiredEntity createDataKey="createConfigProduct"/>
93+
<requiredEntity createDataKey="createConfigChildProduct1"/>
94+
</createData>
95+
96+
<!-- Add the second simple product to the configurable product -->
97+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
98+
<requiredEntity createDataKey="createConfigProduct"/>
99+
<requiredEntity createDataKey="createConfigChildProduct2"/>
100+
</createData>
101+
102+
<!-- Create an attribute with two options to be used in the first child product (in the UI) -->
103+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttributeSelect"/>
104+
<createData entity="productAttributeOption5" stepKey="createConfigProductAttributeSelectOption1">
105+
<requiredEntity createDataKey="createConfigProductAttributeSelect"/>
106+
</createData>
107+
<createData entity="productAttributeOption6" stepKey="createConfigProductAttributeSelectOption2">
108+
<requiredEntity createDataKey="createConfigProductAttributeSelect"/>
109+
</createData>
110+
111+
<!-- Add the attribute we just created to default attribute set -->
112+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet3">
113+
<requiredEntity createDataKey="createConfigProductAttributeSelect"/>
114+
</createData>
115+
116+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
117+
118+
<!-- Go to the product page for the first product -->
119+
<amOnPage stepKey="goToProductGrid" url="{{ProductCatalogPage.url}}"/>
120+
<waitForPageLoad stepKey="waitForProductGridLoad"/>
121+
<actionGroup stepKey="searchForSimpleProduct" ref="filterProductGridBySku2">
122+
<argument name="sku" value="$$createConfigChildProduct1.sku$$"/>
123+
</actionGroup>
124+
<actionGroup stepKey="openProductEditPage" ref="openProducForEditByClickingRowXColumnYInProductGrid"/>
125+
126+
<!-- Edit the attribute for the first simple product -->
127+
<selectOption stepKey="editSelectAttribute" selector="{{ModifyAttributes.nthExistingAttribute($$createConfigProductAttributeSelect.default_frontend_label$$)}}" userInput="$$createConfigProductAttributeSelectOption1.option[store_labels][0][label]$$"/>
128+
<scrollToTopOfPage stepKey="scrollToTop"/>
129+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
130+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
131+
</before>
132+
133+
<after>
134+
<amOnPage url="admin/admin/auth/logout/" stepKey="logout"/>
135+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
136+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
137+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
138+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
139+
<deleteData createDataKey="createConfigProductAttributeMultiSelect" stepKey="deleteConfigProductAttributeMultiSelect"/>
140+
<deleteData createDataKey="createConfigProductAttributeSelect" stepKey="deleteConfigProductAttributeSelect"/>
141+
<deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/>
142+
</after>
143+
144+
<!-- Quick search the storefront for the first attribute option -->
145+
<amOnPage stepKey="goToStoreFront" url="{{StorefrontHomePage.url}}"/>
146+
<waitForPageLoad stepKey="waitForStorefront"/>
147+
<fillField stepKey="searchStorefront1" selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createConfigProductAttributeSelectOption1.option[store_labels][0][label]$$"/>
148+
<click stepKey="clickSearch1" selector="{{StorefrontQuickSearchSection.searchButton}}"/>
149+
<seeElement stepKey="seeProduct1" selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}"/>
150+
151+
<!-- Quick search the storefront for the second attribute option -->
152+
<fillField stepKey="searchStorefront2" selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createConfigProductAttributeOption1Multiselect.option[store_labels][0][label]$$"/>
153+
<click stepKey="clickSearch2" selector="{{StorefrontQuickSearchSection.searchButton}}"/>
154+
<seeElement stepKey="seeProduct2" selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}"/>
155+
156+
<!-- Quick search the storefront for the first product description -->
157+
<fillField stepKey="searchStorefront3" selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="'$$createConfigChildProduct1.custom_attributes[short_description]$$'"/>
158+
<click stepKey="clickSearch3" selector="{{StorefrontQuickSearchSection.searchButton}}"/>
159+
<seeElement stepKey="seeProduct3" selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}"/>
160+
</test>
161+
</tests>

app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="StorefrontQuickSearchSection">
1212
<element name="searchPhrase" type="input" selector="#search"/>
13-
<element name="searchButton" type="button" selector="button.action.search"/>
13+
<element name="searchButton" type="button" selector="button.action.search" timeout="30"/>
1414
</section>
1515
</sections>

0 commit comments

Comments
 (0)