Skip to content

Commit e81b4de

Browse files
author
rostislav
committed
Merge remote-tracking branch 'origin/fix-for-issue-38758' into fix-for-issue-38758
2 parents 5b29414 + 2735499 commit e81b4de

File tree

285 files changed

+10975
-1092
lines changed

Some content is hidden

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

285 files changed

+10975
-1092
lines changed

app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ public function testSearchDirectory(): void
439439
$this->metadataProviderMock->expects(self::any())->method('getMetadata')
440440
->willReturnMap([
441441
['path', ['type' => AwsS3::TYPE_DIR]],
442-
['path/1', ['type' => AwsS3::TYPE_FILE]],
443-
['path/2', ['type' => AwsS3::TYPE_FILE]],
442+
['path/1', ['type' => AwsS3::TYPE_DIR]],
443+
['path/2', ['type' => AwsS3::TYPE_DIR]],
444444
]);
445445
$this->adapterMock->expects(self::atLeastOnce())->method('listContents')
446446
->willReturn(new \ArrayIterator($subPaths));

app/code/Magento/Backend/view/adminhtml/layout/default.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<meta name="viewport" content="width=1024"/>
1212
<meta name="format-detection" content="telephone=no"/>
1313
<link src="requirejs/require.js"/>
14-
<css src="extjs/resources/css/ext-all.css"/>
15-
<css src="extjs/resources/css/ytheme-magento.css"/>
1614
</head>
1715
<body>
1816
<attribute name="id" value="html-body"/>

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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 3 additions & 0 deletions
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/Block/Product/View/Options/Type/Date.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ public function getCalendarDateHtml()
9393
$yearStart = $this->_catalogProductOptionTypeDate->getYearStart();
9494
$yearEnd = $this->_catalogProductOptionTypeDate->getYearEnd();
9595

96-
$dateFormat = $this->_localeDate->getDateFormatWithLongYear();
96+
$fieldsSeparator = '/';
97+
$fieldsOrder = $this->_catalogProductOptionTypeDate->getConfigData('date_fields_order') ?? '';
98+
$fieldsOrder = str_replace(",", $fieldsSeparator, $fieldsOrder);
99+
$dateFormat = $fieldsOrder !== "m/d/y" ? $fieldsOrder : $this->_localeDate->getDateFormatWithLongYear();
97100
/** Escape RTL characters which are present in some locales and corrupt formatting */
98101
$escapedDateFormat = preg_replace('/[^MmDdYy\/\.\-]/', '', $dateFormat);
99102
$value = null;

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

