Skip to content

Commit

Permalink
ENGCOM-8442: #30408: solved multishipping cart item subtotal updat… #…
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldagama authored Nov 12, 2020
2 parents a2a561b + f5fb564 commit 3f02c8a
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
<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"/>
<element name="selectShippingAddress" type="select" selector="(//table[@id='multiship-addresses-table'] //div[@class='field address'] //select)[{{sequenceNumber}}]" parameterized="true"/>
<element name="removeItemButton" type="button" selector="//a[contains(@title, 'Remove Item')][{{var}}]" parameterized="true"/>
<element name="back" type="button" selector=".action.back"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontCheckoutSubtotalAfterQuantityUpdateTest">
<annotations>
<features value="Multishipping"/>
<stories value="Multiple Shipping"/>
<title value="Check subtotals after products quantity updated"/>
<description value="Check cart subtotals updates after product quantity updates"/>
<severity value="MAJOR"/>
<testCaseId value="MC-38994"/>
<group value="Multishipment"/>
</annotations>
<before>
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createdSimpleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="Customer_US_UK_DE" stepKey="createCustomerWithMultipleAddresses"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<deleteData createDataKey="createdSimpleProduct" stepKey="deleteCreatedSimpleProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createCustomerWithMultipleAddresses" stepKey="deleteCustomer"/>
</after>
<!-- Login to the Storefront as created customer -->
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
<argument name="Customer" value="$$createCustomerWithMultipleAddresses$$"/>
</actionGroup>
<!-- Open the simple product page -->
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToCreatedSimpleProductPage">
<argument name="productUrl" value="$$createdSimpleProduct.custom_attributes[url_key]$$"/>
</actionGroup>
<!-- Add the simple product to the Shopping Cart -->
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addCreatedSimpleProductToCart">
<argument name="productName" value="$$createdSimpleProduct.name$$"/>
<argument name="productQty" value="1"/>
</actionGroup>
<!-- Go to Cart -->
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
<!-- Check Out with Multiple Addresses -->
<actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/>
<!-- Go back to the cart -->
<click selector="{{MultishippingSection.back}}" stepKey="backToCart"/>
<!-- Update products quantity -->
<fillField selector="{{CheckoutCartProductSection.qty($createdSimpleProduct.name$)}}" userInput="2" stepKey="updateProductQty"/>
<click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickUpdateShoppingCart"/>
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
<!-- Check subtotals -->
<grabTextFrom selector="{{CheckoutCartProductSection.productSubtotalByName($$createdSimpleProduct.name$$)}}" stepKey="grabTextFromProductsSubtotalField"/>
<grabTextFrom selector="{{CheckoutCartSummarySection.subTotal}}" stepKey="grabTextFromCartSubtotalField"/>
<assertEquals message="Subtotals should be equal" stepKey="assertSubtotalsFields">
<expectedResult type="variable">$grabTextFromProductsSubtotalField</expectedResult>
<actualResult type="variable">$grabTextFromCartSubtotalField</actualResult>
</assertEquals>
</test>
</tests>
3 changes: 3 additions & 0 deletions app/code/Magento/Multishipping/etc/frontend/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@
<type name="Magento\Quote\Model\Quote">
<plugin name="multishipping_reset_shipping_assigment" type="Magento\Multishipping\Plugin\ResetShippingAssigment"/>
</type>
<type name="Magento\Checkout\Controller\Cart\UpdateItemQty">
<plugin name="multishipping_disabler" type="Magento\Multishipping\Plugin\DisableMultishippingMode" sortOrder="10" />
</type>
</config>

0 comments on commit 3f02c8a

Please sign in to comment.