Skip to content

Commit 6ba4ce9

Browse files
Chhandak.BaruaChhandak.Barua
Chhandak.Barua
authored and
Chhandak.Barua
committed
Merge remote-tracking branch 'origin/2.4-develop' into ACP2E-3127
2 parents d52f459 + b21e5d9 commit 6ba4ce9

File tree

22 files changed

+786
-194
lines changed

22 files changed

+786
-194
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/************************************************************************
4+
*
5+
* Copyright 2024 Adobe
6+
* All Rights Reserved.
7+
*
8+
* ************************************************************************
9+
*/
10+
-->
11+
12+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
14+
<test name="AdminOrderCreateAfterHtmlMinificationTest">
15+
<annotations>
16+
<features value="Backend"/>
17+
<stories value="Admin Panel with HTML minification"/>
18+
<title value="Admin panel should allow order creation with HTML minification enabled"/>
19+
<description value="Admin panel should allow order creation with HTML minification enabled"/>
20+
<testCaseId value="AC-12329"/>
21+
<useCaseId value="ACP2E-3169"/>
22+
<severity value="MAJOR"/>
23+
<group value="backend"/>
24+
<group value="cloud"/>
25+
</annotations>
26+
<before>
27+
<magentoCLI command="config:set {{MinifyHtmlFilesEnableConfigData.path}} {{MinifyHtmlFilesEnableConfigData.value}}" stepKey="enableHtmlMinification"/>
28+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
29+
<argument name="tags" value="config"/>
30+
</actionGroup>
31+
<magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/>
32+
<createData entity="Simple_US_Customer_CA" stepKey="createSimpleCustomer"/>
33+
<createData entity="ApiProductWithDescription" stepKey="createSimpleProduct"/>
34+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
35+
</before>
36+
<after>
37+
<magentoCLI command="config:set {{MinifyHtmlFilesDisableConfigData.path}} {{MinifyHtmlFilesDisableConfigData.value}}" stepKey="disableHtmlMinification"/>
38+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
39+
<argument name="tags" value="config"/>
40+
</actionGroup>
41+
<magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/>
42+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
43+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
44+
<deleteData createDataKey="createSimpleCustomer" stepKey="deleteSimpleCustomer"/>
45+
</after>
46+
<waitForPageLoad stepKey="waitForPageLoadOnDashboard"/>
47+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeDashboardTitle">
48+
<argument name="value" value="Dashboard"/>
49+
</actionGroup>
50+
<actionGroup ref="CreateOrderActionGroup" stepKey="createOrder">
51+
<argument name="product" value="$$createSimpleProduct$$"/>
52+
<argument name="customer" value="$$createSimpleCustomer$$"/>
53+
</actionGroup>
54+
</test>
55+
</tests>

app/code/Magento/Catalog/Model/Product/Gallery/ReadHandler.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function execute($entity, $arguments = [])
6464

6565
$this->addMediaDataToProduct(
6666
$entity,
67-
$this->sortMediaEntriesByPosition($mediaEntries)
67+
$mediaEntries
6868
);
6969

