Skip to content

Commit 3a88db7

Browse files
committed
Merge branch '2.3-develop' into 2.3-develop-pr13
2 parents 548e4e1 + 25fb501 commit 3a88db7

File tree

33 files changed

+902
-56
lines changed

33 files changed

+902
-56
lines changed

app/code/Magento/Authorizenet/Model/Directpost.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ protected function processOrder(\Magento\Sales\Model\Order $order)
707707
//decline the order (in case of wrong response code) but don't return money to customer.
708708
$message = $e->getMessage();
709709
$this->declineOrder($order, $message, false);
710+
710711
throw $e;
711712
}
712713

@@ -777,7 +778,7 @@ protected function processPaymentFraudStatus(\Magento\Sales\Model\Order\Payment
777778
}
778779

779780
/**
780-
* Add status comment
781+
* Add status comment to history
781782
*
782783
* @param \Magento\Sales\Model\Order\Payment $payment
783784
* @return $this
@@ -832,6 +833,7 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = ''
832833
->void($response);
833834
}
834835
$order->registerCancellation($message)->save();
836+
$this->_eventManager->dispatch('order_cancel_after', ['order' => $order ]);
835837
} catch (\Exception $e) {
836838
//quiet decline
837839
$this->getPsrLogger()->critical($e);
@@ -866,7 +868,7 @@ public function getConfigInterface()
866868
* Getter for specified value according to set payment method code
867869
*
868870
* @param mixed $key
869-
* @param int|string|null|\Magento\Store\Model\Store $storeId
871+
* @param mixed $storeId
870872
* @return mixed
871873
*/
872874
public function getValue($key, $storeId = null)
@@ -930,7 +932,7 @@ public function fetchTransactionInfo(\Magento\Payment\Model\InfoInterface $payme
930932
}
931933

932934
/**
933-
* Add statuc comment on update.
935+
* Add status comment on update
934936
*
935937
* @param \Magento\Sales\Model\Order\Payment $payment
936938
* @param \Magento\Framework\DataObject $response

app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/SaveHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ private function getAdditionalFields(array $objectArray): array
135135
* Check whether price has percentage value.
136136
*
137137
* @param array $priceRow
138-
* @return int|null
138+
* @return float|null
139139
*/
140-
private function getPercentage(array $priceRow): ?int
140+
private function getPercentage(array $priceRow): ?float
141141
{
142142
return isset($priceRow['percentage_value']) && is_numeric($priceRow['percentage_value'])
143-
? (int)$priceRow['percentage_value']
143+
? (float)$priceRow['percentage_value']
144144
: null;
145145
}
146146

app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ private function getAdditionalFields(array $objectArray): array
138138
* Check whether price has percentage value.
139139
*
140140
* @param array $priceRow
141-
* @return int|null
141+
* @return float|null
142142
*/
143-
private function getPercentage(array $priceRow): ?int
143+
private function getPercentage(array $priceRow): ?float
144144
{
145145
return isset($priceRow['percentage_value']) && is_numeric($priceRow['percentage_value'])
146-
? (int)$priceRow['percentage_value']
146+
? (float)$priceRow['percentage_value']
147147
: null;
148148
}
149149

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,17 @@
192192
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/>
193193
</actionGroup>
194194

