|
| 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="AdminTaxReportGridTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="MAGETWO-86649: Reports / Sales / Tax report show incorrect amount"/> |
| 14 | + <title value="Checking Tax Report grid"/> |
| 15 | + <description value="Checking Tax Report grid with tax rates and same zip code"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MAGETWO-97018"/> |
| 18 | + <group value="tax_report"/> |
| 19 | + <group value="reports"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!--Log in as Admin--> |
| 23 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 24 | + <!--Create Customer--> |
| 25 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 26 | + <!--Create Product--> |
| 27 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 28 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 29 | + <requiredEntity createDataKey="createCategory"/> |
| 30 | + </createData> |
| 31 | + <!--Create product Tax Class and Tax Rates--> |
| 32 | + <createData entity="ProductTaxClass" stepKey="createProductTaxClass"/> |
| 33 | + <createData entity="TexasTaxRate" stepKey="createStateTaxRate"/> |
| 34 | + <createData entity="AustinTaxRate" stepKey="createCityTaxRate"/> |
| 35 | + <!--Get Data from product Tax Class--> |
| 36 | + <getData entity="ProductTaxClassGetter" stepKey="getProductTaxClass"> |
| 37 | + <requiredEntity createDataKey="createProductTaxClass"/> |
| 38 | + </getData> |
| 39 | + </before> |
| 40 | + <after> |
| 41 | + <!--Delete Tax Rules--> |
| 42 | + <actionGroup ref="DeleteTaxRule" stepKey="deleteCityTaxRule"> |
| 43 | + <argument name="taxRuleName" value="CityTaxRule"/> |
| 44 | + </actionGroup> |
| 45 | + <actionGroup ref="DeleteTaxRule" stepKey="deleteStateTaxRule"> |
| 46 | + <argument name="taxRuleName" value="StateTaxRule"/> |
| 47 | + </actionGroup> |
| 48 | + <!--Delete Customer--> |
| 49 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 50 | + <!--Delete Product--> |
| 51 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 52 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 53 | + <!--Delete Tax Rates and product Tax Class--> |
| 54 | + <deleteData createDataKey="createStateTaxRate" stepKey="deleteTaxClass1"/> |
| 55 | + <deleteData createDataKey="createCityTaxRate" stepKey="deleteTaxClass2"/> |
| 56 | + <deleteData createDataKey="createProductTaxClass" stepKey="deleteProductTaxClass"/> |
| 57 | + <actionGroup ref="logout" stepKey="logout"/> |
| 58 | + </after> |
| 59 | + |
| 60 | + <!--Adding Tax Rule with all (*) zip code--> |
| 61 | + <actionGroup ref="AddTaxRule" stepKey="addStateTaxRule"> |
| 62 | + <argument name="taxRuleName" value="StateTaxRule"/> |
| 63 | + <argument name="taxRate" value="$$createStateTaxRate$$"/> |
| 64 | + <argument name="productTaxClass" value="$$getProductTaxClass$$"/> |
| 65 | + </actionGroup> |
| 66 | + <!--Adding Tax Rule with zip code--> |
| 67 | + <actionGroup ref="AddTaxRule" stepKey="addCityTaxRule"> |
| 68 | + <argument name="taxRuleName" value="CityTaxRule"/> |
| 69 | + <argument name="taxRate" value="$$createCityTaxRate$$"/> |
| 70 | + <argument name="productTaxClass" value="$$getProductTaxClass$$"/> |
| 71 | + </actionGroup> |
| 72 | + <!-- Open Product Edit --> |
| 73 | + <amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToEditPage"/> |
| 74 | + <selectOption selector="{{AdminProductFormSection.productTaxClass}}" userInput="$$getProductTaxClass.class_name$$" stepKey="selectCustomTaxClass"/> |
| 75 | + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> |
| 76 | + <!--Create new order with existing Customer --> |
| 77 | + <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> |
| 78 | + <argument name="customer" value="$$createCustomer$$"/> |
| 79 | + </actionGroup> |
| 80 | + <!--Select default store view (in multi-store website)--> |
| 81 | + <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(_defaultStore.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeForOrder(_defaultStore.name)}}" visible="true" stepKey="chooseStoreView" /> |
| 82 | + <!--Add product to order--> |
| 83 | + <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> |
| 84 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 85 | + </actionGroup> |
| 86 | + <!--Select shipping--> |
| 87 | + <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/> |
| 88 | + <!--Select payment--> |
| 89 | + <actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/> |
| 90 | + <!--Submit order--> |
| 91 | + <click selector="{{AdminOrderFormActionSection.submitOrder}}" stepKey="clickSubmitOrder"/> |
| 92 | + <see selector="{{AdminMessagesSection.success}}" userInput="You created the order." stepKey="seeOrderSuccessMessage"/> |
| 93 | + <!--Create and submit Invoice--> |
| 94 | + <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="createInvoice"/> |
| 95 | + <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> |
| 96 | + <!--Create and submit Shipment --> |
| 97 | + <actionGroup ref="StartCreateShipmentFromOrderPage" stepKey="createShipment"/> |
| 98 | + <actionGroup ref="SubmitShipment" stepKey="submitShipment"/> |
| 99 | + <!--Go to Report -> Tax --> |
| 100 | + <amOnPage url="{{AdminReportSalesTaxPage.url}}" stepKey="goToReportTax"/> |
| 101 | + <click selector="{{AdminReportTaxSection.refreshStatistics}}" stepKey="clickRefreshStatistics"/> |
| 102 | + <see selector="{{AdminMessagesSection.success}}" userInput="Recent statistics have been updated." stepKey="seeReportSuccessMessage"/> |
| 103 | + <!--Select Date From--> |
| 104 | + <click selector="{{AdminReportTaxSection.dataPickerFrom}}" stepKey="clickOnDatePickerFrom"/> |
| 105 | + <waitForElementVisible selector="{{AdminReportTaxSection.goTodayButton}}" stepKey="waitForGoTodayButton1"/> |
| 106 | + <click selector="{{AdminReportTaxSection.goTodayButton}}" stepKey="selectToday1"/> |
| 107 | + <click selector="{{AdminReportTaxSection.closeButton}}" stepKey="selectClose1"/> |
| 108 | + <!--Select Date To--> |
| 109 | + <click selector="{{AdminReportTaxSection.dataPickerTo}}" stepKey="clickOnDatePickerTo"/> |
| 110 | + <waitForElementVisible selector="{{AdminReportTaxSection.goTodayButton}}" stepKey="waitForGoTodayButton2"/> |
| 111 | + <click selector="{{AdminReportTaxSection.goTodayButton}}" stepKey="selectToday2"/> |
| 112 | + <click selector="{{AdminReportTaxSection.closeButton}}" stepKey="selectClose2"/> |
| 113 | + <click selector="{{AdminReportMainActionSection.showReport}}" stepKey="clickOnShowReportButton"/> |
| 114 | + <!--Assert taxes--> |
| 115 | + <grabTextFrom selector="{{AdminReportTaxSection.row($$createStateTaxRate.code$$)}}" stepKey="grabStateTax"/> |
| 116 | + <assertEquals stepKey="checkStateTaxForProduct"> |
| 117 | + <expectedResult type="string">$2.00</expectedResult> |
| 118 | + <actualResult type="variable">$grabStateTax</actualResult> |
| 119 | + </assertEquals> |
| 120 | + <grabTextFrom selector="{{AdminReportTaxSection.row($$createCityTaxRate.code$$)}}" stepKey="grabCityTax"/> |
| 121 | + <assertEquals stepKey="checkCityTaxForProduct"> |
| 122 | + <expectedResult type="string">$10.00</expectedResult> |
| 123 | + <actualResult type="variable">$grabCityTax</actualResult> |
| 124 | + </assertEquals> |
| 125 | + <!--Assert total--> |
| 126 | + <grabTextFrom selector="{{AdminReportTaxSection.row('Subtotal')}}" stepKey="grabTotalTax"/> |
| 127 | + <assertEquals stepKey="checkTotalTaxForProduct"> |
| 128 | + <expectedResult type="string">$12.00</expectedResult> |
| 129 | + <actualResult type="variable">$grabTotalTax</actualResult> |
| 130 | + </assertEquals> |
| 131 | + </test> |
| 132 | +</tests> |
0 commit comments