|
| 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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> |
| 10 | + <test name="StorefrontCustomerCheckoutWithTaxTest"> |
| 11 | + <annotations> |
| 12 | + <features value="TaxIsRecalculatedAccordingToInputtedDataOnCheckoutFlowForGuestTest"/> |
| 13 | + <stories value="Create order in store front with taxes"/> |
| 14 | + <title value="Tax is recalculated according to inputted data on Checkout flow for Customer"/> |
| 15 | + <description value="Tax is recalculated according to inputted data on Checkout flow for Customer"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="MAGETWO-78903"/> |
| 18 | + <group value="recalculatedTax"/> |
| 19 | + <group value="checkoutTax"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> |
| 23 | + <createData entity="TaxConfig" stepKey="createConf"/> |
| 24 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 25 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 26 | + <field key="price">10.00</field> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <createData entity="Simple_US_NY_Customer" stepKey="simpleUsNyCustomer"/> |
| 30 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> |
| 31 | + <actionGroup ref="ClearCacheActionGroup" stepKey="clearCache"/> |
| 32 | + </before> |
| 33 | + <after> |
| 34 | + <createData entity="DefaultTaxConfig" stepKey="defaultConf"/> |
| 35 | + <deleteData createDataKey="createCategory" stepKey="deleteMyNewCategory"/> |
| 36 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 37 | + <deleteData createDataKey="simpleUsNyCustomer" stepKey="deleteMyNewCustomer"/> |
| 38 | + <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> |
| 39 | + <actionGroup ref="logout" stepKey="logoutOfAdmin"/> |
| 40 | + </after> |
| 41 | + <!-- Step 1: Go to Storefront as Customer --> |
| 42 | + <actionGroup ref="CustomerLoginOnStorefront" stepKey="customerLogin"> |
| 43 | + <argument name="customer" value="$$simpleUsNyCustomer$$" /> |
| 44 | + </actionGroup> |
| 45 | + <!-- Step 2: Add simple product to shopping cart --> |
| 46 | + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="viewProduct"/> |
| 47 | + <waitForPageLoad stepKey="waitForPageLoad"/> |
| 48 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> |
| 49 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 50 | + <argument name="productCount" value="1"/> |
| 51 | + </actionGroup> |
| 52 | + <!-- Step 3: Go to Checkout --> |
| 53 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicartActionGroup"/> |
| 54 | + <seeElement selector="{{CheckoutShippingSection.isShippingStep}}" stepKey="shippingStepIsOpened"/> |
| 55 | + <see stepKey="seeRegion" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="New York"/> |
| 56 | + <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> |
| 57 | + <!-- Step 4: Select Flat Rate as shipping --> |
| 58 | + <click selector="{{CheckoutShippingMethodsSection.flatRate}}" stepKey="selectShippingMethod"/> |
| 59 | + <!-- Step 5: Go Next --> |
| 60 | + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> |
| 61 | + <waitForPageLoad stepKey="waitPaymentStep"/> |
| 62 | + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="paymentStepIsOpened"/> |
| 63 | + <see userInput="$0.84" selector="{{CheckoutPaymentSection.tax}}" stepKey="seeTax"/> |
| 64 | + <click selector="{{CheckoutPaymentSection.taxRateTab}}" stepKey="clickTaxTabsButton" /> |
| 65 | + <see userInput="US-NY-*-Rate 1 (8.375%)" selector="{{CheckoutPaymentSection.taxRate}}" stepKey="seeOrderTaxRate"/> |
| 66 | + <see userInput="$15.84" selector="{{CheckoutPaymentSection.orderTotalInclTax}}" stepKey="seeOrderPriceIncl"/> |
| 67 | + <see userInput="$15.00" selector="{{CheckoutPaymentSection.orderTotalExclTax}}" stepKey="seeOrderPriceExcl"/> |
| 68 | + <!-- Step 6: Go to the previous step - Shipping --> |
| 69 | + <click selector="{{CheckoutPaymentSection.goToShipping}}" stepKey="clickGoToShipping" /> |
| 70 | + <waitForPageLoad stepKey="waitForPage"/> |
| 71 | + <!-- Step 7: Click New Address button --> |
| 72 | + <click selector="{{CheckoutShippingSection.newAdress}}" stepKey="clickAddNewAddress"/> |
| 73 | + <waitForPageLoad stepKey="waitForPagePopup"/> |
| 74 | + <!-- Step 8: Fill form with valid data and set: California --> |
| 75 | + <!-- Step 9: Click Save Address --> |
| 76 | + <actionGroup ref="LoggedInUserCheckoutAddNewAddressInShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingAddress"> |
| 77 | + <argument name="customerVar" value="CustomerEntityOne"/> |
| 78 | + <argument name="customerAddressVar" value="US_Address_CA"/> |
| 79 | + </actionGroup> |
| 80 | + <!-- Step 10: Go next --> |
| 81 | + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext2"/> |
| 82 | + <waitForPageLoad stepKey="waitPaymentStep2"/> |
| 83 | + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="payment2StepIsOpened"/> |
| 84 | + <see userInput="$0.83" selector="{{CheckoutPaymentSection.tax}}" stepKey="seeTaxPrice2"/> |
| 85 | + <click selector="{{CheckoutPaymentSection.taxRateTab}}" stepKey="clickTaxTabsButton2" /> |
| 86 | + <see userInput="US-CA-*-Rate 1 (8.25%)" selector="{{CheckoutPaymentSection.taxRate}}" stepKey="seeOrderTaxRate2"/> |
| 87 | + <see userInput="$15.83" selector="{{CheckoutPaymentSection.orderTotalInclTax}}" stepKey="seeOrderPriceIncl2"/> |
| 88 | + <see userInput="$15.00" selector="{{CheckoutPaymentSection.orderTotalExclTax}}" stepKey="seeOrderPriceExcl2"/> |
| 89 | + </test> |
| 90 | +</tests> |
0 commit comments