Skip to content

Commit a827dbb

Browse files
author
Stanislav Idolov
committed
Merge remote-tracking branch 'mainline/2.3-develop' into ENGCOM-5205-magento-async-import-102
2 parents 1e67549 + b81986b commit a827dbb

File tree

348 files changed

+30674
-2933
lines changed

Some content is hidden

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

348 files changed

+30674
-2933
lines changed

app/code/Magento/AuthorizenetAcceptjs/Test/Mftf/Test/FullCaptureAuthorizenetAcceptjsTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<waitForPageLoad stepKey="waitForProductPage"/>
5555
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/>
5656
<waitForPageLoad stepKey="waitForCartToFill"/>
57+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
5758

5859
<!--Checkout steps-->
5960
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup"/>

app/code/Magento/AuthorizenetAcceptjs/Test/Mftf/Test/GuestCheckoutVirtualProductAuthorizenetAcceptjsTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@
5555
<waitForPageLoad stepKey="waitForProductPage"/>
5656
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/>
5757
<waitForPageLoad stepKey="waitForCartToFill"/>
58+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
5859
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCartAgain"/>
5960
<waitForPageLoad stepKey="waitForCartToFillAgain"/>
61+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage2"/>
6062

6163
<!--Checkout steps-->
6264
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup"/>

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<severity value="MAJOR"/>
1919
<group value="backend"/>
2020
<group value="mtf_migrated"/>
21+
<skip>
22+
<issueId value="MC-17140"/>
23+
</skip>
2124
</annotations>
2225
<before>
2326
<magentoCLI command="config:set {{MinifyJavaScriptFilesEnableConfigData.path}} {{MinifyJavaScriptFilesEnableConfigData.value}}" stepKey="enableJsMinification"/>

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/TextTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
1010

