|
| 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> |
0 commit comments