Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit aae0b0c

Browse files
author
Joan He
authored
Merge pull request #2573 from magento-borg/pr
[Borg] Bug Fix PR
2 parents 57b5fdb + 1051a82 commit aae0b0c

File tree

9 files changed

+103
-3
lines changed

9 files changed

+103
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
<!-- PayPal value handlers infrastructure -->
448448
<type name="Magento\Braintree\Gateway\Response\PayPal\VaultDetailsHandler">
449449
<arguments>
450-
<argument name="paymentTokenFactory" xsi:type="object">Magento\Vault\Model\AccountPaymentTokenFactory</argument>
450+
<argument name="paymentTokenFactory" xsi:type="object">Magento\Vault\Api\Data\PaymentTokenFactoryInterface</argument>
451451
</arguments>
452452
</type>
453453
<virtualType name="BraintreePayPalValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool">

app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ define([
1212
$.widget('mage.shoppingCart', {
1313
/** @inheritdoc */
1414
_create: function () {
15-
var items, i;
15+
var items, i, reload;
1616

1717
$(this.options.emptyCartButton).on('click', $.proxy(function () {
1818
$(this.options.emptyCartButton).attr('name', 'update_cart_action_temp');
@@ -36,6 +36,27 @@ define([
3636
$(this.options.continueShoppingButton).on('click', $.proxy(function () {
3737
location.href = this.options.continueShoppingUrl;
3838
}, this));
39+
40+
$(document).on('ajax:removeFromCart', $.proxy(function () {
41+
reload = true;
42+
$('div.block.block-minicart').on('dropdowndialogclose', $.proxy(function () {
43+
if (reload === true) {
44+
location.reload();
45+
reload = false;
46+
}
47+
$('div.block.block-minicart').off('dropdowndialogclose');
48+
}));
49+
}, this));
50+
$(document).on('ajax:updateItemQty', $.proxy(function () {
51+
reload = true;
52+
$('div.block.block-minicart').on('dropdowndialogclose', $.proxy(function () {
53+
if (reload === true) {
54+
location.reload();
55+
reload = false;
56+
}
57+
$('div.block.block-minicart').off('dropdowndialogclose');
58+
}));
59+
}, this));
3960
}
4061
});
4162

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ define([
220220
*/
221221
_updateItemQtyAfter: function (elem) {
222222
this._hideItemButton(elem);
223+
$(document).trigger('ajax:updateItemQty');
223224
},
224225

225226
/**

app/code/Magento/Vault/Model/PaymentTokenFactory.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ class PaymentTokenFactory implements PaymentTokenFactoryInterface
2222
*/
2323
private $tokenTypes = [];
2424

25+
/**
26+
* @var ObjectManagerInterface
27+
*/
28+
private $objectManager;
29+
2530
/**
2631
* PaymentTokenFactory constructor.
2732
* @param ObjectManagerInterface $objectManager

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Section/CheckoutCartProductSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@
2424
<element name="ProductOptionByNameAndAttribute" type="input"
2525
selector="//main//table[@id='shopping-cart-table']//tbody//tr[.//strong[contains(@class, 'product-item-name')]//a[contains(text(), '{{var1}}')]]//dl[@class='item-options']//dt[.='{{var2}}']/following-sibling::dd[1]"
2626
parameterized="true"/>
27+
<element name="RemoveItem" type="button"
28+
selector="//table[@id='shopping-cart-table']//tbody//tr[contains(@class,'item-actions')]//a[contains(@class,'action-delete')]"/>
2729
</section>
2830
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="StoreFrontRemoveItemModalSection">
12+
<element name="message" type="text" selector="aside.confirm div.modal-content"/>
13+
<element name="ok" type="button" selector="aside.confirm .modal-footer .action-primary"/>
14+
<element name="cancel" type="button" selector="aside.confirm .modal-footer .action-secondary"/>
15+
</section>
16+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Section/StorefrontMiniCartSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
<element name="goToCheckout" type="button" selector="#top-cart-btn-checkout" timeout="30"/>
2323
<element name="viewAndEditCart" type="button" selector=".action.viewcart" timeout="30"/>
2424
<element name="miniCartItemsText" type="text" selector=".minicart-items"/>
25+
<element name="deleteMiniCartItem" type="button" selector=".action.delete" timeout="30"/>
2526
</section>
2627
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="NoErrorCartCheckoutForProductsDeletedFromMiniCartTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Delete product from Storefront checkout"/>
15+
<title value="Delete product from Checkout"/>
16+
<description value="No error from cart should be thrown for product deleted from minicart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-91451"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<!-- Preconditions -->
22+
<before>
23+
<!-- Simple product is created with price = 100 -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
26+
<field key="price">100.00</field>
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
</before>
30+
<after>
31+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
32+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
33+
</after>
34+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage"/>
35+
<waitForPageLoad stepKey="waitForPageLoad1"/>
36+
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/>
37+
<click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addProductToCart"/>
38+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
39+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createSimpleProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
40+
<see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantity"/>
41+
<!-- open the minicart -->
42+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart1"/>
43+
<click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="editProductFromMiniCart"/>
44+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart2"/>
45+
<click selector="{{StorefrontMinicartSection.deleteMiniCartItem}}" stepKey="deleteMiniCartItem"/>
46+
<waitForElementVisible selector="{{StoreFrontRemoveItemModalSection.message}}" stepKey="waitFortheConfirmationModal"/>
47+
<see selector="{{StoreFrontRemoveItemModalSection.message}}" userInput="Are you sure you would like to remove this item from the shopping cart?" stepKey="seeDeleteConfirmationMessage"/>
48+
<click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/>
49+
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
50+
<click selector="{{CheckoutCartProductSection.RemoveItem}}" stepKey="deleteProductFromCheckoutCart"/>
51+
<waitForPageLoad stepKey="WaitForPageLoad3"/>
52+
<see userInput="You have no items in your shopping cart." stepKey="seeNoItemsInShoppingCart"/>
53+
</test>
54+
</tests>

dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/ReorderUsingVaultTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<data name="creditCard/data/payment_code" xsi:type="string">braintree</data>
2727
<data name="configData" xsi:type="string">braintree, braintree_use_vault</data>
2828
<data name="status" xsi:type="string">Processing</data>
29-
<data name="tag" xsi:type="string">test_type:3rd_party_test, severity:S1</data>
29+
<data name="tag" xsi:type="string">severity:S1</data>
3030
<constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
3131
<constraint name="Magento\Sales\Test\Constraint\AssertOrderStatusIsCorrect" />
3232
<constraint name="Magento\Sales\Test\Constraint\AssertAuthorizationInCommentsHistory" />

0 commit comments

Comments
 (0)