Skip to content

Commit b94c4ab

Browse files
committed
MC-23546: Child Configurable product does not save disabled status via API
1 parent f9a8884 commit b94c4ab

File tree

2 files changed

+111
-2
lines changed

2 files changed

+111
-2
lines changed

app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,14 +607,14 @@
607607
<test name="QuickSearchConfigurableChildren">
608608
<annotations>
609609
<stories value="Search Product on Storefront"/>
610-
<title value="User should be able to use Quick Search to a configurable product's child products"/>
610+
<title value="Deprecated. User should be able to use Quick Search to a configurable product's child products"/>
611611
<description value="Use Quick Search to find a configurable product with enabled/disable children"/>
612612
<severity value="MAJOR"/>
613613
<testCaseId value="MC-14798"/>
614614
<group value="CatalogSearch"/>
615615
<group value="mtf_migrated"/>
616616
<skip>
617-
<issueId value="MC-15101"/>
617+
<issueId value="DEPRECATED">Use StorefrontQuickSearchConfigurableChildrenTest instead.</issueId>
618618
</skip>
619619
</annotations>
620620
<before>
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontQuickSearchConfigurableChildrenTest">
12+
<annotations>
13+
<stories value="Search Product on Storefront"/>
14+
<title value="User should be able to use Quick Search to a configurable product's child products"/>
15+
<description value="Use Quick Search to find a configurable product with enabled/disable children"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-14798"/>
18+
<group value="CatalogSearch"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<!-- Create the category -->
23+
<createData entity="ApiCategory" stepKey="createCategory"/>
24+
<!-- Create blank AttributeSet-->
25+
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/>
26+
<!-- Create an attribute with two options to be used in the first child product -->
27+
<createData entity="hiddenDropdownAttributeWithOptions" stepKey="createProductAttribute"/>
28+
<createData entity="productAttributeOption1" stepKey="createProductAttributeOption">
29+
<requiredEntity createDataKey="createProductAttribute"/>
30+
</createData>
31+
32+
<!-- Assign attribute to set -->
33+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
34+
<actionGroup ref="GoToAttributeGridPageActionGroup" stepKey="goToAttributeSetPage"/>
35+
<actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="openAttributeSetByName">
36+
<argument name="name" value="$createAttributeSet.attribute_set_name$"/>
37+
</actionGroup>
38+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup">
39+
<argument name="group" value="Product Details"/>
40+
<argument name="attribute" value="$createProductAttribute.attribute_code$"/>
41+
</actionGroup>
42+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="savePage"/>
43+
44+
<!-- Get the first option of the attribute we created -->
45+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getAttributeOption">
46+
<requiredEntity createDataKey="createProductAttribute"/>
47+
</getData>
48+
49+
<!-- Create a simple product -->
50+
<createData entity="ApiSimpleOneHidden" storeCode="all" stepKey="createSimpleProduct">
51+
<field key="attribute_set_id">$createAttributeSet.attribute_set_id$</field>
52+
<requiredEntity createDataKey="createProductAttribute"/>
53+
<requiredEntity createDataKey="getAttributeOption"/>
54+
</createData>
55+
<updateData entity="ApiSimpleProductUpdateDescription" createDataKey="createSimpleProduct" stepKey="updateSimpleProduct"/>
56+
57+
<!-- Create the configurable product -->
58+
<createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct">
59+
<field key="attribute_set_id">$createAttributeSet.attribute_set_id$</field>
60+
<requiredEntity createDataKey="createCategory"/>
61+
</createData>
62+
<!-- Create the configurable product option -->
63+
<createData entity="ConfigurableProductOneOption" stepKey="createConfigProductOption">
64+
<requiredEntity createDataKey="createConfigurableProduct"/>
65+
<requiredEntity createDataKey="createProductAttribute"/>
66+
<requiredEntity createDataKey="getAttributeOption"/>
67+
</createData>
68+
<!-- Add the first simple product to the configurable product -->
69+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild">
70+
<requiredEntity createDataKey="createConfigurableProduct"/>
71+
<requiredEntity createDataKey="createSimpleProduct"/>
72+
</createData>
73+
74+
<!-- Perform reindex -->
75+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
76+
</before>
77+
<after>
78+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
79+
<deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/>
80+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
81+
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/>
82+
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/>
83+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
84+
</after>
85+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/>
86+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront">
87+
<argument name="phrase" value="$createConfigurableProduct.name$"/>
88+
</actionGroup>
89+
<actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="seeProductInGrid">
90+
<argument name="productName" value="$createConfigurableProduct.name$"/>
91+
<argument name="index" value="1"/>
92+
</actionGroup>
93+
94+
<!-- Disable Child Product -->
95+
<actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="openSimpleProduct">
96+
<argument name="productId" value="$createSimpleProduct.id$"/>
97+
</actionGroup>
98+
<actionGroup ref="ToggleProductEnabledActionGroup" stepKey="disableProduct"/>
99+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
100+
101+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePageAgain"/>
102+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefrontAgain">
103+
<argument name="phrase" value="$createConfigurableProduct.name$"/>
104+
</actionGroup>
105+
<actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeProductAnymore">
106+
<argument name="productName" value="$createConfigurableProduct.name$"/>
107+
</actionGroup>
108+
</test>
109+
</tests>

0 commit comments

Comments
 (0)