195+
<actionGroup name="deleteProductByName" extends="deleteProductBySku">
196+
<arguments>
197+
<argument name="sku" type="string" defaultValue=""/>
198+
<argument name="name" type="string"/>
199+
</arguments>
200+
<remove keyForRemoval="fillProductSkuFilter"/>
201+
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductSkuFilter" after="openProductFilters"/>
202+
<remove keyForRemoval="seeProductSkuInGrid"/>
203+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{name}}" stepKey="seeProductNameInGrid" after="clickApplyFilters"/>
204+
</actionGroup>
205+
195206
<!--Open product for edit by clicking row X and column Y in product grid-->
196207
<actionGroup name="openProducForEditByClickingRowXColumnYInProductGrid">
197208
<arguments>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@
181181
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
182182
<requiredEntity type="custom_attribute">CustomAttributeProductUrlKey</requiredEntity>
183183
</entity>
184+
<entity name="SetProductVisibilityHidden" type="product2">
185+
<data key="visibility">1</data>
186+
</entity>
184187
<entity name="ProductImage" type="uploadImage">
185188
<data key="title" unique="suffix">Image1</data>
186189
<data key="price">1.00</data>
@@ -477,4 +480,8 @@
477480
<requiredEntity type="product_extension_attribute">EavStock1</requiredEntity>
478481
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
479482
</entity>
483+
<entity name="ProductWithLongNameSku" extends="ApiSimpleProduct">
484+
<data key="name" unique="suffix">Product With Long Name And Sku - But not too long</data>
485+
<data key="sku" unique="suffix">Product With Long Name And Sku - But not too long</data>
486+
</entity>
480487
</entities>

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,56 @@
269269
<actualResult type="variable">grabTextFromMiniCartSubtotalField2</actualResult>
270270
</assertEquals>
271271
</test>
272+
<test name="AdminApplyTierPriceToProductWithPercentageDiscountTest">
273+
<annotations>
274+
<features value="Catalog"/>
275+
<stories value="MC-5517 - System tries to save 0 in Advanced Pricing which is invalid for Discount field"/>
276+
<title value="You should be able to apply tier price to a product with float percent discount."/>
277+
<description value="You should be able to apply tier price to a product with float percent discount."/>
278+
<severity value="AVERAGE"/>
279+
<testCaseId value="MAGETWO-96881"/>
280+
<group value="product"/>
281+
</annotations>
282+
<before>
283+
<createData entity="_defaultCategory" stepKey="createCategory"/>
284+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
285+
<requiredEntity createDataKey="createCategory"/>
286+
<field key="price">100</field>
287+
</createData>
288+
</before>
289+
<after>
290+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
291+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
292+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
293+
<waitForPageLoad time="30" stepKey="waitForProductIndexPageLoad"/>
294+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/>
295+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
296+
</after>
297+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
298+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
299+
<argument name="product" value="$$createSimpleProduct$$"/>
300+
</actionGroup>
301+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1">
302+
<argument name="product" value="$$createSimpleProduct$$"/>
303+
</actionGroup>
304+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
305+
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
306+
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/>
307+
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercent"/>
308+
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" userInput="1" stepKey="fillProductTierPriceQtyInput"/>
309+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="Discount" stepKey="selectProductTierPriceValueType"/>
310+
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="0.1" stepKey="selectProductTierPricePriceInput"/>
311+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
312+
<actionGroup ref="saveProductForm" stepKey="saveProduct1"/>
313+
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="goProductPageOnStorefront"/>
314+
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
315+
<seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceProductPage"/>
316+
<seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceProductPage"/>
317+
<seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountProductPage"/>
318+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/>
319+
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>
320+
<seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceCategoryPage"/>
321+
<seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabelCategoryPage"/>
322+
<seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountCategoryPage"/>
323+
</test>
272324
</tests>

app/code/Magento/Checkout/CustomerData/Cart.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function __construct(
8282
}
8383

8484
/**
85-
* {@inheritdoc}
85+
* @inheritdoc
8686
*/
8787
public function getSectionData()
8888
{
@@ -158,11 +158,10 @@ protected function getRecentItems()
158158
: $item->getProduct();
159159

160160
$products = $this->catalogUrl->getRewriteByProductStore([$product->getId() => $item->getStoreId()]);
161-
if (!isset($products[$product->getId()])) {
162-
continue;
161+
if (isset($products[$product->getId()])) {
162+
$urlDataObject = new \Magento\Framework\DataObject($products[$product->getId()]);
163+
$item->getProduct()->setUrlDataObject($urlDataObject);
163164
}
164-
$urlDataObject = new \Magento\Framework\DataObject($products[$product->getId()]);
165-
$item->getProduct()->setUrlDataObject($urlDataObject);
166165
}
167166
$items[] = $this->itemPoolInterface->getItemData($item);
168167
}