11+
/**
12+
* Unit test for \Magento\Backend\Block\Widget\Grid\Column\Filter\Text
13+
*/
1114
class TextTest extends \PHPUnit\Framework\TestCase
1215
{
1316
/** @var \Magento\Backend\Block\Widget\Grid\Column\Filter\Text*/
@@ -31,7 +34,10 @@ protected function setUp()
3134
->setMethods(['getEscaper'])
3235
->disableOriginalConstructor()
3336
->getMock();
34-
$this->escaper = $this->createPartialMock(\Magento\Framework\Escaper::class, ['escapeHtml']);
37+
$this->escaper = $this->createPartialMock(
38+
\Magento\Framework\Escaper::class,
39+
['escapeHtml', 'escapeHtmlAttr']
40+
);
3541
$this->helper = $this->createMock(\Magento\Framework\DB\Helper::class);
3642

3743
$this->context->expects($this->once())->method('getEscaper')->willReturn($this->escaper);
@@ -60,6 +66,13 @@ public function testGetHtml()
6066
$this->block->setColumn($column);
6167

6268
$this->escaper->expects($this->any())->method('escapeHtml')->willReturn('escapedHtml');
69+
$this->escaper->expects($this->once())
70+
->method('escapeHtmlAttr')
71+
->willReturnCallback(
72+
function ($string) {
73+
return $string;
74+
}
75+
);
6376
$column->expects($this->any())->method('getId')->willReturn('id');
6477
$column->expects($this->once())->method('getHtmlId')->willReturn('htmlId');
6578

app/code/Magento/Braintree/Test/Mftf/Test/BraintreeCreditCardOnCheckoutTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<waitForPageLoad stepKey="waitForPageLoad"/>
5050
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/>
5151
<waitForPageLoad stepKey="waitForPageLoad1"/>
52+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
5253
<!--Proceed to checkout-->
5354
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup"/>
5455

@@ -74,6 +75,7 @@
7475
<waitForPageLoad stepKey="waitForPageLoad6"/>
7576
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart1"/>
7677
<waitForPageLoad stepKey="waitForPageLoad7"/>
78+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage2"/>
7779
<!--Proceed to checkout-->
7880
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup1"/>
7981
<click selector="{{CheckoutPaymentSection.addressAction('New Address')}}" stepKey="clickOnNewAddress"/>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminOrderConfigureBundleProduct">
12+
<arguments>
13+
<argument name="productName" type="string" defaultValue="{{SimpleProduct.sku}}"/>
14+
<argument name="productNumber" type="string" defaultValue="1"/>
15+
<argument name="productQty" type="string" defaultValue="1"/>
16+
</arguments>
17+
<click selector="{{AdminOrderFormItemsOrderedSection.configureButtonBySku}}" stepKey="clickConfigure"/>
18+
<waitForPageLoad stepKey="waitForConfigurePageLoad"/>
19+
<checkOption selector="{{AdminOrderBundleProductSection.bundleProductCheckbox(productNumber)}}" stepKey="checkProduct"/>
20+
<fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQty"/>
21+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Theme/Test/Mftf/Section/StorefrontFooterSection.xml renamed to app/code/Magento/Bundle/Test/Mftf/Section/AdminOrderBundleProductSection.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11-
<section name="StorefrontFooterSection">
12-
</section>
11+
<section name="AdminOrderBundleProductSection">
12+
<element name="bundleProductCheckbox" type="checkbox" selector="(//input[contains(@class, 'admin__control-checkbox') and contains(@class, 'bundle-option')])[{{productNumber}}]" parameterized="true"/>
13+
</section>
1314
</sections>

app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="openProductPage"/>
9393
<waitForPageLoad stepKey="waitForPageLoad"/>
9494
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart" />
95+
<waitForPageLoad stepKey="waitForAddToCart"/>
96+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
9597
<waitForText userInput="You added $$createSimpleProduct.name$$ to your shopping cart." stepKey="waitForText"/>
9698
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/>
9799
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
namespace Magento\Catalog\Block\Adminhtml\Product\Edit;
1313

14+
/**
15+
* Admin AttributeSet block
16+
*/
1417
class AttributeSet extends \Magento\Backend\Block\Widget\Form
1518
{
1619
/**
@@ -42,12 +45,14 @@ public function __construct(
4245
public function getSelectorOptions()
4346
{
4447
return [
45-
'source' => $this->getUrl('catalog/product/suggestAttributeSets'),
48+
'source' => $this->escapeUrl($this->getUrl('catalog/product/suggestAttributeSets')),
4649
'className' => 'category-select',
4750
'showRecent' => true,
4851
'storageKey' => 'product-template-key',
4952
'minLength' => 0,
50-
'currentlySelected' => $this->_coreRegistry->registry('product')->getAttributeSetId()
53+
'currentlySelected' => $this->escapeHtml(
54+
$this->_coreRegistry->registry('product')->getAttributeSetId()
55+
)
5156
];
5257
}
5358
}

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes;
1313

14+
/**
15+
* Admin product attribute search block
16+
*/
1417
class Search extends \Magento\Backend\Block\Widget
1518
{
1619
/**
@@ -62,13 +65,15 @@ protected function _construct()
6265
}
6366

6467
/**
68+
* Get selector options
69+
*
6570
* @return array
6671
*/
6772
public function getSelectorOptions()
6873
{
6974
$templateId = $this->_coreRegistry->registry('product')->getAttributeSetId();
7075
return [
71-
'source' => $this->getUrl('catalog/product/suggestAttributes'),
76+
'source' => $this->escapeUrl($this->getUrl('catalog/product/suggestAttributes')),
7277
'minLength' => 0,
7378
'ajaxOptions' => ['data' => ['template_id' => $templateId]],
7479
'template' => '[data-template-for="product-attribute-search-' . $this->getGroupId() . '"]',
@@ -110,6 +115,8 @@ public function getSuggestedAttributes($labelPart, $templateId = null)
110115
}
111116

112117
/**
118+
* Get add attribute url
119+
*
113120
* @return string
114121
*/
115122
public function getAddAttributeUrl()

app/code/Magento/Catalog/Block/Product/Gallery.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Magento\Framework\Data\Collection;
1717

1818
/**
19+
* Product gallery block
20+
*
1921
* @api
2022
* @since 100.0.2
2123
*/
@@ -43,6 +45,8 @@ public function __construct(
4345
}
4446

4547
/**
48+
* Prepare layout
49+
*
4650
* @return $this
4751
*/
4852
protected function _prepareLayout()
@@ -52,6 +56,8 @@ protected function _prepareLayout()
5256
}
5357

5458
/**
59+
* Get product
60+
*
5561
* @return Product
5662
*/
5763
public function getProduct()
@@ -60,6 +66,8 @@ public function getProduct()
6066
}
6167

6268
/**
69+
* Get gallery collection
70+
*
6371
* @return Collection
6472
*/
6573
public function getGalleryCollection()
@@ -68,6 +76,8 @@ public function getGalleryCollection()
6876
}
6977

7078
/**
79+
* Get current image
80+
*
7181
* @return Image|null
7282
*/
7383
public function getCurrentImage()
@@ -85,6 +95,8 @@ public function getCurrentImage()
8595
}
8696

8797
/**
98+
* Get image url
99+
*
88100
* @return string
89101
*/
90102
public function getImageUrl()
@@ -93,6 +105,8 @@ public function getImageUrl()
93105
}
94106

95107
/**
108+
* Get image file
109+
*
96110
* @return mixed
97111
*/
98112
public function getImageFile()
@@ -115,7 +129,7 @@ public function getImageWidth()
115129
if ($size[0] > 600) {
116130
return 600;
117131
} else {
118-
return $size[0];
132+
return (int) $size[0];
119133
}
120134
}
121135
}
@@ -124,6 +138,8 @@ public function getImageWidth()
124138
}
125139

126140
/**
141+
* Get previous image
142+
*
127143
* @return Image|false
128144
*/
129145
public function getPreviousImage()
@@ -143,6 +159,8 @@ public function getPreviousImage()
143159
}
144160

