Skip to content

Commit 921f4c5

Browse files
authored
Merge branch '2.4-develop' into UPS_AC9653_OCT_22_2023
2 parents 0b66a45 + 298cbd4 commit 921f4c5

File tree

59 files changed

+1606
-1320
lines changed

Some content is hidden

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

59 files changed

+1606
-1320
lines changed

app/code/Magento/Bundle/Model/LinkManagement.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ private function processLinkedProduct(
235235
}
236236

237237
$selectionModel = $this->bundleSelection->create();
238+
$selectionModel->load($linkedProduct->getId());
238239
$selectionModel = $this->mapProductLinkToBundleSelectionModel(
239240
$selectionModel,
240241
$linkedProduct,

app/code/Magento/Bundle/Model/Selection.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Bundle\Model;
77

8+
use Magento\Framework\App\ObjectManager;
9+
810
/**
911
* Bundle Selection Model
1012
*
@@ -36,8 +38,6 @@
3638
class Selection extends \Magento\Framework\Model\AbstractModel
3739
{
3840
/**
39-
* Catalog data
40-
*
4141
* @var \Magento\Catalog\Helper\Data
4242
*/
4343
protected $_catalogData;
@@ -82,7 +82,9 @@ public function beforeSave()
8282
{
8383
if (!$this->_catalogData->isPriceGlobal() && $this->getWebsiteId()) {
8484
$this->setData('tmp_selection_price_value', $this->getSelectionPriceValue());
85+
$this->setData('tmp_selection_price_type', $this->getSelectionPriceType());
8586
$this->setSelectionPriceValue($this->getOrigData('selection_price_value'));
87+
$this->setSelectionPriceType($this->getOrigData('selection_price_type'));
8688
}
8789
parent::beforeSave();
8890
}
@@ -98,6 +100,9 @@ public function afterSave()
98100
if (null !== $this->getData('tmp_selection_price_value')) {
99101
$this->setSelectionPriceValue($this->getData('tmp_selection_price_value'));
100102
}
103+
if (null !== $this->getData('tmp_selection_price_type')) {
104+
$this->setSelectionPriceType($this->getData('tmp_selection_price_type'));
105+
}
101106
$this->getResource()->saveSelectionPrice($this);
102107

103108
if (!$this->getDefaultPriceScope()) {

app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ public function testAddChildCouldNotSave(): void
621621
->method('create')
622622
->willReturn($bundle);
623623

624-
$selection = $this->createPartialMock(Selection::class, ['save']);
624+
$selection = $this->createPartialMock(Selection::class, ['save', 'load']);
625625
$selection->expects($this->once())->method('save')
626626
->willReturnCallback(
627627
static function () {
@@ -696,7 +696,7 @@ public function testAddChild(): void
696696
->willReturn($selections);
697697
$this->bundleFactoryMock->expects($this->once())->method('create')->willReturn($bundle);
698698

699-
$selection = $this->createPartialMock(Selection::class, ['save', 'getId']);
699+
$selection = $this->createPartialMock(Selection::class, ['save', 'getId', 'load']);
700700
$selection->expects($this->once())->method('save');
701701
$selection->expects($this->once())->method('getId')->willReturn(42);
702702
$this->bundleSelectionMock->expects($this->once())->method('create')->willReturn($selection);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
<click selector="{{AdminNewWidgetSection.selectCategory}}" stepKey="clickOnSelectCategory"/>
2121
<waitForPageLoad stepKey="waitForCategoryTreeLoaded"/>
2222
<click selector="{{AdminCategorySidebarTreeSection.expandRootCategoryByName(DefaultCategory.name)}}" stepKey="clickToExpandDefaultCategory"/>
23-
<waitForElementVisible selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="waitForCategoryVisible"/>
24-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="selectCategory"/>
23+
<waitForElementVisible selector="{{WidgetSection.CreateCategory(categoryName)}}" stepKey="waitForCategoryVisible"/>
24+
<click selector="{{WidgetSection.CreateCategory(categoryName)}}" stepKey="selectCategory"/>
2525
<waitForPageLoad stepKey="waitForWidgetPageLoaded"/>
2626
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/>
2727
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AssertSeeProductDetailsOnStorefrontRecentlyViewedWidgetActionGroup">
1212
<annotations>
13-
<description>Goes to the home Page Recently VIewed Product and Grab the Prdouct name and Position from it.</description>
13+
<description>Goes to the home Page Recently Viewed Product and Grab the Product name and Position from it.</description>
1414
</annotations>
1515
<arguments>
1616
<argument name="productName" type="string"/>
1717
<argument name="productPosition" type="string"/>
1818
</arguments>
19+
<waitForElementVisible selector="{{StoreFrontRecentlyViewedProductSection.ProductName(productPosition)}}" stepKey="waitForProductToShowAtPosition"/>
1920
<grabTextFrom selector="{{StoreFrontRecentlyViewedProductSection.ProductName(productPosition)}}" stepKey="grabRelatedProductPosition"/>
2021
<assertStringContainsString stepKey="assertRelatedProductName">
2122
<actualResult type="const">$grabRelatedProductPosition</actualResult>

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="AdminCategoryBasicFieldSection">
1111
<element name="IncludeInMenu" type="checkbox" selector="input[name='include_in_menu']"/>
1212
<element name="includeInMenuLabel" type="text" selector="input[name='include_in_menu']+label"/>
@@ -27,12 +27,11 @@
2727
<element name="urlExistsErrorMessage" type="text" selector="//div[@class='message message-error error']//h4[contains(text(),'The value specified in the URL Key field would generate a URL that already exists.')]" timeout="30"/>
2828
<element name="presenceProductsInCategory" type="text" selector="//div[@class='admin__data-grid-wrap admin__data-grid-wrap-static']//td[3]" timeout="30"/>
2929
<element name="anchorSwitch" type="input" selector="//input[@name='is_anchor']/../..//div[@class='admin__actions-switch']" timeout="30"/>
30-
<element name="categoryTreeForThree" type="input" selector="//span[contains(text(),'{{var1}}')]/../../..//ul//a//span[contains(text(),'{{var2}}')]/../../..//ul//a/span[contains(text(),'{{var3}}')]" parameterized="true"/>
31-
<element name="categoryTreeForFour" type="input" selector="//span[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../../..//ul//a//span[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../../..//ul//a/span[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../../..//li[2]//a/span[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]" parameterized="true"/>
32-
<element name="categoryTreeForFive" type="input" selector="//span[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../../..//ul//a//span[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../../..//ul//a/span[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../../..//li[2]//a/span[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]/.././../..//ul//a/span[contains(text(),'{{CatE}}') and contains(text(),'({{qty5}})')]" parameterized="true"/>
33-
<element name="sourceCategory" type="text" selector="//div[@class='x-tree-node-el folder active-category x-tree-node-leaf x-tree-selected']//a/span[contains(text(),'{{var1}}')]" parameterized="true"/>
34-
<element name="destinationCategory" type="text" selector="//div[@class='x-tree-node-el folder active-category x-tree-node-expanded']//a/span[contains(text(),'Default Category')]"/>
35-
30+
<element name="categoryTreeForThree" type="input" selector="//a[contains(text(),'{{var1}}')]/../ul//a[contains(text(),'{{var2}}')]/../ul//a[contains(text(),'{{var3}}')]" parameterized="true"/>
31+
<element name="categoryTreeForFour" type="input" selector="//a[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../ul//a[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../ul//a[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../li[2]//a[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]" parameterized="true"/>
32+
<element name="categoryTreeForFive" type="input" selector="//a[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../ul//a[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../ul//a[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../li[2]//a[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]/../ul//a[contains(text(),'{{CatE}}') and contains(text(),'({{qty5}})')]" parameterized="true"/>
33+
<element name="sourceCategory" type="text" selector="//li[contains(@class, 'jstree-node')]//a[contains(text(),'{{var1}}')]" parameterized="true"/>
34+
<element name="destinationCategory" type="text" selector="//li[contains(@class, 'jstree-node')]//a[contains(text(),'Default Category')]"/>
3635
<element name="grabPopUpText" type="input" selector="//div[@class='modal-inner-wrap']//div[@data-id='information-dialog-category']//div[text()='This operation can take a long time']"/>
3736
<element name="acceptPopUp" type="input" selector="//div[@class='modal-inner-wrap']//button[@class='action-primary']/span[text()='Ok']"/>
3837
</section>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCategoryContentSection">
1212
<element name="sectionHeader" type="button" selector="div[data-index='content']" timeout="30"/>
1313
<element name="uploadButton" type="button" selector="//*[@class='file-uploader-area']/label[text()='Upload']"/>
@@ -19,9 +19,9 @@
1919
<element name="AddCMSBlock" type="select" selector="//*[@name='landing_page']"/>
2020
<element name="description" type="input" selector="//*[@name='description']"/>
2121
<element name="content" type="button" selector="div[data-index='content'"/>
22-
<element name="categoryInTree" type="button" selector="//li[contains(@class, 'x-tree-node')]//div[contains(.,'{{categoryName}}') and contains(@class, 'no-active-category')]" parameterized="true" />
22+
<element name="categoryInTree" type="button" selector="//li[contains(@class, 'jstree-node')]//a[contains(.,'{{categoryName}}') and contains(@class, 'jstree-anchor')]" parameterized="true" />
2323
<element name="categoryPageTitle" type="text" selector="h1.page-title" />
24-
<element name="activeCategoryInTree" type="button" selector="//li[contains(@class, 'x-tree-node')]//div[contains(.,'{{categoryName}}') and contains(@class, 'active-category')]" parameterized="true" />
24+
<element name="activeCategoryInTree" type="button" selector="//li[contains(@class, 'jstree-node')]//a[contains(.,'{{categoryName}}') and contains(@class, 'jstree-anchor jstree-clicked')]" parameterized="true" />
2525
<element name="productTableColumnName" type="input" selector="#catalog_category_products_filter_name"/>
2626
<element name="productTableRow" type="button" selector="#catalog_category_products_table tbody tr"/>
2727
<element name="productSearch" type="button" selector="//button[@data-action='grid-filter-apply']" timeout="30"/>

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@
1414
<element name="categoryHighlighted" type="text" selector="//div[@id='store.menu']//span[contains(text(),'{{name}}')]/ancestor::li" parameterized="true" timeout="30"/>
1515
<element name="categoryNotHighlighted" type="text" selector="[id=\'store.menu\'] ul li.active" timeout="30"/>
1616
<element name="categoryTreeRoot" type="text" selector="li.x-tree-node:first-of-type > div.x-tree-node-el:first-of-type" timeout="30"/>
17-
<element name="categoryInTree" type="text" selector="//a/span[contains(text(), '{{name}}')]" parameterized="true" timeout="30"/>
18-
<element name="categoryInTreeUnderRoot" type="text" selector="//li/ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{name}}')]" parameterized="true"/>
19-
<element name="childCategoryUnderParent" type="text" selector="//li/ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{parentCategoryName}}')]/../../../ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{childCategoryName}}')]" parameterized="true"/>
17+
<element name="categoryInTree" type="text" selector="//a[contains(text(), '{{name}}')]" parameterized="true" timeout="30"/>
18+
<element name="categoryInFrontendTree" type="text" selector="//a/span[contains(text(), '{{name}}')]" parameterized="true" timeout="30"/>
19+
<element name="categoryInTreeUnderRoot" type="text" selector="//ul/li[contains(@class, 'jstree-node')]/a[contains(text(), '{{name}}')]" parameterized="true"/>
20+
<element name="childCategoryUnderParent" type="text" selector="//ul/li[contains(@class, 'jstree-node')]/a[contains(text(), '{{parentCategoryName}}')]/../ul/li[contains(@class, 'jstree-node')]/a[contains(text(), '{{childCategoryName}}')]" parameterized="true"/>
2021
<element name="lastCreatedCategory" type="block" selector=".x-tree-root-ct li li:last-child" />
2122
<element name="treeContainer" type="block" selector=".tree-holder" />
2223
<element name="expandRootCategory" type="text" selector="img.x-tree-elbow-end-plus"/>
23-
<element name="expandRootCategoryByName" type="button" selector="//div[@class='x-tree-root-node']/li/div/a/span[contains(., '{{categoryName}}')]/../../img[contains(@class, 'x-tree-elbow-end-plus')]" parameterized="true" timeout="30"/>
24-
<element name="categoryByName" type="text" selector="//div[contains(@class, 'categories-side-col')]//a/span[contains(text(), '{{categoryName}}')]" parameterized="true" timeout="30"/>
25-
<element name="expandCategoryByName" type="text" selector="//span[contains(text(),'{{categoryName}}')]/ancestor::div[contains(@class,'x-tree-node-el')]//img[contains(@class,'x-tree-elbow-end-plus') or contains(@class,'x-tree-elbow-plus')]" parameterized="true" timeout="30"/>
26-
<element name="subCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'SubCat') and contains(text(),'({{productCount}})')]" parameterized="true"/>
27-
<element name="defaultCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'Default Category') and contains(text(),'({{productCount}})')]" parameterized="true"/>
24+
<element name="expandRootCategoryByName" type="button" selector="//a[contains(text(),'{{categoryName}}')]/ancestor::li[contains(@class,'jstree-node')]//i[contains(@class,'jstree-ocl')]" parameterized="true" timeout="30"/>
25+
<element name="categoryByName" type="text" selector="//div[contains(@class, 'categories-side-col')]//a[contains(text(), '{{categoryName}}')]" parameterized="true" timeout="30"/>
26+
<element name="expandCategoryByName" type="text" selector="//a[contains(text(),'{{categoryName}}')]/ancestor::li[contains(@class,'jstree-node')]//i[contains(@class,'jstree-ocl')]" parameterized="true" timeout="30"/>
27+
<element name="subCategoryProductCount" type="text" selector="//div[@class='tree-holder']//a[contains(text(),'SubCat') and contains(text(),'({{productCount}})')]" parameterized="true"/>
28+
<element name="defaultCategoryProductCount" type="text" selector="//div[@class='tree-holder']//a[contains(text(),'Default Category') and contains(text(),'({{productCount}})')]" parameterized="true"/>
2829
</section>
2930
</sections>

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
<section name="AdminProductAttributeSetEditSection">
1212
<!-- Groups Column -->
1313
<element name="groupTree" type="block" selector="#tree-div1"/>
14-
<element name="attributeGroup" type="text" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']" parameterized="true"/>
15-
<element name="attributeGroupExtender" type="button" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']" parameterized="true"/>
16-
<element name="attributeGroupCollapsed" type="button" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']/parent::*/parent::*[contains(@class, 'collapsed')]" parameterized="true"/>
17-
<element name="assignedAttribute" type="text" selector="//*[@id='tree-div1']//span[text()='{{attributeName}}']" parameterized="true"/>
14+
<element name="attributeGroup" type="text" selector="//*[@id='tree-div1']//a[text()='{{groupName}}']" parameterized="true"/>
15+
<element name="attributeGroupExtender" type="button" selector="//*[@id='tree-div1']//a[text()='{{groupName}}']" parameterized="true"/>
16+
<element name="attributeGroupCollapsed" type="button" selector="//*[@id='tree-div1']//a[text()='{{groupName}}']/parent::*[contains(@class, 'jstree-closed')]" parameterized="true"/>
17+
<element name="assignedAttribute" type="text" selector="//*[@id='tree-div1']//a[text()='{{attributeName}}']" parameterized="true"/>
1818
<element name="xThLineItemYthAttributeGroup" type="text" selector="//*[@id='tree-div1']/ul/div/li[{{y}}]//li[{{x}}]" parameterized="true"/>
19-
<element name="xThLineItemAttributeGroup" type="text" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']/parent::*/parent::*/parent::*//li[{{x}}]//a/span" parameterized="true"/>
19+
<element name="xThLineItemAttributeGroup" type="text" selector="//*[@id='tree-div1']//a[text()='{{groupName}}']/parent::*//li[{{x}}]//a" parameterized="true"/>
2020
<element name="attributesInGroup" type="text" selector="//span[text()='{{GroupName}}']/../../following-sibling::ul/li" parameterized="true"/>
2121
<!-- Unassigned Attributes Column -->
2222
<element name="unassignedAttributesTree" type="block" selector="#tree-div2"/>
23-
<element name="unassignedAttribute" type="text" selector="//*[@id='tree-div2']//span[text()='{{attributeName}}']" parameterized="true"/>
24-
<element name="xThLineItemUnassignedAttribute" type="text" selector="//*[@id='tree-div2']//li[{{x}}]//a/span" parameterized="true"/>
23+
<element name="unassignedAttribute" type="text" selector="//*[@id='tree-div2']//a[text()='{{attributeName}}']" parameterized="true"/>
24+
<element name="xThLineItemUnassignedAttribute" type="text" selector="//*[@id='tree-div2']//li[{{x}}]//a" parameterized="true"/>
2525
<!-- Buttons -->
2626
<element name="AddNewGroup" type="button" selector="button[data-ui-id='adminhtml-catalog-product-set-edit-add-group-button']"/>
2727
<element name="DeleteSelectedGroup" type="button" selector="button[data-ui-id='adminhtml-catalog-product-set-edit-delete-group-button']"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<element name="basedOn" type="select" selector="#skeleton_set"/>
1313
<element name="saveBtn" type="button" selector="button.save-attribute-set" timeout="30"/>
1414
<element name="deleteBtn" type="button" selector="button[title='Delete']" timeout="30"/>
15-
<element name="attribute" type="button" selector="//span[text()='{{var1}}']" parameterized="true"/>
15+
<element name="attribute" type="button" selector="//a[text()='{{var1}}']" parameterized="true"/>
1616
<element name="addNewGroupBtn" type="button" selector="button.add" timeout="30"/>
1717
<element name="newGroupName" type="input" selector="input[name='name']"/>
1818
<element name="modalOk" type="button" selector="button.action-accept" timeout="30"/>

0 commit comments

Comments
 (0)