Skip to content

Commit 310a398

Browse files
committed
MC-249: Guest customer should be able to search configurable product by attributes of child products
- add a different attribute to the first child product
1 parent 70798ca commit 310a398

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
<data key="quantity">100</data>
132132
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
133133
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
134-
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
135134
</entity>
136135
<entity name="ApiSimpleTwo" type="product2">
137136
<data key="sku" unique="suffix">api-simple-product-two</data>
@@ -158,7 +157,6 @@
158157
<data key="quantity">100</data>
159158
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
160159
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
161-
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
162160
</entity>
163161
<entity name="VirtualProduct" type="product">
164162
<data key="sku" unique="suffix">virtualproduct</data>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Test/StorefrontConfigurableProductChildSearchTest.xml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<requiredEntity createDataKey="createConfigProductAttribute"/>
5252
</createData>
5353

54-
<!-- Add the third attribute we just created to default attribute set -->
54+
<!-- Add the second attribute we just created to default attribute set -->
5555
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet2">
5656
<requiredEntity createDataKey="createConfigProductAttributeMultiSelect"/>
5757
</createData>
@@ -98,6 +98,20 @@
9898
<requiredEntity createDataKey="createConfigChildProduct2"/>
9999
</createData>
100100

101+
<!-- Create an attribute with two options to be used in the first child product (in the UI) -->
102+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttributeSelect"/>
103+
<createData entity="productAttributeOption5" stepKey="createConfigProductAttributeSelectOption1">
104+
<requiredEntity createDataKey="createConfigProductAttributeSelect"/>
105+
</createData>
106+
<createData entity="productAttributeOption6" stepKey="createConfigProductAttributeSelectOption2">
107+
<requiredEntity createDataKey="createConfigProductAttributeSelect"/>
108+
</createData>
109+
110+
<!-- Add the attribute we just created to default attribute set -->
111+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet3">
112+
<requiredEntity createDataKey="createConfigProductAttributeSelect"/>
113+
</createData>
114+
101115
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
102116
</before>
103117

@@ -123,12 +137,16 @@
123137
<argument name="description" value="sampleShortDescription"/>
124138
</actionGroup>
125139

126-
<pauseExecution stepKey="pause"/>
140+
<!-- Edit the attribute for the first simple product -->
141+
<selectOption stepKey="editSelectAttribute" selector="{{ModifyAttributes.nthExistingAttribute($$createConfigProductAttributeSelect.default_frontend_label$$)}}" userInput="$$createConfigProductAttributeSelectOption1.option[store_labels][0][label]$$"/>
142+
<scrollToTopOfPage stepKey="scrollToTop"/>
143+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
144+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
127145

128146
<!-- Quick search the storefront for the first attribute option -->
129147
<amOnPage stepKey="goToStoreFront" url="{{StorefrontHomePage.url}}"/>
130148
<waitForPageLoad stepKey="waitForStorefront"/>
131-
<fillField stepKey="searchStorefront1" selector="{{StorefrontPanelHeaderSection.search}}" userInput="$$createConfigProductAttributeOption1.option[store_labels][0][label]$$"/>
149+
<fillField stepKey="searchStorefront1" selector="{{StorefrontPanelHeaderSection.search}}" userInput="$$createConfigProductAttributeSelectOption1.option[store_labels][0][label]$$"/>
132150
<click stepKey="clickSearch1" selector="{{StorefrontPanelHeaderSection.searchButton}}"/>
133151
<seeElement stepKey="seeProduct1" selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}"/>
134152

@@ -142,4 +160,4 @@
142160
<click stepKey="clickSearch3" selector="{{StorefrontPanelHeaderSection.searchButton}}"/>
143161
<seeElement stepKey="seeProduct3" selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}"/>
144162
</test>
145-
</tests>
163+
</tests>

0 commit comments

Comments
 (0)