Skip to content

Commit cea0274

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into Hammer-Platform-Health-Delivery-13Aug24
2 parents 38e05f9 + edcd0dc commit cea0274

File tree

238 files changed

+10276
-576
lines changed

Some content is hidden

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

238 files changed

+10276
-576
lines changed

app/code/Magento/Backend/view/adminhtml/web/js/media-uploader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ define([
7575
byteConvert(currentFile.size);
7676

7777
// check if file is allowed to upload and resize
78-
allowedResize = $.inArray(currentFile.extension, allowedExt) !== -1;
78+
allowedResize = $.inArray(currentFile.extension?.toLowerCase(), allowedExt) !== -1;
7979

8080
if (!allowedResize) {
8181
fileUploader.aggregateError(currentFile.name,

app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
<testCaseId value="MC-115"/>
1919
<group value="Bundle"/>
2020
<group value="cloud"/>
21-
<skip>
22-
<issueId value="AC-12124">Fotorama lib isn't loaded</issueId>
23-
</skip>
21+
<!-- Excluded from PR builds due to AC-12124 -->
22+
<group value="pr_exclude"/>
2423
</annotations>
2524
<before>
2625
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCheckBoxOptionValidationTest.xml

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<group value="Bundle"/>
2020
<group value="pr_exclude"/>
2121
<group value="cloud"/>
22+
<skip>
23+
<issueId value="AC-10826"/>
24+
</skip>
2225
</annotations>
2326
<before>
2427
<createData entity="ApiProductWithDescription" stepKey="simpleProduct1" before="bundleProduct"/>

app/code/Magento/Catalog/Model/Product/Price/Validation/TierPriceValidator.php

+25-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Catalog\Model\Product\Type;
1212
use Magento\Catalog\Model\ProductIdLocatorInterface;
1313
use Magento\Customer\Api\GroupRepositoryInterface;
14+
use Magento\Directory\Model\Currency;
1415
use Magento\Framework\Api\FilterBuilder;
1516
use Magento\Framework\Api\SearchCriteriaBuilder;
1617
use Magento\Framework\Exception\LocalizedException;
@@ -426,7 +427,7 @@ private function checkUnique(
426427
foreach ($prices[$tierPrice->getSku()] as $price) {
427428
if ($price !== $tierPrice) {
428429
$checkWebsiteValue = $isExistingPrice ? $this->compareWebsiteValue($price, $tierPrice)
429-
: ($price->getWebsiteId() == $tierPrice->getWebsiteId());
430+
: $this->compareWebsiteValueNewPrice($price, $tierPrice);
430431
if (strtolower($price->getCustomerGroup()) === strtolower($tierPrice->getCustomerGroup())
431432
&& $price->getQuantity() == $tierPrice->getQuantity()
432433
&& $checkWebsiteValue
@@ -547,6 +548,29 @@ private function compareWebsiteValue(TierPriceInterface $price, TierPriceInterfa
547548
&& $price->getWebsiteId() != $tierPrice->getWebsiteId();
548549
}
549550

551+
/**
552+
* Compare Website Values between for new price records
553+
*
554+
* @param TierPriceInterface $price
555+
* @param TierPriceInterface $tierPrice
556+
* @return bool
557+
*/
558+
private function compareWebsiteValueNewPrice(TierPriceInterface $price, TierPriceInterface $tierPrice): bool
559+
{
560+
if ($price->getWebsiteId() == $this->allWebsitesValue ||
561+
$tierPrice->getWebsiteId() == $this->allWebsitesValue
562+
) {
563+
$baseCurrency = $this->scopeConfig->getValue(Currency::XML_PATH_CURRENCY_BASE, 'default');
564+
$websiteId = max($price->getWebsiteId(), $tierPrice->getWebsiteId());
565+
$website = $this->websiteRepository->getById($websiteId);
566+
$websiteCurrency = $website->getBaseCurrencyCode();
567+
568+
return $baseCurrency == $websiteCurrency;
569+
}
570+
571+
return $price->getWebsiteId() == $tierPrice->getWebsiteId();
572+
}
573+
550574
/**
551575
* @inheritDoc
552576
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminAssertCategoryCountInCategoryTreeWidgetActionGroup">
12+
<annotations>
13+
<description>This action group verifies that the total number of expanded categories in the admin category tree widget matches the provided expected count.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="ExpectedCount" type="string" defaultValue="1"/>
17+
</arguments>
18+
<grabMultiple selector="{{CmsNewWidgetUpdateLayoutSection.CountAllNestedCat}}" stepKey="countNestedCategory"/>
19+
<assertCount stepKey="check">
20+
<expectedResult type="int">{{ExpectedCount}}</expectedResult>
21+
<actualResult type="variable">countNestedCategory</actualResult>
22+
</assertCount>
23+
</actionGroup>
24+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminExpandCategoryTreeWidgetActionGroup">
12+
<annotations>
13+
<description>This action group expands a specified category in the admin category tree widget by clicking on the expand icon and waiting for the page to load.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="CategoryName" type="string" defaultValue="Category 1"/>
17+
</arguments>
18+
<click selector="{{CmsNewWidgetUpdateLayoutSection.BranchCat(CategoryName)}}" stepKey="clickExpandCategory"/>
19+
<waitForPageLoad stepKey="waitForCategoryExpand"/>
20+
</actionGroup>
21+
</actionGroups>

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
<testCaseId value="MC-103"/>
1919
<group value="Catalog"/>
2020
<group value="cloud"/>
21-
<skip>
22-
<issueId value="AC-12124">Fotorama lib isn't loaded</issueId>
23-
</skip>
21+
<!-- Excluded from PR builds due to AC-12124 -->
22+
<group value="pr_exclude"/>
2423
</annotations>
2524
<before>
2625
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
<severity value="BLOCKER"/>
1717
<testCaseId value="MC-189"/>
1818
<group value="Catalog"/>
19-
<skip>
20-
<issueId value="AC-12124">Fotorama lib isn't loaded</issueId>
21-
</skip>
19+
<!-- Excluded from PR builds due to AC-12124 -->
20+
<group value="pr_exclude"/>
2221
</annotations>
2322

2423
<before>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminValidateMixedNestedCategoryInWidgetTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Validate the proper loading of mixed nested categories in the category widget"/>
15+
<title value="Ensure mixed nested categories of Level 5 and beyond load correctly in the category widget"/>
16+
<description value="This test verifies that mixed nested categories, including Level 5 and higher, with and without children, are loaded properly in the category widget in the admin panel."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-12647"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createBaseCategory"/>
23+
<createData entity="SubCategoryWithParent" stepKey="createLevelTwoCategory">
24+
<field key="name">SubCategoryLvl-2</field>
25+
<field key="parent_id">$$createBaseCategory.id$$</field>
26+
<requiredEntity createDataKey="createBaseCategory"/>
27+
</createData>
28+
<createData entity="SubCategoryWithParent" stepKey="createLevelThreeCategory">
29+
<field key="name">SubCategoryLvl-3</field>
30+
<field key="parent_id">$$createLevelTwoCategory.id$$</field>
31+
<requiredEntity createDataKey="createLevelTwoCategory"/>
32+
</createData>
33+
<createData entity="SubCategoryWithParent" stepKey="createLevelFourCategory">
34+
<field key="name">SubCategoryLvl-4</field>
35+
<field key="parent_id">$$createLevelThreeCategory.id$$</field>
36+
<requiredEntity createDataKey="createLevelThreeCategory"/>
37+
</createData>
38+
<createData entity="SubCategoryWithParent" stepKey="createLevelFiveCategory">
39+
<field key="name">SubCategoryLvl-5</field>
40+
<field key="parent_id">$$createLevelFourCategory.id$$</field>
41+
<requiredEntity createDataKey="createLevelFourCategory"/>
42+
</createData>
43+
<createData entity="SubCategoryWithParent" stepKey="createLevelSixCategory">
44+
<field key="name">SubCategoryLvl-6</field>
45+
<field key="parent_id">$$createLevelFiveCategory.id$$</field>
46+
<requiredEntity createDataKey="createLevelFiveCategory"/>
47+
</createData>
48+
<createData entity="SubCategoryWithParent" stepKey="createLevelFiveSubCategory">
49+
<field key="name">SubCategoryLvl-5-1</field>
50+
<field key="parent_id">$$createLevelFiveCategory.id$$</field>
51+
<requiredEntity createDataKey="createLevelFiveCategory"/>
52+
</createData>
53+
<createData entity="SubCategoryWithParent" stepKey="createLevelFiveOneSubCategory">
54+
<field key="name">SubCategoryLvl-5-1-1</field>
55+
<field key="parent_id">$$createLevelFiveSubCategory.id$$</field>
56+
<requiredEntity createDataKey="createLevelFiveSubCategory"/>
57+
</createData>
58+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
59+
</before>
60+
<after>
61+
<deleteData createDataKey="createLevelFiveOneSubCategory" stepKey="deleteLevelFiveOneSubCategory"/>
62+
<deleteData createDataKey="createLevelFiveSubCategory" stepKey="deleteLevelFiveSubCategory"/>
63+
<deleteData createDataKey="createLevelSixCategory" stepKey="deleteLevelSixCategory"/>
64+
<deleteData createDataKey="createLevelFiveCategory" stepKey="deleteLevelFiveCategory"/>
65+
<deleteData createDataKey="createLevelFourCategory" stepKey="deleteLevelFourCategory"/>
66+
<deleteData createDataKey="createLevelThreeCategory" stepKey="deleteLevelThreeCategory"/>
67+
<deleteData createDataKey="createLevelTwoCategory" stepKey="deleteLevelTwoCategory"/>
68+
<deleteData createDataKey="createBaseCategory" stepKey="deleteDefaultCategory"/>
69+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
70+
</after>
71+
72+
<!-- Start creating a new widget. Note that we don't need to save it for the cause of the test. -->
73+
<actionGroup ref="AdminCreateSpecificEntityWidgetActionGroup" stepKey="startCreatingWidget">
74+
<argument name="widget" value="CatalogCategoryLinkSpecifiedCategory"/>
75+
</actionGroup>
76+
<click selector="{{AdminNewWidgetSection.storefrontProperties}}" stepKey="clickStorefrontProperties"/>
77+
78+
<!-- Expand all previously created categories one by one. -->
79+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandDefaultCategoryTree">
80+
<argument name="CategoryName" value="Default Category"/>
81+
</actionGroup>
82+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFirstLevelCategoryTree">
83+
<argument name="CategoryName" value="$createBaseCategory.name$"/>
84+
</actionGroup>
85+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandSecondLevelCategoryTree">
86+
<argument name="CategoryName" value="$createLevelTwoCategory.name$"/>
87+
</actionGroup>
88+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandThirdLevelCategoryTree">
89+
<argument name="CategoryName" value="$createLevelThreeCategory.name$"/>
90+
</actionGroup>
91+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFourthLevelCategoryTree">
92+
<argument name="CategoryName" value="$createLevelFourCategory.name$"/>
93+
</actionGroup>
94+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFifthLevelCategoryTree">
95+
<argument name="CategoryName" value="$createLevelFiveCategory.name$"/>
96+
</actionGroup>
97+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandSixthLevelCategoryTree">
98+
<argument name="CategoryName" value="$createLevelSixCategory.name$"/>
99+
</actionGroup>
100+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFifthSubCategoryTree">
101+
<argument name="CategoryName" value="$createLevelFiveSubCategory.name$"/>
102+
</actionGroup>
103+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFifthOneSubCategoryTree">
104+
<argument name="CategoryName" value="$createLevelFiveOneSubCategory.name$"/>
105+
</actionGroup>
106+
107+
<!-- Check the total number of expanded categories in the category tree widget ensuring all of them are loaded. -->
108+
<actionGroup ref="AdminAssertCategoryCountInCategoryTreeWidgetActionGroup" stepKey="checkCategoryCount">
109+
<argument name="ExpectedCount" value="9"/>
110+
</actionGroup>
111+
</test>
112+
</tests>

0 commit comments

Comments
 (0)