Skip to content

Commit dc9ff50

Browse files
committed
Merge branch 'jquery-upgrade' of github.com:magento-lynx/magento2ce into MC-42049_fix_keydown_and_keyup
2 parents f4e745c + 84a457b commit dc9ff50

File tree

18 files changed

+541
-63
lines changed

18 files changed

+541
-63
lines changed

app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ define([
4747
closed: function () {
4848
var doc = self.iframe.get(0).document;
4949

50-
if (doc && $.isFunction(doc.execCommand)) {
50+
if (doc && typeof doc.execCommand === 'function') {
5151
//IE9 break script loading but not execution on iframe removing
5252
doc.execCommand('stop');
5353
self.iframe.remove();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
11+
<actionGroup name="StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup">
12+
<annotations>
13+
<description>
14+
Assert that the MAP message is present on the product listing in the cart, and What's this? link is clickable and bring up the info popup.
15+
</description>
16+
</annotations>
17+
<!-- Confirm that the MAP message and help link are visible -->
18+
<see selector="{{StorefrontCartMapSection.mapNotice}}" userInput="See price before order confirmation." stepKey="seeMsrpNotice"/>
19+
<see selector="{{StorefrontCartMapSection.mapWhatsThis}}" userInput="What's this?" stepKey="seeMsrpNoticeHelpLink"/>
20+
<!-- Confirm that clicking on the 'What's this?' link shows the help popup -->
21+
<click selector="{{StorefrontCartMapSection.mapWhatsThis}}" stepKey="clickOnWhatsThisLink"/>
22+
<waitForElementVisible selector="{{StorefrontCartMapSection.mapWhatsThisPopup}}" stepKey="waitForTheInfoMessage"/>
23+
<!-- Confirm that clicking on X button closes the popup -->
24+
<click selector="{{StorefrontCartMapSection.mapWhatsThisPopupClose}}" stepKey="clickOnCloseInfoMessage"/>
25+
<waitForElementNotVisible selector="{{StorefrontCartMapSection.mapWhatsThisPopup}}" stepKey="waitForTheInfoMessageToClose"/>
26+
</actionGroup>
27+
</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="StorefrontCartMapSection">
12+
<element name="mapNotice" type="text" selector=".msrp.notice"/>
13+
<element name="mapWhatsThis" type="text" selector=".msrp .action.help.map"/>
14+
<element name="mapWhatsThisPopup" type="text" selector="//div[@id='map-popup-text-what-this']"/>
15+
<element name="mapWhatsThisPopupClose" type="text" selector=".popup button.action.close"/>
16+
</section>
17+
</sections>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="StorefrontVerifyMapMessagePopupOnCartViewPageTest">
10+
<annotations>
11+
<stories value="Shopping Cart"/>
12+
<features value="Checkout"/>
13+
<title value="Minimum Advertised Price 'What's this?' popup does not displays in cart"/>
14+
<description value="When Minimum Advertised Price (MAP) is enabled and the product has MAP set in Advanced Pricing, click on 'What's this?' at the product listing in the shopping cart must display the popup with the info message."/>
15+
<testCaseId value="MC-41596"/>
16+
<useCaseId value="MC-41494"/>
17+
<severity value="MAJOR"/>
18+
<group value="shoppingCart"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<!-- Enable MAP functionality in Magento Instance -->
23+
<createData entity="MsrpEnableMAP" stepKey="enableMAP"/>
24+
<!-- Create product and category -->
25+
<createData entity="_defaultCategory" stepKey="category"/>
26+
<createData entity="SimpleProduct" stepKey="product">
27+
<requiredEntity createDataKey="category"/>
28+
</createData>
29+
</before>
30+
<after>
31+
<!-- Disable MAP functionality in Magento Instance -->
32+
<createData entity="MsrpDisableMAP" stepKey="disableMAP"/>
33+
<!-- Delete product and category -->
34+
<deleteData createDataKey="product" stepKey="deleteSimpleProduct"/>
35+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
36+
</after>
37+
38+
<!-- Add MAP to the newly created product Advanced Pricing -->
39+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
40+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminProductEditPage">
41+
<argument name="productId" value="$$product.id$$"/>
42+
</actionGroup>
43+
<actionGroup ref="AdminAddMinimumAdvertisedPriceActionGroup" stepKey="setMapToCreatedProduct">
44+
<argument name="msrpData" value="MsrpBeforeOrderConfirmation"/>
45+
</actionGroup>
46+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
47+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/>
48+
49+
<!--Adding the newly created product to shopping cart.-->
50+
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToCategoryPageOnFrontEnd">
51+
<argument name="categoryUrl" value="$category.custom_attributes[url_key]$"/>
52+
</actionGroup>
53+
<actionGroup ref="StorefrontAddSimpleProductToCartActionGroup" stepKey="addProductToCart">
54+
<argument name="product" value="$product$"/>
55+
</actionGroup>
56+
57+
<!-- Navigate to the cart edit page -->
58+
<actionGroup ref="clickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCartViewAndEditPage"/>
59+
60+
<!-- Check if MAP message and link are present and functioning -->
61+
<actionGroup ref="StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup" stepKey="checkFormMapFunctioning"/>
62+
</test>
63+
</tests>

app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
7878
<a href="#" class="action help map"
7979
id="<?= ($block->escapeHtmlAttr($helpLinkId)) ?>"
8080
data-mage-init='{"addToCart":{
81+
"origin": "info",
8182
"helpLinkId": "#<?= $block->escapeJs($block->escapeHtml($helpLinkId)) ?>",
8283
"productName": "<?= $block->escapeJs($block->escapeHtml($product->getName())) ?>",
8384
"showAddToCart": false

app/code/Magento/Checkout/view/frontend/web/js/model/address-converter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ define([
9999
customAttributesObject;
100100

101101
$.each(addrs, function (key) {
102-
if (addrs.hasOwnProperty(key) && !$.isFunction(addrs[key])) {
102+
if (addrs.hasOwnProperty(key) && typeof addrs[key] !== 'function') {
103103
output[self.toUnderscore(key)] = addrs[key];
104104
}
105105
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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="StorefrontCheckoutMiniCartSubtotalMatchesAfterRemoveProductFromCartTest">
12+
<annotations>
13+
<features value="Multishipping"/>
14+
<stories value="Multiple Shipping"/>
15+
<title value="Check mini shopping cart Subtotal Price matches with the View Cart subtotal price after remove product from cart"/>
16+
<description value="Verify mini shopping cart Subtotal Price matches with the View Cart subtotal price after remove product from cart"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-42067"/>
19+
<useCaseId value="MC-41924"/>
20+
<group value="Multishipment"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
25+
<createData entity="SimpleProduct" stepKey="createdSimpleProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
<createData entity="Customer_US_UK_DE" stepKey="createCustomerWithMultipleAddresses"/>
29+
</before>
30+
<after>
31+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
32+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
33+
<deleteData createDataKey="createdSimpleProduct" stepKey="deleteCreatedSimpleProduct"/>
34+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
35+
<deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/>
36+
</after>
37+
<!-- Login to the Storefront as created customer -->
38+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
39+
<argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/>
40+
</actionGroup>
41+
<!-- Open the simple product page -->
42+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductPage">
43+
<argument name="product" value="$$createdSimpleProduct$$"/>
44+
</actionGroup>
45+
<!-- Add to Cart three times of the product -->
46+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
47+
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart">
48+
<argument name="productName" value="$$createdSimpleProduct.name$$"/>
49+
<argument name="productQty" value="3"/>
50+
</actionGroup>
51+
<waitForPageLoad time="120" stepKey="waitForAddToCart"/>
52+
<!-- Go to Cart Summary Section -->
53+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
54+
<!-- Check Out with Multiple Addresses -->
55+
<actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/>
56+
<!-- Remove first simple product from cart -->
57+
<actionGroup ref="StorefrontRemoveProductOnCheckoutActionGroup" stepKey="removeFirstProductFromCart"/>
58+
<!-- Go back to the cart -->
59+
<click selector="{{MultishippingSection.back}}" stepKey="backToCart"/>
60+
<!-- Check and verify subtotals at mini cart summary section-->
61+
<waitForPageLoad time="120" stepKey="waitForCartSummaryPageToLoad"/>
62+
<grabTextFrom selector="{{CheckoutCartProductSection.productSubtotalByName($$createdSimpleProduct.name$$)}}" stepKey="grabTextFromProductsSubtotalField"/>
63+
<grabTextFrom selector="{{CheckoutCartSummarySection.subTotal}}" stepKey="grabTextFromCartSubtotalField"/>
64+
<assertEquals message="Subtotals should be equal" stepKey="assertSubtotalsFields">
65+
<expectedResult type="variable">$grabTextFromProductsSubtotalField</expectedResult>
66+
<actualResult type="variable">$grabTextFromCartSubtotalField</actualResult>
67+
</assertEquals>
68+
</test>
69+
</tests>

app/code/Magento/Paypal/Controller/Transparent/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Magento\Paypal\Model\Payflow\Service\Response\Validator\ResponseValidator;
1919
use Magento\Paypal\Model\Payflow\Transparent;
2020
use Magento\Sales\Api\PaymentFailuresInterface;
21-
use Magento\Framework\Session\Generic as Session;
21+
use Magento\Checkout\Model\Session;
2222
use Magento\Framework\App\Action\HttpPostActionInterface;
2323

2424
/**
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontCheckoutSelectPaypalPaymentMethodActionGroup">
12+
<annotations>
13+
<description>Select Paypal payment method on onepage checkout</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="paymentMethod" defaultValue="{{StorefrontPaypalCheckoutSection.creditCard}}" type="string"/>
17+
</arguments>
18+
<click selector="{{paymentMethod}}" stepKey="selectPaypalPaymentMethod"/>
19+
<waitForPageLoad stepKey="waitForPaypalFormLoad"/>
20+
<scrollTo selector="{{paymentMethod}}" stepKey="scrollToCreditCardSection"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Paypal/Test/Unit/Controller/Transparent/ResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\Framework\DataObject;
1414
use Magento\Framework\Exception\LocalizedException;
1515
use Magento\Framework\Registry;
16-
use Magento\Framework\Session\Generic as Session;
16+
use Magento\Checkout\Model\Session;
1717
use Magento\Framework\View\Layout\ProcessorInterface;
1818
use Magento\Framework\View\Result\Layout;
1919
use Magento\Framework\View\Result\LayoutFactory;
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Sales\Model\Grid;
9+
10+
use Magento\Framework\App\CacheInterface;
11+
12+
/**
13+
* Cache for last grid update time.
14+
*/
15+
class LastUpdateTimeCache
16+
{
17+
/**
18+
* Prefix for cache key.
19+
*/
20+
private const CACHE_PREFIX = 'LAST_GRID_UPDATE_TIME';
21+
22+
/**
23+
* @var CacheInterface
24+
*/
25+
private $cache;
26+
27+
/**
28+
* @param CacheInterface $cache
29+
*/
30+
public function __construct(CacheInterface $cache)
31+
{
32+
$this->cache = $cache;
33+
}
34+
35+
/**
36+
* Save last grid update time.
37+
*
38+
* @param string $gridTableName
39+
* @param string $lastUpdatedAt
40+
* @return void
41+
*/
42+
public function save(string $gridTableName, string $lastUpdatedAt): void
43+
{
44+
$this->cache->save(
45+
$lastUpdatedAt,
46+
$this->getCacheKey($gridTableName),
47+
[],
48+
3600
49+
);
50+
}
51+
52+
/**
53+
* Get last grid update time.
54+
*
55+
* @param string $gridTableName
56+
* @return string|null
57+
*/
58+
public function get(string $gridTableName): ?string
59+
{
60+
$lastUpdatedAt = $this->cache->load($this->getCacheKey($gridTableName));
61+
62+
return $lastUpdatedAt ?: null;
63+
}
64+
65+
/**
66+
* Remove last grid update time.
67+
*
68+
* @param string $gridTableName
69+
* @return void
70+
*/
71+
public function remove(string $gridTableName): void
72+
{
73+
$this->cache->remove($this->getCacheKey($gridTableName));
74+
}
75+
76+
/**
77+
* Generate cache key.
78+
*
79+
* @param string $gridTableName
80+
* @return string
81+
*/
82+
private function getCacheKey(string $gridTableName): string
83+
{
84+
return self::CACHE_PREFIX . ':' . $gridTableName;
85+
}
86+
}

0 commit comments

Comments
 (0)