|
| 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" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="StorefrontCustomerWithDefaultBillingAddressAndCartWithVirtualProductTaxTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Tax"/> |
| 13 | + <stories value="Tax Calculation in Shopping Cart"/> |
| 14 | + <title value="Tax for quote with virtual products only should be calculated based on customer default billing address"/> |
| 15 | + <description value="Tax for quote with virtual products only should be calculated based on customer default billing address"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <useCaseId value="MC-41945"/> |
| 18 | + <testCaseId value="MC-42650"/> |
| 19 | + <group value="Tax"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Login to admin --> |
| 23 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 24 | + <!-- Fill in rules to display tax in the cart --> |
| 25 | + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> |
| 26 | + <!-- Create tax rate for TX --> |
| 27 | + <createData entity="TaxRateTexas" stepKey="createTaxRateTX"/> |
| 28 | + <!-- Create tax rule --> |
| 29 | + <actionGroup ref="AdminCreateTaxRuleWithTwoTaxRatesActionGroup" stepKey="createTaxRule"> |
| 30 | + <argument name="taxRate" value="$$createTaxRateTX$$"/> |
| 31 | + <argument name="taxRate2" value="US_NY_Rate_1"/> |
| 32 | + <argument name="taxRule" value="SimpleTaxRule"/> |
| 33 | + </actionGroup> |
| 34 | + <!-- Create a virtual product --> |
| 35 | + <createData entity="VirtualProduct" stepKey="createVirtualProduct"/> |
| 36 | + <!-- Create customer --> |
| 37 | + <createData entity="Simple_US_Customer_With_Different_Billing_Shipping_Addresses" stepKey="createCustomer"/> |
| 38 | + </before> |
| 39 | + <after> |
| 40 | + <!-- Ensure tax won't be shown in the cart --> |
| 41 | + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> |
| 42 | + <!-- Delete tax rule --> |
| 43 | + <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> |
| 44 | + <argument name="taxRuleCode" value="{{SimpleTaxRule.code}}" /> |
| 45 | + </actionGroup> |
| 46 | + <!-- Delete tax rate for UK --> |
| 47 | + <deleteData createDataKey="createTaxRateTX" stepKey="deleteTaxRateUK"/> |
| 48 | + <!-- Delete virtual product --> |
| 49 | + <deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/> |
| 50 | + <!-- Delete customer --> |
| 51 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 52 | + <!-- Logout from admin --> |
| 53 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> |
| 54 | + </after> |
| 55 | + <!-- Login with created Customer --> |
| 56 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> |
| 57 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 58 | + </actionGroup> |
| 59 | + <!-- Navigate to the product --> |
| 60 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct2Page"> |
| 61 | + <argument name="product" value="$$createVirtualProduct$$"/> |
| 62 | + </actionGroup> |
| 63 | + <!--Add to cart --> |
| 64 | + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="product2AddToCart"/> |
| 65 | + <!--Click on mini cart--> |
| 66 | + <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> |
| 67 | + <!--Click on view and edit cart link--> |
| 68 | + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> |
| 69 | + <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> |
| 70 | + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> |
| 71 | + <waitForElementVisible selector="{{CheckoutPaymentSection.tax}}" stepKey="waitForOverviewVisible1" /> |
| 72 | + <!-- Verify tax in shopping cart --> |
| 73 | + <see selector="{{CheckoutPaymentSection.tax}}" userInput="$7.25" stepKey="verifyTaxInShoppingCartPage" /> |
| 74 | + <!-- Navigate to payment page --> |
| 75 | + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/> |
| 76 | + <waitForElementVisible selector="{{CheckoutPaymentSection.tax}}" stepKey="waitForOverviewVisible2"/> |
| 77 | + <!-- Verify tax on payment page --> |
| 78 | + <see selector="{{CheckoutPaymentSection.tax}}" userInput="$7.25" stepKey="verifyTaxOnPaymentPage"/> |
| 79 | + <!-- Place order --> |
| 80 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> |
| 81 | + <!-- Navigate to order details page --> |
| 82 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> |
| 83 | + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> |
| 84 | + <argument name="orderNumber" value="{$grabOrderNumber}"/> |
| 85 | + </actionGroup> |
| 86 | + <!-- Verify tax on order view page --> |
| 87 | + <see selector="{{StorefrontCustomerOrderViewSection.totalsTax}}" userInput="$7.25" stepKey="verifyTaxOnOrderViewPage"/> |
| 88 | + </test> |
| 89 | +</tests> |
0 commit comments