7070
return $entity;
@@ -80,6 +80,7 @@ public function execute($entity, $arguments = [])
8080
*/
8181
public function addMediaDataToProduct(Product $product, array $mediaEntries)
8282
{
83+
$mediaEntries = $this->sortMediaEntriesByPosition($mediaEntries);
8384
$product->setData(
8485
$this->getAttribute()->getAttributeCode(),
8586
[
@@ -111,6 +112,7 @@ public function getAttribute()
111112
* @param string[] $image
112113
* @return string
113114
* @deprecated 101.0.1
115+
* @see \Magento\Catalog\Model\Product\Gallery\ReadHandler::addMediaDataToProduct
114116
* @since 101.0.0
115117
*/
116118
protected function findDefaultValue($key, &$image)

app/code/Magento/Catalog/Test/Mftf/Data/ConfigData.xml

+8
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@
2525
<data key="path">catalog/review/allow_guest</data>
2626
<data key="value">0</data>
2727
</entity>
28+
<entity name="EnableJavascriptCalendar">
29+
<data key="path">catalog/custom_options/use_calendar</data>
30+
<data key="value">1</data>
31+
</entity>
32+
<entity name="DisableJavascriptCalendar">
33+
<data key="path">catalog/custom_options/use_calendar</data>
34+
<data key="value">0</data>
35+
</entity>
2836
</entities>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="productCustomizableDatepickerOption1">
12+
<data key="title" unique="suffix">option1</data>
13+
<data key="is_required">1</data>
14+
<data key="type">Date</data>
15+
<data key="option_0_price">100</data>
16+
<data key="option_0_price_type">Fixed</data>
17+
<data key="option_0_sku" unique="suffix">sku1_</data>
18+
</entity>
19+
<entity name="productCustomizableDatepickerOption2">
20+
<data key="title" unique="suffix">option2</data>
21+
<data key="is_required">1</data>
22+
<data key="type">Date</data>
23+
<data key="option_0_price">200</data>
24+
<data key="option_0_price_type">Fixed</data>
25+
<data key="option_0_sku" unique="suffix">sku2_</data>
26+
</entity>
27+
<entity name="productCustomizableDatepicker">
28+
<data key="name">customizable datepicker product</data>
29+
<data key="sku">customizable_datepicker_product</data>
30+
<data key="price">100</data>
31+
<data key="weight">1</data>
32+
<data key="quantity">100</data>
33+
</entity>
34+
</entities>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<element name="customMultiSelect" type="select" selector="[name='product[multi_en]']"/>
3030

3131
<element name="optionTypeDropDown" type="select" selector="//table[@data-index='options']//tr[{{index}}]//div[@data-index='type']//div[contains(@class, 'action-select-wrap')]" parameterized="true" timeout="30"/>
32-
<element name="optionTypeItem" type="select" selector="//table[@data-index='options']//tr[{{index}}]//div[@data-index='type']//*[contains(@class, 'action-menu-item')]//*[contains(., '{{optionValue}}')]" parameterized="true" timeout="30"/>
32+
<element name="optionTypeItem" type="select" selector="//table[@data-index='options']//tr[{{index}}]//div[@data-index='type']//*[contains(@class, 'action-menu-item')]//label[contains(text(), '{{optionValue}}')]" parameterized="true" timeout="30"/>
3333
<element name="checkSelect" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//span[text()='Option Type']/parent::label/parent::div/parent::div//div[@data-role='selected-option']" parameterized="true"/>
3434
<element name="checkOptionType" type="select" selector="//span[text()='{{optionTitle}}']/parent::div/parent::div/parent::div//parent::label/parent::div/parent::div//li[@class='admin__action-multiselect-menu-inner-item']//label[text()='{{optionType}}']" parameterized="true"/>
3535
<element name="checkDropDown" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//parent::label/parent::div/parent::div//li[@class='admin__action-multiselect-menu-inner-item']//label[text()='Drop-down']" parameterized="true"/>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
/* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Date */
88
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
9+
/** @var \Magento\Framework\Escaper $escaper */
910
?>
1011

1112
<?php $_option = $block->getOption(); ?>
1213
<?php $_optionId = (int)$_option->getId(); ?>
1314
<?php $optionId = /* @noEscape */ $_optionId ?>
1415
<div class="admin__field field<?= $_option->getIsRequire() ? ' required' : '' ?>">
1516
<label class="label admin__field-label">
16-
<?= $block->escapeHtml($_option->getTitle()) ?>
17+
<?= $escaper->escapeHtml($_option->getTitle()) ?>
1718
<?= /* @noEscape */ $block->getFormattedPrice() ?>
1819
</label>
1920
<div class="admin__field-control control">
@@ -56,7 +57,6 @@ script;
5657
"mage/backend/validation"
5758
], function(jQuery){
5859
59-
//<![CDATA[
6060
script;
6161
if ($_option->getIsRequire()):
6262
$scriptString .= <<<script
@@ -88,7 +88,6 @@ script;
8888
script;
8989
endif;
9090
$scriptString .= <<<script
91-
//]]>
9291
9392
});
9493
script;

app/code/Magento/CatalogWidget/Block/Product/ProductsList.php

+1
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ public function getAddToCartPostParams(Product $product)
310310
'action' => $url,
311311
'data' => [
312312
'product' => $product->getEntityId(),
313+
'options' => $this->optionsData->getOptionsData($product),
313314
ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlEncoder->encode($url),
314315
]
315316
];

app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php

+15-22
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Magento\Integration\Test\Unit\Oauth;
99

10-
use Laminas\OAuth\Http\Utility;
10+
use Magento\Framework\Oauth\Helper\Utility;
1111
use Magento\Framework\DataObject;
1212
use Magento\Framework\Math\Random;
1313
use Magento\Framework\Oauth\Helper\Oauth;
@@ -55,8 +55,8 @@ class OauthTest extends TestCase
5555
/** @var \Magento\Framework\Oauth\Oauth */
5656
private $_oauth;
5757

58-
/** @var \Zend_Oauth_Http_Utility */
59-
private $_httpUtilityMock;
58+
/** @var Utility */
59+
private $utility;
6060