app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>
2222
</actionGroup>
2323

24+
<!-- Go to checkout from cart -->
25+
<actionGroup name="GoToCheckoutFromCartActionGroup">
26+
<waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity" />
27+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/>
28+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
29+
<seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertCheckoutCartUrl"/>
30+
<click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/>
31+
</actionGroup>
32+
2433
<!-- Guest checkout filling shipping section -->
2534
<actionGroup name="GuestCheckoutFillingShippingSectionActionGroup">
2635
<arguments>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="CheckNotVisibleProductInMinicartTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="MAGETWO-96422: Hidden Products are absent in Storefront Mini-Cart" />
15+
<title value="Not visible individually product in mini-shopping cart."/>
16+
<description value="To be sure that product in mini-shopping cart remains visible after admin makes it not visible individually"/>
17+
<severity value="MAJOR"/>
18+
<group value="checkout"/>
19+
</annotations>
20+
21+
<!--Create simple product1 and simple product2-->
22+
<createData entity="SimpleTwo" stepKey="createSimpleProduct1"/>
23+
<createData entity="SimpleTwo" stepKey="createSimpleProduct2"/>
24+
25+
<!--Go to simple product1 page-->
26+
<amOnPage url="$$createSimpleProduct1.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage1"/>
27+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
28+
29+
<!--Add simple product1 to Shopping Cart-->
30+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage1">
31+
<argument name="productName" value="$$createSimpleProduct1.name$$"/>
32+
</actionGroup>
33+
34+
<!--Check simple product1 in minicart-->
35+
<comment userInput="Check simple product 1 in minicart" stepKey="commentCheckSimpleProduct1InMinicart" after="addToCartFromStorefrontProductPage1"/>
36+
<actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertProduct1NameInMiniCart">
37+
<argument name="productName" value="$$createSimpleProduct1.name$$"/>
38+
</actionGroup>
39+
40+
<!--Make simple product1 not visible individually-->
41+
<updateData entity="SetProductVisibilityHidden" createDataKey="createSimpleProduct1" stepKey="updateSimpleProduct1">
42+
<requiredEntity createDataKey="createSimpleProduct1"/>
43+
</updateData>
44+
45+
<!--Go to simple product2 page-->
46+
<amOnPage url="$$createSimpleProduct2.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage2"/>
47+
<waitForPageLoad stepKey="waitForCatalogPageLoad2"/>
48+
49+
<!--Add simple product2 to Shopping Cart for updating cart items-->
50+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2">
51+
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
52+
</actionGroup>
53+
54+
<!--Check simple product1 in minicart-->
55+
<comment userInput="Check hidden simple product 1 in minicart" stepKey="commentCheckHiddenSimpleProduct1InMinicart" after="addToCartFromStorefrontProductPage2"/>
56+
<actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertHiddenProduct1NameInMiniCart">
57+
<argument name="productName" value="$$createSimpleProduct1.name$$"/>
58+
</actionGroup>
59+
60+
<!--Check simple product2 in minicart-->
61+
<comment userInput="Check hidden simple product 2 in minicart" stepKey="commentCheckSimpleProduct2InMinicart" after="addToCartFromStorefrontProductPage2"/>
62+
<actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertProduct2NameInMiniCart">
63+
<argument name="productName" value="$$createSimpleProduct2.name$$"/>
64+
</actionGroup>
65+
66+
<!--Delete simple product1 and simple product2-->
67+
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteProduct1"/>
68+
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteProduct2"/>
69+
</test>
70+
</tests>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
<actionGroup ref="logout" stepKey="logout"/>
3434
<deleteData createDataKey="simpleproduct1" stepKey="deleteProduct1"/>
3535
<deleteData createDataKey="simplecategory" stepKey="deleteCategory"/>
36-
<deleteData createDataKey="simpleuscustomer" stepKey="deleteCustomer"/>
3736
</after>
3837

