Skip to content

Commit 7f4b115

Browse files
committed
Merge remote-tracking branch 'origin/MC-37418' into 2.4-develop-pr123
2 parents b8a6d0f + 834ecfd commit 7f4b115

File tree

4 files changed

+145
-1
lines changed

4 files changed

+145
-1
lines changed

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ define([
4747
* Initialize object
4848
*/
4949
initialize: function () {
50-
var self = this;
50+
var self = this,
51+
popupDialog = jQuery('#product_composite_configure');
5152

5253
this._initWindowElements();
5354
jQuery.async('#product_composite_configure', function (el) {
55+
if (el !== popupDialog[0]) {
56+
el = popupDialog[0];
57+
}
5458
self.dialog = jQuery(el).modal({
5559
title: jQuery.mage.__('Configure Product'),
5660
type: 'slide',
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCustomerWishlistConfigureItemActionGroup">
12+
<arguments>
13+
<argument name="title" type="string" defaultValue="{{Attribute.label}}"/>
14+
<argument name="option" type="string" defaultValue="option1"/>
15+
<argument name="quantity" type="string" defaultValue="2"/>
16+
<argument name="productName" type="string" defaultValue="{{ApiConfigurableProductWithOutCategory.name}}"/>
17+
</arguments>
18+
<click selector="{{AdminCustomerWishlistSection.configureButton(productName)}}" stepKey="clickConfigureButton"/>
19+
<waitForElementVisible selector="{{AdminCustomerWishlistSection.productAttributeOptionsDropDown(title)}}" stepKey="waitForConfigurableOption"/>
20+
<selectOption selector="{{AdminCustomerWishlistSection.productAttributeOptionsDropDown(title)}}" userInput="{{option}}" stepKey="selectConfigurableOption"/>
21+
<fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQty"/>
22+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="confirmSave"/>
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerWishlistSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
<element name="deleteButton" type="text" selector="//*[@id='wishlistGrid_table']//*[@data-column='action']//*[text()='Delete']"/>
1515
<element name="deleteConfirm" type="button" selector=".modal-popup.confirm .action-primary.action-accept"/>
1616
<element name="gridTable" type="text" selector="#wishlistGrid_table"/>
17+
<element name="configureButton" type="text" selector="//table[@id='wishlistGrid_table']//tbody//td[@data-column='product_name' and contains(text(),'{{productName}}')]/parent::tr//td[@data-column='action']//a[@class='configure-item-link']" timeout="30" parameterized="true"/>
18+
<element name="productAttributeOptionsDropDown" type="text" selector="//label[contains(.,'{{var1}}')]/following::div[contains(@class,'control')]//select" parameterized="true"/>
19+
<element name="productQty" type="text" selector="table#wishlistGrid_table td.col-number[data-column=qty]"/>
1720
</section>
1821
</sections>
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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="AdminConfigureCustomerWishListItemTest">
12+
<annotations>
13+
<features value="Wishlist"/>
14+
<stories value="Wishlist item configuration"/>
15+
<title value="Admin can configure a customer wishlist item"/>
16+
<description value="Admin should be able to configure items from customer wishlist"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-40455"/>
19+
<useCaseId value="MC-37418"/>
20+
<group value="wishlist"/>
21+
</annotations>
22+
<before>
23+
<!-- Create the configurable product based on the data in the /data folder -->
24+
<createData entity="ApiConfigurableProductWithOutCategory" stepKey="createConfigProduct"/>
25+
26+
<!-- Make the configurable product have two options, that are children of the default attribute set -->
27+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
28+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
29+
<requiredEntity createDataKey="createConfigProductAttribute"/>
30+
</createData>
31+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
32+
<requiredEntity createDataKey="createConfigProductAttribute"/>
33+
</createData>
34+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
35+
<requiredEntity createDataKey="createConfigProductAttribute"/>
36+
</createData>
37+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
38+
<requiredEntity createDataKey="createConfigProductAttribute"/>
39+
</getData>
40+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
41+
<requiredEntity createDataKey="createConfigProductAttribute"/>
42+
</getData>
43+
44+
<!-- Create the 2 children that will be a part of the configurable product -->
45+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
46+
<requiredEntity createDataKey="createConfigProductAttribute"/>
47+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
48+
</createData>
49+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
50+
<requiredEntity createDataKey="createConfigProductAttribute"/>
51+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
52+
</createData>
53+
54+
<!-- Assign the two products to the configurable product -->
55+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
56+
<requiredEntity createDataKey="createConfigProduct"/>
57+
<requiredEntity createDataKey="createConfigProductAttribute"/>
58+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
59+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
60+
</createData>
61+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
62+
<requiredEntity createDataKey="createConfigProduct"/>
63+
<requiredEntity createDataKey="createConfigChildProduct1"/>
64+
</createData>
65+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
66+
<requiredEntity createDataKey="createConfigProduct"/>
67+
<requiredEntity createDataKey="createConfigChildProduct2"/>
68+
</createData>
69+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
70+
<magentoCron groups="index" stepKey="reindexBrokenIndices"/>
71+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
72+
</before>
73+
<after>
74+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
75+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
76+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
77+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
78+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logout"/>
79+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
80+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
81+
<magentoCron groups="index" stepKey="reindexBrokenIndices"/>
82+
</after>
83+
84+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
85+
<argument name="Customer" value="$createCustomer$"/>
86+
</actionGroup>
87+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
88+
<argument name="productUrl" value="$createConfigProduct.custom_attributes[url_key]$"/>
89+
</actionGroup>
90+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addToWishlistProduct">
91+
<argument name="productVar" value="$createConfigProduct$"/>
92+
</actionGroup>
93+
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="navigateToCustomerEditPage">
94+
<argument name="customer" value="$createCustomer$"/>
95+
</actionGroup>
96+
<actionGroup ref="AdminNavigateCustomerWishlistTabActionGroup" stepKey="navigateToWishlistTab"/>
97+
<actionGroup ref="AdminCustomerWishlistConfigureItemActionGroup" stepKey="editItem">
98+
<argument name="title" value="$createConfigProductAttribute.attribute[frontend_labels][0][label]$"/>
99+
<argument name="option" value="$getConfigAttributeOption1.label$"/>
100+
<argument name="quantity" value="2"/>
101+
<argument name="productName" value="$createConfigProduct.name$"/>
102+
</actionGroup>
103+
<click selector="{{AdminMainActionsSection.save}}" stepKey="saveCustomer"/>
104+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
105+
<seeElement selector="{{AdminMessagesSection.success}}" stepKey="assertSuccessMessage"/>
106+
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="navigateToCustomerEditPage2">
107+
<argument name="customer" value="$createCustomer$"/>
108+
</actionGroup>
109+
<actionGroup ref="AdminNavigateCustomerWishlistTabActionGroup" stepKey="navigateToWishlistTabAgain"/>
110+
<waitForElementVisible selector="{{AdminCustomerWishlistSection.productQty}}" stepKey="waitForProductQuantityVisible"/>
111+
<see selector="{{AdminCustomerWishlistSection.productQty}}" userInput="2" stepKey="assertProductQuantity"/>
112+
</test>
113+
</tests>

0 commit comments

Comments
 (0)