Skip to content

Commit ea826cf

Browse files
committed
Merge branch 'MAGETWO-93217' into 2.2-develop-mftf-pr5
2 parents 219144f + 21761d5 commit ea826cf

File tree

8 files changed

+308
-1
lines changed

8 files changed

+308
-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
@@ -53,4 +53,25 @@
5353
<data key="used_for_sort_by">true</data>
5454
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
5555
</entity>
56+
<entity name="ProductAttributeMultiselectTwoOptions" type="ProductAttribute">
57+
<data key="attribute_code" unique="suffix">attribute</data>
58+
<data key="frontend_input">multiselect</data>
59+
<data key="scope">global</data>
60+
<data key="is_required">false</data>
61+
<data key="is_unique">false</data>
62+
<data key="is_searchable">true</data>
63+
<data key="is_visible">true</data>
64+
<data key="is_visible_in_advanced_search">true</data>
65+
<data key="is_visible_on_front">true</data>
66+
<data key="is_filterable">true</data>
67+
<data key="is_filterable_in_search">true</data>
68+
<data key="used_in_product_listing">true</data>
69+
<data key="is_used_for_promo_rules">true</data>
70+
<data key="is_comparable">true</data>
71+
<data key="is_used_in_grid">true</data>
72+
<data key="is_visible_in_grid">true</data>
73+
<data key="is_filterable_in_grid">true</data>
74+
<data key="used_for_sort_by">true</data>
75+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
76+
</entity>
5677
</entities>

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,36 @@
2727
<entity name="ProductAttributeOptionGetter" type="ProductAttributeOption">
2828
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
2929
</entity>
30+
<entity name="ProductAttributeOption3" type="ProductAttributeOption">
31+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
32+
<data key="label" unique="suffix">option3</data>
33+
<data key="is_default">false</data>
34+
<data key="sort_order">2</data>
35+
<requiredEntity type="StoreLabel">Option3Store0</requiredEntity>
36+
<requiredEntity type="StoreLabel">Option3Store1</requiredEntity>
37+
</entity>
38+
<entity name="ProductAttributeOption4" type="ProductAttributeOption">
39+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
40+
<data key="label" unique="suffix">option4</data>
41+
<data key="is_default">false</data>
42+
<data key="sort_order">3</data>
43+
<requiredEntity type="StoreLabel">Option4Store0</requiredEntity>
44+
<requiredEntity type="StoreLabel">Option4Store1</requiredEntity>
45+
</entity>
46+
<entity name="ProductAttributeOption5" type="ProductAttributeOption">
47+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
48+
<data key="label" unique="suffix">option5</data>
49+
<data key="is_default">false</data>
50+
<data key="sort_order">4</data>
51+
<requiredEntity type="StoreLabel">Option5Store0</requiredEntity>
52+
<requiredEntity type="StoreLabel">Option5Store1</requiredEntity>
53+
</entity>
54+
<entity name="ProductAttributeOption6" type="ProductAttributeOption">
55+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
56+
<data key="label" unique="suffix">option6</data>
57+
<data key="is_default">false</data>
58+
<data key="sort_order">5</data>
59+
<requiredEntity type="StoreLabel">Option6Store0</requiredEntity>
60+
<requiredEntity type="StoreLabel">Option6Store1</requiredEntity>
61+
</entity>
3062
</entities>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,17 @@
188188
<requiredEntity type="custom_attribute_array">ApiProductDescription</requiredEntity>
189189
<requiredEntity type="custom_attribute_array">ApiProductShortDescription</requiredEntity>
190190
</entity>
191+
<entity name="ApiSimpleOneHidden" type="product2">
192+
<data key="sku" unique="suffix">api-simple-product</data>
193+
<data key="type_id">simple</data>
194+
<data key="attribute_set_id">4</data>
195+
<data key="visibility">1</data>
196+
<data key="name" unique="suffix">Api Simple Product</data>
197+
<data key="price">123.00</data>
198+
<data key="urlKey" unique="suffix">api-simple-product</data>
199+
<data key="status">1</data>
200+
<data key="quantity">100</data>
201+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
202+
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
203+
</entity>
191204
</entities>

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>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetSection.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@
1616
<element name="name" type="input" selector="#attribute_set_name"/>
1717
<element name="basedOn" type="select" selector="#skeleton_set"/>
1818
</section>
19-
</sections>
19+
<section name="AdminModifyAttributesSection">
20+
<!-- Parameter is the attribute name -->
21+
<element name="dropDownAttributeByName" type="select" selector="//*[text()='{{attributeName}}']/../..//select" parameterized="true"/>
22+
</section>
23+
</sections>

