Skip to content

Commit 67e886a

Browse files
committed
Merge branch '2.3-develop' into ENGCOM-3491-magento-magento2-19182
2 parents c6da309 + 470fd45 commit 67e886a

File tree

137 files changed

+2716
-559
lines changed

Some content is hidden

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

137 files changed

+2716
-559
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="save" type="button" selector="#save" timeout="30"/>
1313
<element name="saveAndContinue" type="button" selector="button[id*=save_and_continue]" timeout="30"/>
1414
<element name="delete" type="button" selector="#delete" timeout="30"/>
15+
<element name="add" type="button" selector="#add" timeout="30"/>
1516
</section>
1617
</sections>
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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="AdminAttributeTextSwatchesCanBeFiledTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Unable to add more attributes in size"/>
15+
<title value="Check that attribute text swatches can be filed"/>
16+
<description value="Check that attribute text swatches can be filed"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-96710"/>
19+
<useCaseId value="MAGETWO-96409"/>
20+
<group value="backend"/>
21+
<group value="ui"/>
22+
</annotations>
23+
<before>
24+
25+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
26+
27+
</before>
28+
<after>
29+
<!-- Delete all 10 store views -->
30+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView1">
31+
<argument name="customStore" value="customStore"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView2">
34+
<argument name="customStore" value="NewStoreViewData"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView3">
37+
<argument name="customStore" value="storeViewData"/>
38+
</actionGroup>
39+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView4">
40+
<argument name="customStore" value="storeViewData1"/>
41+
</actionGroup>
42+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView5">
43+
<argument name="customStore" value="storeViewData2"/>
44+
</actionGroup>
45+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView6">
46+
<argument name="customStore" value="storeViewData3"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView7">
49+
<argument name="customStore" value="storeViewData4"/>
50+
</actionGroup>
51+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView8">
52+
<argument name="customStore" value="storeViewData5"/>
53+
</actionGroup>
54+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView9">
55+
<argument name="customStore" value="storeViewData6"/>
56+
</actionGroup>
57+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView10">
58+
<argument name="customStore" value="storeViewData7"/>
59+
</actionGroup>
60+
61+
<actionGroup ref="logout" stepKey="logout"/>
62+
</after>
63+
64+
<!-- Create 10 store views -->
65+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView1">
66+
<argument name="customStore" value="customStore"/>
67+
</actionGroup>
68+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView2">
69+
<argument name="customStore" value="NewStoreViewData"/>
70+
</actionGroup>
71+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView3">
72+
<argument name="customStore" value="storeViewData"/>
73+
</actionGroup>
74+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView4">
75+
<argument name="customStore" value="storeViewData1"/>
76+
</actionGroup>
77+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView5">
78+
<argument name="customStore" value="storeViewData2"/>
79+
</actionGroup>
80+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView6">
81+
<argument name="customStore" value="storeViewData3"/>
82+
</actionGroup>
83+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView7">
84+
<argument name="customStore" value="storeViewData4"/>
85+
</actionGroup>
86+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView8">
87+
<argument name="customStore" value="storeViewData5"/>
88+
</actionGroup>
89+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView9">
90+
<argument name="customStore" value="storeViewData6"/>
91+
</actionGroup>
92+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView10">
93+
<argument name="customStore" value="storeViewData7"/>
94+
</actionGroup>
95+
96+
<!--Navigate to Product attribute page-->
97+
<amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/>
98+
<waitForPageLoad stepKey="waitForPageLoad"/>
99+
<fillField userInput="test_label" selector="{{AttributePropertiesSection.DefaultLabel}}" stepKey="fillDefaultLabel"/>
100+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="Text Swatch" stepKey="selectInputType"/>
101+
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatch"/>
102+
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
103+
104+
<!-- Fill Swatch and Description fields for Admin -->
105+
<fillField selector="{{AttributeManageSwatchSection.swatchField('Admin')}}" userInput="test" stepKey="fillSwatchForAdmin"/>
106+
<fillField selector="{{AttributeManageSwatchSection.descriptionField('Admin')}}" userInput="test" stepKey="fillDescriptionForAdmin"/>
107+
108+
<!-- Grab value Swatch and Description fields for Admin -->
109+
<grabValueFrom selector="{{AttributeManageSwatchSection.swatchField('Admin')}}" stepKey="grabSwatchForAdmin"/>
110+
<grabValueFrom selector="{{AttributeManageSwatchSection.descriptionField('Admin')}}" stepKey="grabDescriptionForAdmin"/>
111+
112+
<!-- Check that Swatch and Description fields for Admin are not empty-->
113+
<assertNotEmpty actual="$grabSwatchForAdmin" stepKey="checkSwatchFieldForAdmin"/>
114+
<assertNotEmpty actual="$grabDescriptionForAdmin" stepKey="checkDescriptionFieldForAdmin"/>
115+
</test>
116+
</tests>