6161
/** @var DateTime */
6262
private $_dateMock;
@@ -160,9 +160,7 @@ protected function setUp(): void
160160
$this->_oauthHelperMock = $this->getMockBuilder(Oauth::class)
161161
->setConstructorArgs([new Random()])
162162
->getMock();
163-
$this->_httpUtilityMock = $this->getMockBuilder(Utility::class)
164-
->onlyMethods(['sign'])
165-
->getMock();
163+
$this->utility = $this->createMock(Utility::class);
166164
$this->_dateMock = $this->getMockBuilder(DateTime::class)
167165
->disableOriginalConstructor()
168166
->getMock();
@@ -190,7 +188,7 @@ protected function setUp(): void
190188
$this->_oauthHelperMock,
191189
$nonceGenerator,
192190
$tokenProvider,
193-
$this->_httpUtilityMock
191+
$this->utility
194192
);
195193
$this->_oauthToken = $this->_generateRandomString(Oauth::LENGTH_TOKEN);
196194
$this->_oauthSecret = $this->_generateRandomString(Oauth::LENGTH_TOKEN_SECRET);
@@ -199,17 +197,6 @@ protected function setUp(): void
199197
);
200198
}
201199

202-
protected function tearDown(): void
203-
{
204-
unset($this->_consumerFactory);
205-
unset($this->_nonceFactory);
206-
unset($this->_tokenFactory);
207-
unset($this->_oauthHelperMock);
208-
unset($this->_httpUtilityMock);
209-
unset($this->_dateMock);
210-
unset($this->_oauth);
211-
}
212-
213200
/**
214201
* @param array $amendments
215202
* @return array
@@ -477,7 +464,7 @@ public function testGetRequestTokenTokenRejected()
477464
$this->_setupToken(false);
478465

479466
$signature = 'valid_signature';
480-
$this->_httpUtilityMock->expects($this->any())->method('sign')->willReturn($signature);
467+
$this->utility->expects($this->any())->method('sign')->willReturn($signature);
481468

482469
$this->_oauth->getRequestToken(
483470
$this->_getRequestTokenParams(['oauth_signature' => $signature]),
@@ -498,7 +485,7 @@ public function testGetRequestTokenTokenRejectedByType()
498485
// wrong type
499486

500487
$signature = 'valid_signature';
501-
$this->_httpUtilityMock->expects($this->any())->method('sign')->willReturn($signature);
488+
$this->utility->expects($this->any())->method('sign')->willReturn($signature);
502489

503490
$this->_oauth->getRequestToken(
504491
$this->_getRequestTokenParams(['oauth_signature' => $signature]),
@@ -548,7 +535,7 @@ public function testGetRequestToken()
548535
$this->_setupToken();
549536

550537
$signature = 'valid_signature';
551-
$this->_httpUtilityMock->expects($this->any())->method('sign')->willReturn($signature);
538+
$this->utility->expects($this->any())->method('sign')->willReturn($signature);
552539

553540
$requestToken = $this->_oauth->getRequestToken(
554541
$this->_getRequestTokenParams(['oauth_signature' => $signature]),
@@ -802,7 +789,13 @@ public function testValidateAccessToken()
802789
public function testBuildAuthorizationHeader()
803790
{
804791
$signature = 'valid_signature';
805-
$this->_httpUtilityMock->expects($this->any())->method('sign')->willReturn($signature);
792+
$this->utility->expects($this->once())->method('sign')->willReturn($signature);
793+
$this->utility->expects($this->once())
794+
->method('toAuthorizationHeader')
795+
->willReturn('OAuth oauth_nonce="tyukmnjhgfdcvxstyuioplkmnhtfvert",oauth_timestamp="1657789046",' .
796+
'oauth_version="1.0",oauth_consumer_key="edf957ef88492f0a32eb7e1731e85da2",' .
797+
'oauth_consumer_secret="asdawwewefrtyh2f0a32eb7e1731e85d",oauth_token="7c0709f789e1f38a17aa4b9a28e1b06c",' .
798+
'oauth_token_secret="a6agsfrsfgsrjjjjyy487939244ssggg",oauth_signature="valid_signature"');
806799

807800
$this->_setupConsumer(false);
808801
$this->_oauthHelperMock->expects(

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsSection.xml

+3
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@
4141
<element name="totalRecords" type="text" selector="#sales_order_create_search_grid-total-count"/>
4242
<element name="numberOfPages" type="text" selector="div.admin__data-grid-pager-wrap div.admin__data-grid-pager > label"/>
4343
<element name="productName" type="button" selector="(.//*[@class='col-product'])[2]/span"/>
44+
<element name="productCompositeDatePicker" type="button" selector="//*[@id='product_composite_configure_fields_options']//div[{{row}}]//button[contains(@class, 'ui-datepicker-trigger')]" parameterized="true"/>
45+
<element name="datepickerGoToday" type="button" selector="#ui-datepicker-div button.ui-datepicker-current" timeout="30"/>
46+
<element name="datepickerClose" type="button" selector="#ui-datepicker-div button.ui-datepicker-close" timeout="30"/>
4447
</section>
4548
</sections>

0 commit comments

Comments
 (0)