145161
/**
162+
* Get next image
163+
*
146164
* @return Image|false
147165
*/
148166
public function getNextImage()
@@ -166,6 +184,8 @@ public function getNextImage()
166184
}
167185

168186
/**
187+
* Get previous image url
188+
*
169189
* @return false|string
170190
*/
171191
public function getPreviousImageUrl()
@@ -178,6 +198,8 @@ public function getPreviousImageUrl()
178198
}
179199

180200
/**
201+
* Get next image url
202+
*
181203
* @return false|string
182204
*/
183205
public function getNextImageUrl()

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public function getAddToCartPostParams(Product $product)
373373
return [
374374
'action' => $url,
375375
'data' => [
376-
'product' => $product->getEntityId(),
376+
'product' => (int) $product->getEntityId(),
377377
ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlHelper->getEncodedUrl($url),
378378
]
379379
];

app/code/Magento/Catalog/Block/Product/View.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,24 +187,25 @@ public function getJsonConfig()
187187
}
188188

189189
$tierPrices = [];
190-
$tierPricesList = $product->getPriceInfo()->getPrice('tier_price')->getTierPriceList();
190+
$priceInfo = $product->getPriceInfo();
191+
$tierPricesList = $priceInfo->getPrice('tier_price')->getTierPriceList();
191192
foreach ($tierPricesList as $tierPrice) {
192-
$tierPrices[] = $tierPrice['price']->getValue();
193+
$tierPrices[] = $tierPrice['price']->getValue() * 1;
193194
}
194195
$config = [
195-
'productId' => $product->getId(),
196+
'productId' => (int)$product->getId(),
196197
'priceFormat' => $this->_localeFormat->getPriceFormat(),
197198
'prices' => [
198199
'oldPrice' => [
199-
'amount' => $product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue(),
200+
'amount' => $priceInfo->getPrice('regular_price')->getAmount()->getValue() * 1,
200201
'adjustments' => []
201202
],
202203
'basePrice' => [
203-
'amount' => $product->getPriceInfo()->getPrice('final_price')->getAmount()->getBaseAmount(),
204+
'amount' => $priceInfo->getPrice('final_price')->getAmount()->getBaseAmount() * 1,
204205
'adjustments' => []
205206
],
206207
'finalPrice' => [
207-
'amount' => $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(),
208+
'amount' => $priceInfo->getPrice('final_price')->getAmount()->getValue() * 1,
208209
'adjustments' => []
209210
]
210211
],

app/code/Magento/Catalog/Block/Product/View/Gallery.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,18 @@ public function getGalleryImagesJson()
137137
$imagesItems = [];
138138
/** @var DataObject $image */
139139
foreach ($this->getGalleryImages() as $image) {
140-
$imageItem = new DataObject([
141-
'thumb' => $image->getData('small_image_url'),
142-
'img' => $image->getData('medium_image_url'),
143-
'full' => $image->getData('large_image_url'),
144-
'caption' => ($image->getLabel() ?: $this->getProduct()->getName()),
145-
'position' => $image->getData('position'),
146-
'isMain' => $this->isMainImage($image),
147-
'type' => str_replace('external-', '', $image->getMediaType()),
148-
'videoUrl' => $image->getVideoUrl(),
149-
]);
140+
$imageItem = new DataObject(
141+
[
142+
'thumb' => $image->getData('small_image_url'),
143+
'img' => $image->getData('medium_image_url'),
144+
'full' => $image->getData('large_image_url'),
145+
'caption' => ($image->getLabel() ?: $this->getProduct()->getName()),
146+
'position' => $image->getData('position'),
147+
'isMain' => $this->isMainImage($image),
148+
'type' => str_replace('external-', '', $image->getMediaType()),
149+
'videoUrl' => $image->getVideoUrl(),
150+
]
151+
);
150152
foreach ($this->getGalleryImagesConfig()->getItems() as $imageConfig) {
151153
$imageItem->setData(
152154
$imageConfig->getData('json_object_key'),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,11 @@
304304
</arguments>
305305
<waitForPageLoad stepKey="waitForPageLoad"/>
306306
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/>
307+
<waitForPageLoad stepKey="waitForAdvancedPricingModal"/>
307308
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitSpecialPrice"/>
308309
<fillField userInput="{{price}}" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/>
309310
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/>
311+
<waitForPageLoad stepKey="waitForAdvancedPricingModalGone"/>
310312
<waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/>
311313
</actionGroup>
312314

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256

257257
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
258258
<click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickChangeStatusAction"/>
259-
<click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled" parameterized="true"/>
259+
<click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled"/>
260260
<waitForPageLoad stepKey="waitForStatusToBeChanged"/>
261261
<see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) have been updated." stepKey="seeSuccessMessage"/>
262262
<waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/>

0 commit comments

Comments
 (0)