Skip to content

Commit 016e97e

Browse files
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into MC-16684
2 parents aa69b8b + 4b9913f commit 016e97e

File tree

92 files changed

+3084
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3084
-130
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminSystemMessagesSection">
12+
<element name="systemMessagesDropdown" type="button" selector="#system_messages .message-system-action-dropdown"/>
13+
<element name="actionMessageLog" type="button" selector="//*[contains(@class, 'message-system-summary')]/a[contains(text(), '{{textMessage}}')]" parameterized="true"/>
14+
</section>
15+
</sections>

app/code/Magento/Backend/Test/Mftf/Section/AdminSecondaryGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<element name="catalogRuleIdentifierSearch" type="input" selector=".col-name .admin__control-text"/>
1515
<element name="searchButton" type="input" selector=".admin__filter-actions [title='Search']"/>
1616
<element name="firstRow" type="block" selector="tr[data-role='row']"/>
17+
<element name="rowByName" type="block" selector="//td[contains(text(), '{{searchingName}}')]" parameterized="true" timeout="30"/>
1718
</section>
1819
</sections>
1920

app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle;
79

810
use Magento\Framework\Data\Form\Element\AbstractElement;
11+
use Magento\Store\Model\Store;
912

13+
/**
14+
* Block for rendering option of bundle product
15+
*
16+
* Class \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option
17+
*/
1018
class Option extends \Magento\Backend\Block\Widget
1119
{
1220
/**
@@ -79,6 +87,8 @@ protected function _construct()
7987
}
8088

8189
/**
90+
* Return Field Id
91+
*
8292
* @return string
8393
*/
8494
public function getFieldId()
@@ -87,6 +97,8 @@ public function getFieldId()
8797
}
8898

8999
/**
100+
* Return Field Name
101+
*
90102
* @return string
91103
*/
92104
public function getFieldName()
@@ -108,6 +120,8 @@ public function getProduct()
108120
}
109121

110122
/**
123+
* Render
124+
*
111125
* @param AbstractElement $element
112126
* @return string
113127
*/
@@ -118,6 +132,8 @@ public function render(AbstractElement $element)
118132
}
119133

120134
/**
135+
* Set Element
136+
*
121137
* @param AbstractElement $element
122138
* @return $this
123139
*/
@@ -128,6 +144,8 @@ public function setElement(AbstractElement $element)
128144
}
129145

130146
/**
147+
* Get Element
148+
*
131149
* @return AbstractElement|null
132150
*/
133151
public function getElement()
@@ -136,6 +154,8 @@ public function getElement()
136154
}
137155

138156
/**
157+
* Return Is Multi Websites
158+
*
139159
* @return bool
140160
*/
141161
public function isMultiWebsites()
@@ -144,6 +164,8 @@ public function isMultiWebsites()
144164
}
145165

146166
/**
167+
* Prepare Layout
168+
*
147169
* @return $this
148170
*/
149171
protected function _prepareLayout()
@@ -184,6 +206,8 @@ protected function _prepareLayout()
184206
}
185207

186208
/**
209+
* Get Add Button Html
210+
*
187211
* @return string
188212
*/
189213
public function getAddButtonHtml()
@@ -192,6 +216,8 @@ public function getAddButtonHtml()
192216
}
193217

194218
/**
219+
* Get Close Search Button Html
220+
*
195221
* @return string
196222
*/
197223
public function getCloseSearchButtonHtml()
@@ -200,6 +226,8 @@ public function getCloseSearchButtonHtml()
200226
}
201227

202228
/**
229+
* Get Add Selection Button Html
230+
*
203231
* @return string
204232
*/
205233
public function getAddSelectionButtonHtml()
@@ -239,6 +267,8 @@ public function getOptions()
239267
}
240268

241269
/**
270+
* Get Add Button Id
271+
*
242272
* @return mixed
243273
*/
244274
public function getAddButtonId()
@@ -248,6 +278,8 @@ public function getAddButtonId()
248278
}
249279

250280
/**
281+
* Get Options Delete Button Html
282+
*
251283
* @return string
252284
*/
253285
public function getOptionDeleteButtonHtml()
@@ -256,6 +288,8 @@ public function getOptionDeleteButtonHtml()
256288
}
257289

258290
/**
291+
* Get Selection Html
292+
*
259293
* @return string
260294
*/
261295
public function getSelectionHtml()
@@ -264,6 +298,8 @@ public function getSelectionHtml()
264298
}
265299

266300
/**
301+
* Get Type Select Html
302+
*
267303
* @return mixed
268304
*/
269305
public function getTypeSelectHtml()
@@ -286,6 +322,8 @@ public function getTypeSelectHtml()
286322
}
287323

288324
/**
325+
* Get Require Select Html
326+
*
289327
* @return mixed
290328
*/
291329
public function getRequireSelectHtml()
@@ -304,10 +342,12 @@ public function getRequireSelectHtml()
304342
}
305343