app/code/Magento/Cms/Test/Mftf/Page/StorefrontHomePage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
1111
<page name="StorefrontHomePage" url="/" module="Magento_Cms" area="storefront">
1212
<section name="StorefrontHeaderSection"/>
13+
<section name="StorefrontQuickSearchSection"/>
1314
</page>
1415
</pages>
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
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="CRITICAL"/>
18+
<testCaseId value="MAGETWO-75997"/>
19+
<group value="configurable"/>
20+
<group value="product"/>
21+
</annotations>
22+
<before>
23+
<!-- TODO: This should be converted to an actionGroup once MQE-993 is fixed. -->
24+
<!-- Create the category -->
25+
<createData entity="ApiCategory" stepKey="createCategory"/>
26+
27+
<!-- Create the configurable product and add it to the category -->
28+
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct">
29+
<requiredEntity createDataKey="createCategory"/>
30+
</createData>
31+
32+
<!-- Create an attribute with two options to be used in the first child product -->
33+
<createData entity="productAttributeWithDropdownTwoOptions" stepKey="createConfigProductAttribute"/>
34+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
35+
<requiredEntity createDataKey="createConfigProductAttribute"/>
36+
</createData>
37+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
38+
<requiredEntity createDataKey="createConfigProductAttribute"/>
39+
</createData>
40+
41+
<!-- Create an attribute with two options to be used in the second child product -->
42+
<createData entity="ProductAttributeMultiselectTwoOptions" stepKey="createConfigProductAttributeMultiSelect"/>
43+
<createData entity="ProductAttributeOption3" stepKey="createConfigProductAttributeOption1Multiselect">
44+
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
45+
</createData>
46+
<createData entity="ProductAttributeOption4" stepKey="createConfigProductAttributeOption2Multiselect">
47+
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
48+
</createData>
49+
50+
<!-- Add the attribute we just created to default attribute set -->
51+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
52+
<requiredEntity createDataKey="createConfigProductAttribute"/>
53+
</createData>
54+
55+
<!-- Add the second attribute we just created to default attribute set -->
56+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet2">
57+
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
58+
</createData>
59+
60+
<!-- Get the first option of the attribute we created -->
61+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
62+
<requiredEntity createDataKey="createConfigProductAttribute"/>
63+
</getData>
64+
65+
<!-- Get the first option of the second attribute we created -->
66+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption2">
67+
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
68+
</getData>
69+
70+
<!-- Create a simple product and give it the attribute with the first option -->
71+
<createData entity="ApiSimpleOneHidden" stepKey="createConfigChildProduct1">
72+
<requiredEntity createDataKey="createConfigProductAttribute"/>
73+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
74+
</createData>
75+
76+
<!-- Create a simple product and give it the attribute with the second option -->
77+
<createData entity="ApiSimpleOneHidden" 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+
<!-- Fill Short Description for first simple product -->
103+
<updateData entity="ApiSimpleProductUpdateDescription" createDataKey="createConfigChildProduct1" stepKey="updateSimpleProduct1Description" />
104+
105+
<!-- Fill Short Description for first simple product -->
106+
<updateData entity="ApiSimpleProductUpdateName" createDataKey="createConfigChildProduct1" stepKey="updateSimpleProduct1Name"/>
107+
108+
<!-- Create an attribute with two options to be used in the first child product (in the UI) -->
109+
<createData entity="productAttributeWithDropdownTwoOptions" stepKey="createConfigProductAttributeSelect"/>
110+
<createData entity="ProductAttributeOption5" stepKey="createConfigProductAttributeSelectOption1">
111+
<requiredEntity createDataKey="createConfigProductAttributeSelect"/>
112+
</createData>
113+
<createData entity="ProductAttributeOption6" stepKey="createConfigProductAttributeSelectOption2">
114+
<requiredEntity createDataKey="createConfigProductAttributeSelect"/>
115+
</createData>
116+
117+
<!-- Add the attribute we just created to default attribute set -->
118+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet3">
119+
<requiredEntity createDataKey="createConfigProductAttributeSelect"/>
120+
</createData>
121+
122+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
123+
124+
<!-- Go to the product page for the first product -->
125+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductGrid"/>
126+
<waitForPageLoad stepKey="waitForProductGridLoad"/>
127+
<actionGroup ref="filterProductGridBySku" stepKey="searchForSimpleProduct">
128+
<argument name="product" value="$$createConfigChildProduct1$$"/>
129+
</actionGroup>
130+
<click selector="{{AdminProductGridSection.productGridXRowYColumnButton('1', '2')}}" stepKey="openProductForEdit"/>
131+
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
132+
<!-- Edit the attribute for the first simple product -->
133+
<selectOption selector="{{AdminModifyAttributesSection.dropDownAttributeByName($$createConfigProductAttributeSelect.default_frontend_label$$)}}" userInput="$$createConfigProductAttributeSelectOption1.option[store_labels][0][label]$$" stepKey="editSelectAttribute"/>
134+
<scrollToTopOfPage stepKey="scrollToTop"/>
135+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
136+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
137+
138+
<!-- Go to the product page for the second product -->
139+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductGrid2"/>
140+
<waitForPageLoad stepKey="waitForProductGridLoad2"/>
141+
<actionGroup ref="filterProductGridBySku" stepKey="searchForSimpleProduct2">
142+
<argument name="product" value="$$createConfigChildProduct2$$"/>
143+
</actionGroup>
144+
<click selector="{{AdminProductGridSection.productGridXRowYColumnButton('1', '2')}}" stepKey="openProductForEdit2"/>
145+
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>
146+
<!-- Edit the attribute for the first second product -->
147+
<selectOption selector="{{AdminModifyAttributesSection.dropDownAttributeByName($$createConfigProductAttributeMultiSelect.default_frontend_label$$)}}" userInput="$$createConfigProductAttributeOption2Multiselect.option[store_labels][0][label]$$" stepKey="editSelectAttribute2"/>
148+
<scrollToTopOfPage stepKey="scrollToTop2"/>
149+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct2"/>
150+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess2"/>
151+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex1"/>
152+
<waitForPageLoad time="30" stepKey="waitForProductIndexPageLoad"/>
153+
<actionGroup ref="AdminResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/>
154+
</before>
155+
156+
<after>
157+
<actionGroup ref="logout" stepKey="logout"/>
158+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
159+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
160+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
161+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
162+
<deleteData createDataKey="createConfigProductAttributeMultiSelect" stepKey="deleteConfigProductAttributeMultiSelect"/>
163+
<deleteData createDataKey="createConfigProductAttributeSelect" stepKey="deleteConfigProductAttributeSelect"/>
164+
<deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/>
165+
</after>
166+
167+
<!-- Quick search the storefront for the first attribute option -->
168+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStoreFront"/>
169+
<waitForPageLoad stepKey="waitForStorefront"/>
170+
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createConfigProductAttributeSelectOption1.option[store_labels][0][label]$$" stepKey="searchStorefront1"/>
171+
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearch1"/>
172+
<seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}" stepKey="seeProduct1"/>
173+
174+
<!-- Quick search the storefront for the second attribute option -->
175+
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createConfigProductAttributeOption2Multiselect.option[store_labels][0][label]$$" stepKey="searchStorefront2"/>
176+
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearch2"/>
177+
<seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}" stepKey="seeProduct2"/>
178+
179+
<!-- Quick search the storefront for the first product description -->
180+
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="'$$createConfigChildProduct1.custom_attributes[short_description]$$'" stepKey="searchStorefront3"/>
181+
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearch3"/>
182+
<seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}" stepKey="seeProduct3"/>
183+
184+
<!-- Quick search the storefront for the first product name -->
185+
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="'$$createConfigChildProduct1.name$$'" stepKey="searchStorefront4"/>
186+
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearch4"/>
187+
<seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}" stepKey="seeProduct4"/>
188+
</test>
189+
</tests>

0 commit comments

Comments
 (0)