Skip to content

Commit 9845b2b

Browse files
authored
Merge pull request #3465 from magento-epam/EPAM-PR-19
Fixed issues: MAGETWO-62728 My Wishlist - quantity input box issue MAGETWO-91658 Wrong Checkout Totals Sort Order in cart MAGETWO-71022 After return "RMA" is complete in Admin, "remaining quantity" in customer account shows incorrect value MAGETWO-91537 [2.3] Search synonyms results missing for words including hyphen and numbers MAGETWO-91725 Reward Points Balance Update Emails are not being sent when balance change initiated by store front MAGETWO-91707 [Sigma Beauty]Cannot pause Youtube video in IE 11 MAGETWO-91596 Making order in admin with grouped product by adding it by sku with empty qty field leads to unability to order MAGETWO-91784 On Payment screen using Credit Card checkout, up and down arrow key allow to add -ve numbers also.. MAGETWO-91496 Instantiating WYSIWYG in DynamicRows MAGETWO-91651 Navigation Menu problem on Mobile theme
2 parents 7610692 + 3d1ad62 commit 9845b2b

File tree

23 files changed

+317
-62
lines changed

23 files changed

+317
-62
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@
158158
<see userInput="${{total}}" selector="{{CheckoutPaymentSection.orderSummaryTotal}}" stepKey="assertTotal"/>
159159
</actionGroup>
160160

161+
<actionGroup name="CheckTotalsSortOrderInSummarySection">
162+
<arguments>
163+
<argument name="elementName" type="string"/>
164+
<argument name="positionNumber" type="integer"/>
165+
</arguments>
166+
<see userInput="{{elementName}}" selector="{{CheckoutCartSummarySection.elementPosition(positionNumber)}}" stepKey="assertElementPosition"/>
167+
</actionGroup>
168+
161169
<!-- Check ship to information in checkout -->
162170
<actionGroup name="CheckShipToInformationInCheckoutActionGroup">
163171
<arguments>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="CheckoutCartSummarySection">
12+
<element name="elementPosition" type="text" selector=".data.table.totals > tbody tr:nth-of-type({{value}}) > th" parameterized="true"/>
1213
<element name="subtotal" type="text" selector="//*[@id='cart-totals']//tr[@class='totals sub']//td//span[@class='price']"/>
1314
<element name="shippingMethodForm" type="text" selector="#co-shipping-method-form"/>
1415
<element name="shippingMethod" type="text" selector="//*[@id='cart-totals']//tr[@class='totals shipping excl']//th//span[@class='value']"/>

app/code/Magento/Customer/Model/Metadata/CustomerMetadata.php

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,30 @@ class CustomerMetadata implements CustomerMetadataInterface
3333
*/
3434
private $attributeMetadataDataProvider;
3535

36+
/**
37+
* List of system attributes which should be available to the clients.
38+
*
39+
* @var string[]
40+
*/
41+
private $systemAttributes;
42+
3643
/**
3744
* @param AttributeMetadataConverter $attributeMetadataConverter
3845
* @param AttributeMetadataDataProvider $attributeMetadataDataProvider
46+
* @param string[] $systemAttributes
3947
*/
4048
public function __construct(
4149
AttributeMetadataConverter $attributeMetadataConverter,
42-
AttributeMetadataDataProvider $attributeMetadataDataProvider
50+
AttributeMetadataDataProvider $attributeMetadataDataProvider,
51+
array $systemAttributes = []
4352
) {
4453
$this->attributeMetadataConverter = $attributeMetadataConverter;
4554
$this->attributeMetadataDataProvider = $attributeMetadataDataProvider;
55+
$this->systemAttributes = $systemAttributes;
4656
}
4757

4858
/**
49-
* {@inheritdoc}
59+
* @inheritdoc
5060
*/
5161
public function getAttributes($formCode)
5262
{
@@ -67,7 +77,7 @@ public function getAttributes($formCode)
6777
}
6878

6979
/**
70-
* {@inheritdoc}
80+
* @inheritdoc
7181
*/
7282
public function getAttributeMetadata($attributeCode)
7383
{
@@ -92,7 +102,7 @@ public function getAttributeMetadata($attributeCode)
92102
}
93103

94104
/**
95-
* {@inheritdoc}
105+
* @inheritdoc
96106
*/
97107
public function getAllAttributesMetadata()
98108
{
@@ -116,7 +126,7 @@ public function getAllAttributesMetadata()
116126
}
117127