306344
/**
345+
* Return Is Default Store
346+
*
307347
* @return bool
308348
*/
309349
public function isDefaultStore()
310350
{
311-
return $this->getProduct()->getStoreId() == '0';
351+
return $this->getProduct()->getStoreId() == Store::DEFAULT_STORE_ID;
312352
}
313353
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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="AdminCreateAndEditBundleProductSettingsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Create/Edit bundle product in Admin"/>
15+
<title value="Admin should be able to set/edit other product information when creating/editing a bundle product"/>
16+
<description value="Admin should be able to set/edit other product information when creating/editing a bundle product"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-224"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<!-- Create a Website -->
23+
<createData entity="customWebsite" stepKey="createWebsite"/>
24+
25+
<!-- Create a simple product for a bundle option -->
26+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
27+
28+
<!-- Login as admin -->
29+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
30+
</before>
31+
<after>
32+
<!-- Delete the simple product -->
33+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
34+
35+
<!-- Log out -->
36+
<actionGroup ref="logout" stepKey="logout"/>
37+
</after>
38+
39+
<!-- Create new bundle product -->
40+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createBundleProduct">
41+
<argument name="productType" value="bundle"/>
42+
</actionGroup>
43+
44+
<!-- Fill all main fields -->
45+
<actionGroup ref="fillMainBundleProductForm" stepKey="fillMainProductFields"/>
46+
47+
<!-- Add the bundle option to the product -->
48+
<actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption">
49+
<argument name="x" value="0"/>
50+
<argument name="n" value="1"/>
51+
<argument name="prodOneSku" value="$$createSimpleProduct.sku$$"/>
52+
<argument name="prodTwoSku" value=""/>
53+
<argument name="optionTitle" value="{{RadioButtonsOption.title}}"/>
54+
<argument name="inputType" value="{{RadioButtonsOption.type}}"/>
55+
</actionGroup>
56+
57+
<!-- Set product in created Website -->
58+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="selectProductInWebsites">
59+
<argument name="website" value="$createWebsite.website[name]$"/>
60+
</actionGroup>
61+
62+
<!-- Set Design settings for the product -->
63+
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="setProductDesignSettings">
64+
<argument name="designSettings" value="simpleLumaDesignThreeColumns"/>
65+
</actionGroup>
66+
67+
<!-- Set Gift Options settings for the product -->
68+
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="enableGiftMessageSettings">
69+
<argument name="status" value="1"/>
70+
</actionGroup>
71+
72+
<!-- Save product form -->
73+
<actionGroup ref="saveProductForm" stepKey="clickSaveButton"/>
74+
75+
<!-- Open product page -->
76+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
77+
<argument name="productUrl" value="{{BundleProduct.name}}"/>
78+
</actionGroup>
79+
80+
<!-- Assert product Design settings "layout 3 columns" -->
81+
<seeElement selector="{{StorefrontProductPageDesignSection.layoutThreeColumns}}" stepKey="seeDesignChanges"/>
82+
83+
<!-- Assert Gift Option product settings is present -->
84+
<actionGroup ref="StorefrontAddBundleProductFromProductToCartActionGroup" stepKey="addProductToCart">
85+
<argument name="productName" value="{{BundleProduct.name}}"/>
86+
</actionGroup>
87+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/>
88+
<actionGroup ref="StorefrontAssertGiftMessageFieldsActionGroup" stepKey="assertGiftMessageFieldsArePresent"/>
89+
90+
<!-- Open created product -->
91+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
92+
<argument name="product" value="BundleProduct"/>
93+
</actionGroup>
94+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
95+
<argument name="product" value="BundleProduct"/>
96+
</actionGroup>
97+
98+
<!-- Assert product in assigned to Website -->
99+
<actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked">
100+
<argument name="website" value="$createWebsite.website[name]$"/>
101+
</actionGroup>
102+
103+
<!-- Edit product in Websites -->
104+
<actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="uncheckProductInWebsites">
105+
<argument name="website" value="$createWebsite.website[name]$"/>
106+
</actionGroup>
107+
108+
<!-- Edit product Search Engine Optimization settings -->
109+
<actionGroup ref="AdminChangeProductSEOSettingsActionGroup" stepKey="editProductSEOSettings">
110+
<argument name="productName" value="ApiBundleProduct.name"/>
111+
</actionGroup>
112+
113+
<!-- Edit Design settings for the product -->
114+
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="editProductDesignSettings"/>
115+
116+
<!-- Edit Gift Option product settings -->
117+
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/>
118+
119+
<!-- Save product form -->
120+
<actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/>
121+
122+
<!-- Verify Url Key after changing -->
123+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
124+
<argument name="productUrl" value="{{ApiBundleProduct.name}}"/>
125+
</actionGroup>
126+
127+
<!-- Assert product design settings "Layout empty" -->
128+
<seeElement selector="{{StorefrontProductPageDesignSection.layoutTwoColumnsLeft}}" stepKey="seeNewDesignChanges"/>
129+
130+
<!-- Assert Gift Option product settings -->
131+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
132+
<dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/>
133+
134+
<!-- Delete created bundle product -->
135+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
136+
<argument name="product" value="BundleProduct"/>
137+
</actionGroup>
138+
139+
<!-- Delete created Website -->
140+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
141+
<argument name="websiteName" value="$createWebsite.website[name]$"/>
142+
</actionGroup>
143+
</test>
144+
</tests>
145+

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier;
79

810
use Magento\Bundle\Model\Product\Attribute\Source\Shipment\Type as ShipmentType;
@@ -16,6 +18,7 @@
1618
use Magento\Ui\Component\Form;
1719
use Magento\Ui\Component\Form\Fieldset;
1820
use Magento\Ui\Component\Modal;
21+
use Magento\Store\Model\Store;
1922

2023
/**
2124
* Create Ship Bundle Items and Affect Bundle Product Selections fields
@@ -814,6 +817,6 @@ protected function getSelectionPriceType()
814817
*/
815818
protected function isDefaultStore()
816819
{
817-
return $this->locator->getProduct()->getStoreId() == 0;
820+
return $this->locator->getProduct()->getStoreId() == Store::DEFAULT_STORE_ID;
818821
}
819822
}

0 commit comments

Comments
 (0)