3938
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,25 @@
6969
<see selector="{{AdminOrderDetailsInformationSection.shippingAddress}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="seeAdminOrderShippingAddress"/>
7070
<see selector="{{AdminOrderDetailsInformationSection.itemsOrdered}}" userInput="$$createProduct.name$$" stepKey="seeAdminOrderProduct"/>
7171
</test>
72+
<test name="StorefrontGuestCheckoutWithSidebarDisabledTest" extends="StorefrontGuestCheckoutTest">
73+
<annotations>
74+
<features value="Checkout"/>
75+
<stories value="Checkout via Guest Checkout"/>
76+
<title value="Guest Checkout when Cart sidebar disabled"/>
77+
<description value="Should be able to place an order as a Guest when Cart sidebar is disabled"/>
78+
<severity value="CRITICAL"/>
79+
<testCaseId value="MAGETWO-97001"/>
80+
<group value="checkout"/>
81+
</annotations>
82+
<before>
83+
<magentoCLI stepKey="disableSidebar" command="config:set checkout/sidebar/display 0" />
84+
</before>
85+
<after>
86+
<magentoCLI stepKey="enableSidebar" command="config:set checkout/sidebar/display 1" />
87+
</after>
88+
<remove keyForRemoval="guestGoToCheckoutFromMinicart" />
89+
<actionGroup ref="GoToCheckoutFromCartActionGroup" stepKey="guestGoToCheckoutFromCart" after="seeCartQuantity" />
90+
</test>
7291
<test name="StorefrontGuestCheckoutTestWithRestrictedCountriesForPayment">
7392
<annotations>
7493
<features value="Checkout"/>

app/code/Magento/Checkout/view/frontend/templates/cart/minicart.phtml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141
</div>
4242
<?= $block->getChildHtml('minicart.addons') ?>
4343
</div>
44+
<?php else: ?>
45+
<script>
46+
require(['jquery'], function ($) {
47+
$('a.action.showcart').click(function() {
48+
$(document.body).trigger('processStart');
49+
});
50+
});
51+
</script>
4452
<?php endif ?>
4553
<script>
4654
window.checkout = <?= /* @escapeNotVerified */ $block->getSerializedConfig() ?>;

app/code/Magento/Config/Model/Config/Structure.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ protected function _getGroupFieldPathsByAttribute(array $fields, $parentPath, $a
337337
/**
338338
* Collects config paths and their structure paths from configuration files.
339339
* Returns the map of config paths and their structure paths.
340-
*
341340
* All paths are declared in module's system.xml.
342341
*
343342
* ```xml
@@ -394,7 +393,7 @@ private function getFieldsRecursively(array $elements = [])
394393

395394
foreach ($elements as $element) {
396395
if (isset($element['children'])) {
397-
$result = array_replace_recursive(
396+
$result = array_merge_recursive(
398397
$result,
399398
$this->getFieldsRecursively($element['children'])
400399
);

app/code/Magento/Config/Test/Unit/Model/Config/StructureTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ public function testGetFieldPaths()
418418
'field_2'
419419
],
420420
'field_3' => [
421+
'field_3',
421422
'field_3'
422423
],
423424
'field_3_1' => [

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/>
106106
</actionGroup>
107107

108-
<actionGroup name="createConfigurationsForAttribute">
108+
<actionGroup name="generateConfigurationsByAttributeCode">
109109
<arguments>
110110
<argument name="attributeCode" type="string" defaultValue="SomeString"/>
111111
</arguments>
@@ -121,6 +121,12 @@
121121
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/>
122122
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/>
123123
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/>
124+
</actionGroup>
125+
126+
<actionGroup name="createConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode">
127+
<arguments>
128+
<argument name="attributeCode" type="string" defaultValue="SomeString"/>
129+
</arguments>
124130
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/>
125131
<click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/>
126132
</actionGroup>

0 commit comments

Comments
 (0)