118128
/**
119-
* {@inheritdoc}
129+
* @inheritdoc
120130
*/
121131
public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_INTERFACE_NAME)
122132
{
@@ -134,9 +144,10 @@ public function getCustomAttributesMetadata($dataObjectClassName = self::DATA_IN
134144
$isDataObjectMethod = isset($this->customerDataObjectMethods['get' . $camelCaseKey])
135145
|| isset($this->customerDataObjectMethods['is' . $camelCaseKey]);
136146

137-
/** Even though disable_auto_group_change is system attribute, it should be available to the clients */
138147
if (!$isDataObjectMethod
139-
&& (!$attributeMetadata->isSystem() || $attributeCode == 'disable_auto_group_change')
148+
&& (!$attributeMetadata->isSystem()
149+
|| in_array($attributeCode, $this->systemAttributes)
150+
)
140151
) {
141152
$customAttributes[] = $attributeMetadata;
142153
}

app/code/Magento/Customer/etc/di.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@
127127
<argument name="groupManagement" xsi:type="object">Magento\Customer\Api\GroupManagementInterface\Proxy</argument>
128128
</arguments>
129129
</type>
130+
<type name="Magento\Customer\Model\Metadata\CustomerMetadata">
131+
<arguments>
132+
<argument name="systemAttributes" xsi:type="array">
133+
<item name="disable_auto_group_change" xsi:type="string">disable_auto_group_change</item>
134+
</argument>
135+
</arguments>
136+
</type>
130137
<virtualType name="SectionInvalidationConfigReader" type="Magento\Framework\Config\Reader\Filesystem">
131138
<arguments>
132139
<argument name="idAttributes" xsi:type="array">

app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ define([
3636
return resultWrapper(null, false, false);
3737
}
3838

39-
value = value.replace(/\-|\s/g, '');
39+
value = value.replace(/|\s/g, '');
4040

4141
if (!/^\d*$/.test(value)) {
4242
return resultWrapper(null, false, false);

app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/validator.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
}(function ($, cvvValidator, creditCardNumberValidator, yearValidator, monthValidator, creditCardData) {
2424
'use strict';
2525

26+
$('.payment-method-content input[type="number"]').on('keyup', function () {
27+
if ($(this).val() < 0) {
28+
$(this).val($(this).val().replace(/^-/, ''));
29+
}
30+
});
31+
2632
$.each({
2733
'validate-card-type': [
2834
function (number, item, allowedTypes) {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,9 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontProductInfoMainSection">
1212
<element name="productVideo" type="text" selector="//*[@class='product-video' and @data-type='{{videoType}}']" parameterized="true"/>
13+
<element name="clickInVideo" type="video" selector="//*[@class='fotorama__stage__shaft']"/>
14+
<element name="videoPausedMode" type="video" selector="//*[contains(@class, 'paused-mode')]"/>
15+
<element name="videoPlayedMode" type="video" selector="//*[contains(@class,'playing-mode')]"/>
16+
<element name="frameVideo" type="video" selector="widget2"/>
1317
</section>
1418
</sections>
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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="YoutubeVideoWindowOnProductPageTest">
12+
<annotations>
13+
<features value="ProductVideo"/>
14+
<stories value="MAGETWO-91707: [Sigma Beauty]Cannot pause Youtube video in IE 11"/>
15+
<testCaseId value="MAGETWO-95254"/>
16+
<title value="Youtube video window on the product page"/>
17+
<description value="Check Youtube video window on the product page"/>
18+
<severity value="MAJOR"/>
19+
<group value="ProductVideo"/>
20+
</annotations>
21+
22+
<before>
23+
<!--Log In-->
24+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
25+
<!--Create category-->
26+
<createData entity="_defaultCategory" stepKey="createCategory"/>
27+
<!--Create product-->
28+
<createData entity="SimpleProduct" stepKey="createProduct">
29+
<requiredEntity createDataKey="createCategory"/>
30+
</createData>
31+
<!-- Set product video Youtube api key configuration -->
32+
<createData entity="ProductVideoYoutubeApiKeyConfig" stepKey="setStoreConfig" after="loginAsAdmin"/>
33+
</before>
34+
35+
<!--Open simple product-->
36+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/>
37+
<waitForPageLoad stepKey="wait1"/>
38+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/>
39+
<actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku">
40+
<argument name="product" value="$$createProduct$$"/>
41+
</actionGroup>
42+
<actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openFirstProductForEdit"/>
43+
44+
<!-- Add product video -->
45+
<actionGroup ref="addProductVideo" stepKey="addProductVideo" after="openFirstProductForEdit"/>
46+
<!-- Assert product video in admin product form -->
47+
<actionGroup ref="assertProductVideoAdminProductPage" stepKey="assertProductVideoAdminProductPage" after="addProductVideo"/>
48+
49+
<!-- Save the product -->
50+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveFirstProduct"/>
51+
<waitForPageLoad stepKey="waitForFirstProductSaved"/>
52+
53+
<!-- Assert product video in storefront product page -->
54+
<amOnPage url="$$createProduct.name$$.html" stepKey="goToStorefrontCategoryPage"/>
55+
<waitForPageLoad stepKey="waitForStorefrontPageLoaded"/>
56+
<actionGroup ref="assertProductVideoStorefrontProductPage" stepKey="assertProductVideoStorefrontProductPage" after="waitForStorefrontPageLoaded"/>
57+
58+
<!--Click Play video button-->
59+
<click stepKey="clickToPlayVideo" selector="{{StorefrontProductInfoMainSection.clickInVideo}}"/>
60+
<wait stepKey="waitFiveSecondToPlayVideo" time="5"/>
61+
<switchToIFrame selector="{{StorefrontProductInfoMainSection.frameVideo}}" stepKey="switchToFrame"/>
62+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.videoPlayedMode}}" stepKey="waitForVideoPlayed"/>
63+
<seeElement selector="{{StorefrontProductInfoMainSection.videoPlayedMode}}" stepKey="AssertVideoIsPlayed"/>
64+
<switchToIFrame stepKey="switchBack1"/>
65+
66+
<!--Click Pause button-->
67+
<click stepKey="clickToStopVideo" selector="{{StorefrontProductInfoMainSection.clickInVideo}}"/>
68+
<wait stepKey="waitFiveSecondToStopVideo" time="5"/>
69+
<switchToIFrame selector="{{StorefrontProductInfoMainSection.frameVideo}}" stepKey="switchToFrame2"/>
70+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.videoPausedMode}}" stepKey="waitForVideoPaused"/>
71+
<seeElement selector="{{StorefrontProductInfoMainSection.videoPausedMode}}" stepKey="AssertVideoIsPaused"/>
72+
<switchToIFrame stepKey="switchBack2"/>
73+
74+
<!--Click Play video button again. Make sure that Video continued playing-->
75+
<click stepKey="clickAgainToPlayVideo" selector="{{StorefrontProductInfoMainSection.clickInVideo}}"/>
76+
<wait stepKey="waitAgainFiveSecondToPlayVideo" time="5"/>
77+
<switchToIFrame selector="{{StorefrontProductInfoMainSection.frameVideo}}" stepKey="switchToFrame3"/>
78+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.videoPlayedMode}}" stepKey="waitForVideoPlayedAgain"/>
79+
<seeElement selector="{{StorefrontProductInfoMainSection.videoPlayedMode}}" stepKey="AssertVideoIsPlayedAgain"/>
80+
<switchToIFrame stepKey="switchBack3"/>
81+
82+
<after>
83+
<deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/>
84+
<deleteData createDataKey="createCategory" stepKey="deleteCategoryFirst"/>
85+
<!-- Set product video configuration to default -->
86+
<createData entity="DefaultProductVideoConfig" stepKey="setStoreDefaultConfig" before="logout"/>
87+
<!--Log Out-->
88+
<actionGroup ref="logout" stepKey="logout"/>
89+
</after>
90+
</test>
91+
</tests>
92+

app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,16 @@
3838
</arguments>
3939
<see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/>
4040
</actionGroup>
41+
42+
<actionGroup name="goToInvoiceIntoOrder">
43+
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/>
44+
<seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/>
45+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/>
46+
</actionGroup>
47+
48+
<actionGroup name="submitInvoiceIntoOrder">
49+
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
50+
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPageInvoice"/>
51+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/>
52+
</actionGroup>
4153
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="email" type="input" selector="#email"/>
1414
<element name="requiredGroup" type="text" selector=".admin__field.required[data-ui-id='billing-address-fieldset-element-form-field-group-id']"/>
1515
<element name="requiredEmail" type="text" selector=".admin__field.required[data-ui-id='billing-address-fieldset-element-form-field-email']"/>
16+
<element name="defaultGeneral" type="text" selector="//*[contains(text(),'General')]" time="15"/>
1617
</section>
1718
</sections>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminOrderFormItemsOrderedSection">
12+
<element name="addProductsBySku" type="button" selector="//section[@id='order-items']//span[contains(text(),'Add Products By SKU')]"/>
13+
<element name="configureButtonBySku" type="button" selector="//div[@class='sku-configure-button']//span[contains(text(),'Configure')]"/>
14+
<element name="configureProductOk" type="button" selector="//div[@class='page-main-actions']//span[contains(text(),'OK')]"/>
15+
<element name="configureProductQtyField" type="input" selector="//*[@id='super-product-table']/tbody/tr[{{arg}}]/td[5]/input[1]" parameterized="true"/>
16+
<element name="addProductToOrder" type="input" selector="//*[@title='Add Products to Order']"/>
17+
<element name="itemsOrderedSummaryText" type="textarea" selector="//table[@class='data-table admin__table-primary order-tables']/tfoot/tr"/>
18+
</section>
19+
</sections>

app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,35 @@
3939
<requiredEntity type="SalesRuleLabel">SalesRuleLabelStore1</requiredEntity>
4040
</entity>
4141

42+
<entity name="ApiCartRule" type="SalesRule">
43+
<data key="name" unique="suffix">salesRule</data>
44+
<data key="description">Sales Rule Descritpion</data>
45+
<array key="website_ids">
46+
<item>1</item>
47+
</array>
48+
<array key="customer_group_ids">
49+
<item>0</item>
50+
<item>1</item>
51+
<item>3</item>
52+
</array>
53+
<data key="uses_per_customer">0</data>
54+
<data key="is_active">true</data>
55+
<data key="stop_rules_processing">true</data>
56+
<data key="is_advanced">true</data>
57+
<data key="sort_order">0</data>
58+
<data key="simple_action">by_percent</data>
59+
<data key="discount_amount">50</data>
60+
<data key="discount_qty">0</data>
61+
<data key="discount_step">0</data>
62+
<data key="apply_to_shipping">false</data>
63+
<data key="times_used">0</data>
64+
<data key="is_rss">true</data>
65+
<data key="coupon_type">NO_COUPON</data>
66+
<data key="use_auto_generation">false</data>
67+
<data key="uses_per_coupon">0</data>
68+
<data key="simple_free_shipping">0</data>
69+
</entity>
70+
4271
<entity name="SimpleSalesRule" type="SalesRule">
4372
<data key="name" unique="suffix">SimpleSalesRule</data>
4473
<data key="is_active">true</data>

app/code/Magento/SalesRule/view/frontend/layout/checkout_cart_index.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@
1313
<item name="components" xsi:type="array">
1414
<item name="block-totals" xsi:type="array">
1515
<item name="children" xsi:type="array">
16-
<item name="before_grandtotal" xsi:type="array">
17-
<item name="children" xsi:type="array">
18-
<item name="discount" xsi:type="array">
19-
<item name="component" xsi:type="string">Magento_SalesRule/js/view/cart/totals/discount</item>
20-
<item name="config" xsi:type="array">
21-
<item name="title" xsi:type="string" translate="true">Discount</item>
22-
</item>
23-
</item>
16+
<item name="discount" xsi:type="array">
17+
<item name="component" xsi:type="string">Magento_SalesRule/js/view/cart/totals/discount</item>
18+
<item name="config" xsi:type="array">
19+
<item name="title" xsi:type="string" translate="true">Discount</item>
2420
</item>
2521
</item>
2622
</item>

app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminShipmentActionGroup.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,16 @@
3535
</arguments>
3636
<see selector="{{AdminShipmentItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/>
3737
</actionGroup>
38+
39+
<actionGroup name="goToShipmentIntoOrder">
40+
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
41+
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="seeOrderShipmentUrl"/>
42+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Shipment" stepKey="seePageNameNewInvoicePage"/>
43+
</actionGroup>
44+
45+
<actionGroup name="submitShipmentIntoOrder">
46+
<click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/>
47+
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPageShipping"/>
48+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="seeShipmentCreateSuccess"/>
49+
</actionGroup>
3850
</actionGroups>

app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Column/Cart.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace Magento\Wishlist\Block\Customer\Wishlist\Item\Column;
88

9+
use Magento\Catalog\Controller\Adminhtml\Product\Initialization\StockDataFilter;
10+
911
/**
1012
* Wishlist block customer item cart column
1113
*
@@ -35,4 +37,28 @@ public function getProductItem()
3537
{
3638
return $this->getItem()->getProduct();
3739
}
40+
41+
/**
42+
* Get min and max qty for wishlist form.
43+
*
44+
* @return array
45+
*/
46+
public function getMinMaxQty()
47+
{
48+
$stockItem = $this->stockRegistry->getStockItem(
49+
$this->getItem()->getProduct()->getId(),
50+
$this->getItem()->getProduct()->getStore()->getWebsiteId()
51+
);
52+
53+
$params = [];
54+
55+
$params['minAllowed'] = (float)$stockItem->getMinSaleQty();
56+
if ($stockItem->getMaxSaleQty()) {
57+
$params['maxAllowed'] = (float)$stockItem->getMaxSaleQty();
58+
} else {
59+
$params['maxAllowed'] = (float)StockDataFilter::MAX_QTY_VALUE;
60+
}
61+
62+
return $params;
63+
}
3864
}

0 commit comments

Comments
 (0)