Skip to content

Commit cb54bcb

Browse files
committed
Merge remote-tracking branch 'mainline/2.4-develop' into PR_Jun_06_2023
2 parents 18ec675 + 4b45119 commit cb54bcb

File tree

46 files changed

+1623
-410
lines changed

Some content is hidden

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

46 files changed

+1623
-410
lines changed

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

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -181,22 +181,26 @@ protected function parseSelections($rowData, $entityId)
181181
return [];
182182
}
183183

184-
$rowData['bundle_values'] = str_replace(
185-
self::BEFORE_OPTION_VALUE_DELIMITER,
186-
$this->_entityModel->getMultipleValueSeparator(),
187-
$rowData['bundle_values']
188-
);
189-
$selections = explode(
190-
Product::PSEUDO_MULTI_LINE_SEPARATOR,
191-
$rowData['bundle_values']
192-
);
184+
if (is_string($rowData['bundle_values'])) {
185+
$rowData['bundle_values'] = str_replace(
186+
self::BEFORE_OPTION_VALUE_DELIMITER,
187+
$this->_entityModel->getMultipleValueSeparator(),
188+
$rowData['bundle_values']
189+
);
190+
$selections = explode(
191+
Product::PSEUDO_MULTI_LINE_SEPARATOR,
192+
$rowData['bundle_values']
193+
);
194+
} else {
195+
$selections = $rowData['bundle_values'];
196+
}
197+
193198
foreach ($selections as $selection) {
194-
$values = explode($this->_entityModel->getMultipleValueSeparator(), $selection);
195-
$option = $this->parseOption($values);
196-
if (isset($option['sku']) && isset($option['name'])) {
197-
if (!isset($this->_cachedOptions[$entityId])) {
198-
$this->_cachedOptions[$entityId] = [];
199-
}
199+
$option = is_string($selection)
200+
? $this->parseOption(explode($this->_entityModel->getMultipleValueSeparator(), $selection))
201+
: $selection;
202+
203+
if (isset($option['sku'], $option['name'])) {
200204
$this->_cachedSkus[] = $option['sku'];
201205
if (!isset($this->_cachedOptions[$entityId][$option['name']])) {
202206
$this->_cachedOptions[$entityId][$option['name']] = [];

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCrossSellProductBySkuActionGroup.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@
1919
<!--Scroll up to avoid error-->
2020
<scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/>
2121
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/>
22+
<waitForElementClickable selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="waitForAddCrossSellButtonClickable" />
2223
<click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="clickAddCrossSellButton"/>
2324
<conditionalClick selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
25+
<waitForElementClickable selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="waitForProductFiltersClickable" />
2426
<click selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
27+
<waitForElementVisible selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" stepKey="waitForSkuFilterVisible" />
2528
<fillField selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
2629
<click selector="{{AdminProductCrossSellModalSection.Modal}} {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
2730
<waitForPageLoad stepKey="waitForPageToLoad"/>
31+
<waitForElementClickable selector="{{AdminProductCrossSellModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="waitForProductClickable" />
2832
<click selector="{{AdminProductCrossSellModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
33+
<waitForElementClickable selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="waitForAddRelatedProductClickable" />
2934
<click selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="addRelatedProductSelected"/>
3035
<waitForPageLoad stepKey="waitForModalDisappear"/>
3136
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductByIdOnProductGridActionGroup.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
</arguments>
1818

1919
<waitForElementClickable selector="{{AdminProductGridSection.productRowCheckboxById(productId)}}" stepKey="waitForElementClickable" />
20+
<scrollTo selector="{{AdminProductGridSection.productRowCheckboxById(productId)}}" x="-100" stepKey="scrollToProductCheckbox" />
21+
<moveMouseOver selector="{{AdminProductGridSection.productRowCheckboxById(productId)}}" x="-100" stepKey="moveMouseOverProductCheckbox" />
2022
<checkOption selector="{{AdminProductGridSection.productRowCheckboxById(productId)}}" stepKey="selectProduct"/>
23+
<waitForPageLoad stepKey="waitForBackgroundProcessesToFinish" />
2124
</actionGroup>
2225
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickMassUpdateProductAttributesActionGroup.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
<annotations>
1313
<description>Clicks on 'Update attributes' from dropdown actions list on product grid page. Products should be selected via mass action before</description>
1414
</annotations>
15+
<waitForElementClickable selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="waitForDropdownClickable" />
1516
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
17+
<waitForElementClickable selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="waitForOptionClickable" />
1618
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
1719
<waitForPageLoad stepKey="waitForBulkUpdatePage"/>
1820
<seeInCurrentUrl url="{{ProductAttributesEditPage.url}}" stepKey="seeInUrl"/>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddProductToCompareActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<argument name="productVar"/>
1717
</arguments>
1818

19+
<waitForPageLoad stepKey="waitForProductPageOpenedAndLoaded" />
1920
<waitForElementClickable selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="waitForAddToCompareButtonClickable" />
2021
<click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/>
2122
<waitForElement selector="{{StorefrontMessagesSection.success}}" stepKey="waitForAddProductToCompareSuccessMessage"/>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontHeaderSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontHeaderSection">
12-
<element name="NavigationCategoryByName" type="button" selector="//nav//a[span[contains(., '{{var1}}')]]" parameterized="true" timeout="30"/>
12+
<element name="NavigationCategoryByName" type="button" selector="//nav//li[a[span[contains(., '{{var1}}')]]]" parameterized="true" timeout="30"/>
1313
</section>
1414
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyChangePriceForConfigurableProductWithAssignedSimpleProductsTest.xml

Lines changed: 77 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,55 @@
1515
<severity value="MAJOR"/>
1616
<testCaseId value="AC-2031"/>
1717
<group value="Catalog"/>
18-
<group value="AllIndexerBySchedule" />
1918
</annotations>
2019

2120
<before>
2221
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23-
<actionGroup ref="UpdateAllIndexerByScheduleActionGroup" stepKey="updateAnIndexerBySchedule"/>
24-
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
22+
<comment userInput="BIC workaround" stepKey="updateAnIndexerBySchedule"/>
23+
<comment userInput="BIC workaround" stepKey="enableFlatRate"/>
24+
25+
<!-- Create category for configurable product -->
26+
<createData entity="SimpleSubCategory" stepKey="firstSimpleCategory"/>
27+
28+
<!-- Create configurable product with two options -->
29+
<createData entity="ApiConfigurableProduct" stepKey="createFirstConfigProduct">
30+
<requiredEntity createDataKey="firstSimpleCategory"/>
31+
</createData>
32+
<createData entity="productAttributeWithTwoOptions" stepKey="createFirstConfigProductAttribute"/>
33+
<createData entity="productAttributeOption1" stepKey="createFirstConfigProductAttributeFirstOption">
34+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
35+
</createData>
36+
<createData entity="productAttributeOption2" stepKey="createFirstConfigProductAttributeSecondOption">
37+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
38+
</createData>
39+
<createData entity="AddToDefaultSet" stepKey="addFirstProductToAttributeSet">
40+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
41+
</createData>
42+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstConfigAttributeFirstOption">
43+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
44+
</getData>
45+
46+
<!-- Create one child product for configurable product -->
47+
<createData entity="ApiSimpleOne" stepKey="createFirstConfigFirstChildProduct">
48+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
49+
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
50+
</createData>
51+
<createData entity="ConfigurableProductOneOption" stepKey="createFirstConfigProductOption">
52+
<requiredEntity createDataKey="createFirstConfigProduct"/>
53+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
54+
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
55+
</createData>
56+
<createData entity="ConfigurableProductAddChild" stepKey="createFirstConfigProductAddFirstChild">
57+
<requiredEntity createDataKey="createFirstConfigProduct"/>
58+
<requiredEntity createDataKey="createFirstConfigFirstChildProduct"/>
59+
</createData>
60+
61+
<!-- Reindex -->
2562
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="performReindex">
2663
<argument name="indices" value=""/>
2764
</actionGroup>
28-
<actionGroup ref="CliCacheFlushActionGroup" stepKey="cleanCache">
29-
<argument name="tags" value=""/>
65+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
66+
<argument name="tags" value="full_page"/>
3067
</actionGroup>
3168
</before>
3269

@@ -35,93 +72,59 @@
3572
<deleteData createDataKey="createFirstConfigFirstChildProduct" stepKey="deleteFirstConfigFirstChildProduct"/>
3673
<deleteData createDataKey="firstSimpleCategory" stepKey="deleteCategory"/>
3774
<deleteData createDataKey="createFirstConfigProductAttribute" stepKey="deleteFirstConfigProductAttribute"/>
38-
<comment userInput="The test was moved to elasticsearch suite" stepKey="resetCatalogSearchConfiguration"/>
39-
<actionGroup ref="AdminAllIndexerSetUpdateOnSaveActionGroup" stepKey="resetIndexerBackToOriginalState"/>
75+
<comment userInput="BIC workaround" stepKey="resetCatalogSearchConfiguration"/>
76+
<comment userInput="BIC workaround" stepKey="resetIndexerBackToOriginalState"/>
4077
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="performReindex">
4178
<argument name="indices" value=""/>
4279
</actionGroup>
43-
<actionGroup ref="CliCacheFlushActionGroup" stepKey="cleanCache">
44-
<argument name="tags" value=""/>
80+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
81+
<argument name="tags" value="full_page"/>
4582
</actionGroup>
4683
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
4784
</after>
4885

49-
<!-- Create category for configurable product -->
50-
<createData entity="SimpleSubCategory" stepKey="firstSimpleCategory"/>
51-
52-
<!-- Create configurable product with two options -->
53-
<createData entity="ApiConfigurableProduct" stepKey="createFirstConfigProduct">
54-
<requiredEntity createDataKey="firstSimpleCategory"/>
55-
</createData>
56-
57-
<createData entity="productAttributeWithTwoOptions" stepKey="createFirstConfigProductAttribute"/>
58-
59-
<createData entity="productAttributeOption1" stepKey="createFirstConfigProductAttributeFirstOption">
60-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
61-
</createData>
62-
<createData entity="productAttributeOption2" stepKey="createFirstConfigProductAttributeSecondOption">
63-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
64-
</createData>
65-
66-
<createData entity="AddToDefaultSet" stepKey="addFirstProductToAttributeSet">
67-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
68-
</createData>
69-
70-
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstConfigAttributeFirstOption">
71-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
72-
</getData>
73-
74-
<!-- Create one child product for configurable product -->
75-
<createData entity="ApiSimpleOne" stepKey="createFirstConfigFirstChildProduct">
76-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
77-
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
78-
</createData>
79-
80-
<createData entity="ConfigurableProductOneOption" stepKey="createFirstConfigProductOption">
81-
<requiredEntity createDataKey="createFirstConfigProduct"/>
82-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
83-
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
84-
</createData>
85-
86-
<createData entity="ConfigurableProductAddChild" stepKey="createFirstConfigProductAddFirstChild">
87-
<requiredEntity createDataKey="createFirstConfigProduct"/>
88-
<requiredEntity createDataKey="createFirstConfigFirstChildProduct"/>
89-
</createData>
86+
<comment userInput="BIC workaround" stepKey="firstSimpleCategory"/>
87+
<comment userInput="BIC workaround" stepKey="createFirstConfigProduct"/>
88+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductAttribute"/>
89+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductAttributeFirstOption"/>
90+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductAttributeSecondOption"/>
91+
<comment userInput="BIC workaround" stepKey="addFirstProductToAttributeSet"/>
92+
<comment userInput="BIC workaround" stepKey="getFirstConfigAttributeFirstOption"/>
93+
<comment userInput="BIC workaround" stepKey="createFirstConfigFirstChildProduct"/>
94+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductOption"/>
95+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductAddFirstChild"/>
9096

9197
<!-- Assert first product in category -->
92-
<magentoCron stepKey="runCron"/>
93-
<magentoCron stepKey="runCron1"/>
94-
95-
<amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront"/>
96-
<waitForPageLoad stepKey="waitForFirstCategoryPageLoad"/>
97-
98+
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToFirstCategoryPageStorefront">
99+
<argument name="categoryUrl" value="$firstSimpleCategory.custom_attributes[url_key]$"/>
100+
</actionGroup>
101+
<comment userInput="BIC workaround" stepKey="waitForFirstCategoryPageLoad"/>
98102
<actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory">
99103
<argument name="productName" value="$$createFirstConfigProduct.name$$"/>
100104
<argument name="expectedPrice" value="$$createFirstConfigFirstChildProduct.price$$"/>
101105
</actionGroup>
102106

103-
<!-- Search default simple product in grid -->
104-
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/>
105-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/>
106-
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct">
107-
<argument name="product" value="$$createFirstConfigFirstChildProduct$$"/>
107+
<!-- Update simple product price -->
108+
<comment userInput="BIC workaround" stepKey="openProductCatalogPage"/>
109+
<comment userInput="BIC workaround" stepKey="filterProductGrid"/>
110+
<comment userInput="BIC workaround" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/>
111+
<comment userInput="BIC workaround" stepKey="waitUntilProductIsOpened"/>
112+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage">
113+
<argument name="productId" value="$createFirstConfigFirstChildProduct.id$"/>
108114
</actionGroup>
109-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/>
110-
111-
<!-- Update default simple product with price -->
115+
<waitForElementVisible selector="{{AdminProductFormSection.productPrice}}" stepKey="waitForProductPriceField"/>
112116
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="150" stepKey="fillSimpleProductPrice"/>
113-
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickButtonSave"/>
114-
115-
<!-- Verify customer see success message -->
116-
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
117+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickButtonSave"/>
118+
<waitForText selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
117119

118120
<!-- Assert first product in category -->
119-
<magentoCron stepKey="runCron2"/>
120-
<wait time="60" stepKey="waitForUpdateStarts"/>
121-
122-
<amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront1"/>
123-
<waitForPageLoad stepKey="waitForFirstCategoryPageLoad1"/>
124-
121+
<comment userInput="BIC workaround" stepKey="runCron1"/>
122+
<comment userInput="BIC workaround" stepKey="runCron2"/>
123+
<comment userInput="BIC workaround" stepKey="waitForUpdateStarts"/>
124+
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToFirstCategoryPageStorefront1">
125+
<argument name="categoryUrl" value="$firstSimpleCategory.custom_attributes[url_key]$"/>
126+
</actionGroup>
127+
<comment userInput="BIC workaround" stepKey="waitForFirstCategoryPageLoad1"/>
125128
<actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory1">
126129
<argument name="productName" value="$$createFirstConfigProduct.name$$"/>
127130
<argument name="expectedPrice" value="150"/>

0 commit comments

Comments
 (0)