app/code/Magento/Backend/view/adminhtml/templates/widget/tabshoriz.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<?php $_tabType = (!preg_match('/\s?ajax\s?/', $_tabClass) && $block->getTabUrl($_tab) != '#') ? 'link' : '' ?>
1919
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ? '#' . $block->getTabId($_tab) . '_content' : $block->getTabUrl($_tab) ?>
2020
<li>
21-
<a href="<?= /* @escapeNotVerified */ $_tabHref ?>" id="<?= /* @escapeNotVerified */ $block->getTabId($_tab) ?>" title="<?= /* @escapeNotVerified */ $block->getTabTitle($_tab) ?>" class="<?php $_tabClass ?>" data-tab-type="<?php $_tabType ?>">
21+
<a href="<?= $block->escapeHtmlAttr($_tabHref) ?>" id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>" title="<?= $block->escapeHtmlAttr($block->getTabTitle($_tab)) ?>" class="<?= $block->escapeHtmlAttr($_tabClass) ?>" data-tab-type="<?= $block->escapeHtmlAttr($_tabType) ?>">
2222
<span>
2323
<span class="changed" title="<?= /* @escapeNotVerified */ __('The information in this tab has been changed.') ?>"></span>
2424
<span class="error" title="<?= /* @escapeNotVerified */ __('This tab contains invalid data. Please resolve this before saving.') ?>"></span>

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\EntityManager\MetadataPool;
1414
use Magento\Framework\Pricing\PriceCurrencyInterface;
1515
use Magento\Framework\Serialize\Serializer\Json;
16+
use Magento\Framework\Stdlib\ArrayUtils;
1617

1718
/**
1819
* Bundle Type Model
@@ -160,6 +161,11 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
160161
*/
161162
private $selectionCollectionFilterApplier;
162163

