Skip to content

Commit 3f02c8a

Browse files
ENGCOM-8442: #30408: solved multishipping cart item subtotal updat… #30411
2 parents a2a561b + f5fb564 commit 3f02c8a

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<element name="shippingAddressOptions" type="select" selector="#multiship-addresses-table tbody tr:nth-of-type({{addressPosition}}) .col.address select option:nth-of-type({{optionIndex}})" parameterized="true"/>
1616
<element name="selectShippingAddress" type="select" selector="(//table[@id='multiship-addresses-table'] //div[@class='field address'] //select)[{{sequenceNumber}}]" parameterized="true"/>
1717
<element name="removeItemButton" type="button" selector="//a[contains(@title, 'Remove Item')][{{var}}]" parameterized="true"/>
18+
<element name="back" type="button" selector=".action.back"/>
1819
</section>
1920
</sections>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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="StorefrontCheckoutSubtotalAfterQuantityUpdateTest">
12+
<annotations>
13+
<features value="Multishipping"/>
14+
<stories value="Multiple Shipping"/>
15+
<title value="Check subtotals after products quantity updated"/>
16+
<description value="Check cart subtotals updates after product quantity updates"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-38994"/>
19+
<group value="Multishipment"/>
20+
</annotations>
21+
<before>
22+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
23+
<createData entity="SimpleProduct" stepKey="createdSimpleProduct">
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
<createData entity="Customer_US_UK_DE" stepKey="createCustomerWithMultipleAddresses"/>
27+
</before>
28+
<after>
29+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
30+
<deleteData createDataKey="createdSimpleProduct" stepKey="deleteCreatedSimpleProduct"/>
31+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
32+
<deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/>
33+
</after>
34+
<!-- Login to the Storefront as created customer -->
35+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
36+
<argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/>
37+
</actionGroup>
38+
<!-- Open the simple product page -->
39+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToCreatedSimpleProductPage">
40+
<argument name="productUrl" value="$$createdSimpleProduct.custom_attributes[url_key]$$"/>
41+
</actionGroup>
42+
<!-- Add the simple product to the Shopping Cart -->
43+
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addCreatedSimpleProductToCart">
44+
<argument name="productName" value="$$createdSimpleProduct.name$$"/>
45+
<argument name="productQty" value="1"/>
46+
</actionGroup>
47+
<!-- Go to Cart -->
48+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
49+
<!-- Check Out with Multiple Addresses -->
50+
<actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/>
51+
<!-- Go back to the cart -->
52+
<click selector="{{MultishippingSection.back}}" stepKey="backToCart"/>
53+
<!-- Update products quantity -->
54+
<fillField selector="{{CheckoutCartProductSection.qty($createdSimpleProduct.name$)}}" userInput="2" stepKey="updateProductQty"/>
55+
<click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickUpdateShoppingCart"/>
56+
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
57+
<!-- Check subtotals -->
58+
<grabTextFrom selector="{{CheckoutCartProductSection.productSubtotalByName($$createdSimpleProduct.name$$)}}" stepKey="grabTextFromProductsSubtotalField"/>
59+
<grabTextFrom selector="{{CheckoutCartSummarySection.subTotal}}" stepKey="grabTextFromCartSubtotalField"/>
60+
<assertEquals message="Subtotals should be equal" stepKey="assertSubtotalsFields">
61+
<expectedResult type="variable">$grabTextFromProductsSubtotalField</expectedResult>
62+
<actualResult type="variable">$grabTextFromCartSubtotalField</actualResult>
63+
</assertEquals>
64+
</test>
65+
</tests>

app/code/Magento/Multishipping/etc/frontend/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@
4848
<type name="Magento\Quote\Model\Quote">
4949
<plugin name="multishipping_reset_shipping_assigment" type="Magento\Multishipping\Plugin\ResetShippingAssigment"/>
5050
</type>
51+
<type name="Magento\Checkout\Controller\Cart\UpdateItemQty">
52+
<plugin name="multishipping_disabler" type="Magento\Multishipping\Plugin\DisableMultishippingMode" sortOrder="10" />
53+
</type>
5154
</config>

0 commit comments

Comments
 (0)