Lines changed: 25 additions & 1 deletion
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
*/

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ private function getCollectionProcessor()
813813
{
814814
if (!$this->collectionProcessor) {
815815
$this->collectionProcessor = \Magento\Framework\App\ObjectManager::getInstance()->get(
816-
// phpstan:ignore "Class Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor not found."
816+
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
817817
\Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor::class
818818
);
819819
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAddCustomizableOptionToSimpleProductActionGroup">
12+
<annotations>
13+
<description value="Add a custom option of type date to simple product." />
14+
</annotations>
15+
16+
<click selector="{{AdminProductCustomizableOptionSection.customizableOptionsToggle}}" stepKey="expandCustomOptions"/>
17+
<scrollTo selector="{{AdminProductCustomizableOptionSection.customizableOptionsToggle}}" stepKey="scrollToCustomizableOptions"/>
18+
19+
<click selector="{{AdminProductCustomizableOptionSection.addButtonOption}}" stepKey="clickAddButtonOption"/>
20+
<waitForElementVisible selector="{{AdminProductCustomizableOptionSection.customOptionXTitle}}" stepKey="waitForOptions"/>
21+
<fillField selector="{{AdminProductCustomizableOptionSection.customOptionXTitle}}" userInput="custom option 1" stepKey="fillOptionTitle"/>
22+
23+
<click selector="{{AdminProductCustomizableOptionSection.customOptionSelectType}}" stepKey="selectType"/>
24+
<click selector="{{AdminProductCustomizableOptionSection.customOptionSelectField}}" stepKey="selectField"/>
25+
<click selector="{{AdminProductCustomizableOptionSection.uncheckRequired}}" stepKey="uncheckRequired"/>
26+
<fillField selector="{{AdminProductCustomizableOptionSection.customizableOptionPrice}}" userInput="0" stepKey="fillPrice"/>
27+
28+
<waitForElementVisible selector="{{AdminProductCustomizableOptionSection.save}}" stepKey="waitForSaveButton"/>
29+
<click selector="{{AdminProductCustomizableOptionSection.save}}" stepKey="clickSaveButton"/>
30+
<waitForPageLoad stepKey="waitForAttributeToSave"/>
31+
<seeElement selector="{{AdminProductCustomizableOptionSection.successMessage}}" stepKey="seeSuccessMessage"/>
32+
</actionGroup>
33+
</actionGroups>
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>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminConfigExpandDateAndTimeTabActionGroup">
12+
<annotations>
13+
<description>Expand date and time options tab.</description>
14+
</annotations>
15+
16+
<scrollTo selector="{{CatalogSection.dateAndTimeCustomOptions}}" stepKey="scrollDownToDateAndTime"/>
17+
<conditionalClick selector="{{CatalogSection.dateAndTimeCustomOptions}}" dependentSelector="{{CatalogSection.CheckIfTabExpandForDateAndTimeCustomOptions}}" visible="true" stepKey="expandDateAndTimeCustomOptionsTab"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 21 additions & 0 deletions
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>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertProductDateFormatInStorefrontActionGroup">
12+
<annotations>
13+
<description value="Go to product page on the storefront and assert sku and custom option date format"/>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="product"/>
18+
</arguments>
19+
20+
<!-- Go to storefront product page, assert product sku and date custom option -->
21+
<amOnPage url="{{product.urlKey}}.html" stepKey="navigateToProductPage"/>
22+
<waitForPageLoad stepKey="waitForPageLoad"/>
23+
24+
<see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/>
25+
26+
<click selector="{{StorefrontProductInfoMainSection.productCalenderButton}}" stepKey="clickCalenderButton"/>
27+
<click selector="{{StorefrontProductInfoMainSection.productCalenderGoToday}}" stepKey="clickCalenderGoTodayButton"/>
28+
29+
<generateDate date="Now" format="j/n/Y" stepKey="currentDate"/>
30+
31+
<executeJS function="
32+
var xpath = '{{StorefrontProductInfoMainSection.customDateField}}';
33+
var result = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
34+
var element = result.singleNodeValue;
35+
return element.value;
36+
" stepKey="dateValue"/>
37+
38+
<assertEquals stepKey="assertDateFormat">
39+
<actualResult type="variable">dateValue</actualResult>
40+
<expectedResult type="variable">currentDate</expectedResult>
41+
</assertEquals>
42+
43+
</actionGroup>
44+
</actionGroups>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="SelectDropdownDateAndTimeActionGroup">
12+
<annotations>
13+
<description>Select options for Use JavaScript Calendar and Date Fields Order dropdown</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="useJsCalender" type="string"/>
18+
<argument name="firstFieldOfDateOrder" type="string"/>
19+
<argument name="secondFieldOfDateOrder" type="string"/>
20+
<argument name="thirdFieldOfDateOrder" type="string" defaultValue="Year"/>
21+
</arguments>
22+
23+
<selectOption selector="{{AdminCustomizeDateAndTimeSection.dateAndTimeJsCalenderStatus}}"
24+
userInput="{{useJsCalender}}" stepKey="selectJsCalender" />
25+
<selectOption selector="{{AdminCustomizeDateAndTimeSection.dateAndTimeFirstFieldOrder}}"
26+
userInput="{{firstFieldOfDateOrder}}" stepKey="selectFirstFieldOrder" />
27+
<selectOption selector="{{AdminCustomizeDateAndTimeSection.dateAndTimeSecondFieldOrder}}"
28+
userInput="{{secondFieldOfDateOrder}}" stepKey="selectSecondFieldOrder" />
29+
<selectOption selector="{{AdminCustomizeDateAndTimeSection.dateAndTimeThirdFieldOrder}}"
30+
userInput="{{thirdFieldOfDateOrder}}" stepKey="selectThirdFieldOrder" />
31+
</actionGroup>
32+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AdminCustomizeDateAndTimeSection">
12+
<element name="dateAndTimeJsCalenderStatus" type="select" selector="//*[@id='catalog_custom_options_use_calendar']"/>
13+
<element name="dateAndTimeFirstFieldOrder" type="select" selector="//*[@id='catalog_custom_options_date_fields_order'][1]"/>
14+
<element name="dateAndTimeSecondFieldOrder" type="select" selector="//*[@id='catalog_custom_options_date_fields_order'][2]"/>
15+
<element name="dateAndTimeThirdFieldOrder" type="select" selector="//*[@id='catalog_custom_options_date_fields_order'][3]"/>
16+
</section>
17+
</sections>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminProductCustomizableOptionSection">
12+
<element name="customizableOptionsToggle" type="button" selector="//span[text()='Customizable Options']"/>
13+
<element name="addButtonOption" type="button" selector="button[data-index='button_add']"/>
14+
<element name="customOptionXTitle" type="input" selector="[name='product[options][0][title]']"/>
15+
<element name="customOptionSelectType" type="select" selector="[data-index='container_common'] .admin__action-multiselect-text"/>
16+
<element name="customOptionSelectField" type="select" selector="//label[contains(text(),'Date')]" />
17+
<element name="uncheckRequired" type="checkbox" selector="//span[contains(text(),'Required')]"/>
18+
<element name="customizableOptionPrice" type="input" selector=".//*[@name='product[options][0][price]']" />
19+
<element name="save" type="button" selector="//*[@id='save-button']" timeout="30"/>
20+
<element name="successMessage" type="text" selector=".message.message-success.success"/>
21+
</section>
22+
</sections>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,8 @@
114114
<element name="swatchOptionDisabled" type="text" selector=".//*[@class='swatch-option color disabled']"/>
115115
<element name="addToCartEnabled" type="button" selector="#product-addtocart-button:not([disabled])"/>
116116
<element name="selectCustomOptionDropDown" type="select" selector="//select[contains(@class,' required product-custom-option admin__control-select')]"/>
117+
<element name="productCalenderButton" type="button" selector="//*[@id='product-options-wrapper']/div/div/fieldset/div/button" />
118+
<element name="productCalenderGoToday" type="button" selector="//*[@id='ui-datepicker-div']/div[2]/button[1]" />
119+
<element name="customDateField" type="text" selector='//*[@class="product-custom-option datetime-picker input-text _has-datepicker"]' />
117120
</section>
118121
</sections>

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

Lines changed: 2 additions & 3 deletions
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"/>

0 commit comments

Comments
 (0)