164+
/**
165+
* @var ArrayUtils
166+
*/
167+
private $arrayUtility;
168+
163169
/**
164170
* @param \Magento\Catalog\Model\Product\Option $catalogProductOption
165171
* @param \Magento\Eav\Model\Config $eavConfig
@@ -185,6 +191,7 @@ class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
185191
* @param \Magento\Framework\Serialize\Serializer\Json $serializer
186192
* @param MetadataPool|null $metadataPool
187193
* @param SelectionCollectionFilterApplier|null $selectionCollectionFilterApplier
194+
* @param ArrayUtils|null $arrayUtility
188195
*
189196
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
190197
*/
@@ -212,7 +219,8 @@ public function __construct(
212219
\Magento\CatalogInventory\Api\StockStateInterface $stockState,
213220
Json $serializer = null,
214221
MetadataPool $metadataPool = null,
215-
SelectionCollectionFilterApplier $selectionCollectionFilterApplier = null
222+
SelectionCollectionFilterApplier $selectionCollectionFilterApplier = null,
223+
ArrayUtils $arrayUtility = null
216224
) {
217225
$this->_catalogProduct = $catalogProduct;
218226
$this->_catalogData = $catalogData;
@@ -232,6 +240,7 @@ public function __construct(
232240

233241
$this->selectionCollectionFilterApplier = $selectionCollectionFilterApplier
234242
?: ObjectManager::getInstance()->get(SelectionCollectionFilterApplier::class);
243+
$this->arrayUtility= $arrayUtility ?: ObjectManager::getInstance()->get(ArrayUtils::class);
235244

236245
parent::__construct(
237246
$catalogProductOption,
@@ -673,7 +682,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
673682
$options
674683
);
675684

676-
$selectionIds = $this->multiToFlatArray($options);
685+
$selectionIds = array_values($this->arrayUtility->flatten($options));
677686
// If product has not been configured yet then $selections array should be empty
678687
if (!empty($selectionIds)) {
679688
$selections = $this->getSelectionsByIds($selectionIds, $product);
@@ -814,26 +823,6 @@ private function recursiveIntval(array $array)
814823
return $array;
815824
}
816825

817-
/**
818-
* Convert multi dimensional array to flat
819-
*
820-
* @param array $array
821-
* @return int[]
822-
*/
823-
private function multiToFlatArray(array $array)
824-
{
825-
$flatArray = [];
826-
foreach ($array as $value) {
827-
if (is_array($value)) {
828-
$flatArray = array_merge($flatArray, $this->multiToFlatArray($value));
829-
} else {
830-
$flatArray[] = $value;
831-
}
832-
}
833-
834-
return $flatArray;
835-
}
836-
837826
/**
838827
* Retrieve message for specify option(s)
839828
*

app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,74 @@
5656
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/>
5757
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/>
5858
</actionGroup>
59+
60+
<actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts">
61+
<remove keyForRemoval="openProductFilters2"/>
62+
<remove keyForRemoval="fillProductSkuFilter2"/>
63+
<remove keyForRemoval="clickApplyFilters2"/>
64+
<remove keyForRemoval="waitForFilteredGridLoad2"/>
65+
<remove keyForRemoval="selectProduct2"/>
66+
<remove keyForRemoval="selectProduct2"/>
67+
<remove keyForRemoval="fillQuantity1"/>
68+
<remove keyForRemoval="fillQuantity2"/>
69+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/>
70+
</actionGroup>
71+
72+
<actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts">
73+
<arguments>
74+
<argument name="prodTreeSku" type="string"/>
75+
</arguments>
76+
<remove keyForRemoval="fillQuantity1"/>
77+
<remove keyForRemoval="fillQuantity2"/>
78+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/>
79+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/>
80+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/>
81+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/>
82+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/>
83+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/>
84+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/>
85+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/>
86+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/>
87+
</actionGroup>
88+
89+
<actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts">
90+
<arguments>
91+
<argument name="prodTreeSku" type="string"/>
92+
<argument name="prodFourSku" type="string"/>
93+
<argument name="prodFiveSku" type="string"/>
94+
<argument name="prodSixSku" type="string"/>
95+
</arguments>
96+
<remove keyForRemoval="fillQuantity1"/>
97+
<remove keyForRemoval="fillQuantity2"/>
98+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/>
99+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/>
100+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/>
101+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/>
102+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/>
103+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/>
104+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/>
105+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/>
106+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/>
107+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/>
108+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/>
109+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/>
110+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/>
111+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/>
112+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/>
113+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/>
114+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/>
115+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/>
116+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/>
117+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/>
118+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/>
119+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/>
120+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/>
121+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/>
122+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/>
123+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/>
124+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/>
125+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/>
126+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/>
127+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/>
128+
</actionGroup>
59129
</actionGroups>

app/code/Magento/Bundle/Test/Mftf/ActionGroup/EnableDisableProductActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>
1515

1616
<!--Trigger SEO drop down-->
17-
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.seoDependent}}" visible="false" stepKey="OpenDropDownIfClosed"/>
17+
<scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="moveToSEOSection"/>
18+
<conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/>
1819
<waitForPageLoad stepKey="WaitForDropDownSEO"/>
1920

2021
<!--Fill URL input-->

0 commit comments

Comments
 (0)