|
| 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="AdminCheckCreditMemoTotalsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Tax"/> |
| 14 | + <stories value="Credit memo entity"/> |
| 15 | + <title value="Checking Credit memo Totals"/> |
| 16 | + <description value="Checking Credit memo Totals"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MC-6159"/> |
| 19 | + <group value="creditMemo"/> |
| 20 | + <group value="tax"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Create productTaxClass --> |
| 24 | + <createData entity="productTaxClass" stepKey="createProductTaxClass"/> |
| 25 | + <!--Set configs--> |
| 26 | + <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 0" stepKey="disableGenerateUrlRewrite"/> |
| 27 | + <magentoCLI command="config:set tax/classes/default_product_tax_class $createProductTaxClass.return$" stepKey="setDefaultProductTaxClass"/> |
| 28 | + <!--Create category and product--> |
| 29 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 30 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 31 | + <requiredEntity createDataKey="createCategory"/> |
| 32 | + <field key="productTaxClass">$createProductTaxClass.taxClass[class_name]$</field> |
| 33 | + </createData> |
| 34 | + <!--Create customer--> |
| 35 | + <createData entity="Simple_US_Customer_NY" stepKey="createCustomer"/> |
| 36 | + <!--Login as admin--> |
| 37 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 38 | + <!--Create tax rule--> |
| 39 | + <actionGroup ref="AdminCreateTaxRuleCustomProductTaxClassActionGroup" stepKey="createTaxRuleCustomProductTaxClass"> |
| 40 | + <argument name="productTaxClassName" value="$createProductTaxClass.taxClass[class_name]$"/> |
| 41 | + </actionGroup> |
| 42 | + </before> |
| 43 | + <after> |
| 44 | + <!--Set configs--> |
| 45 | + <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> |
| 46 | + <magentoCLI command="config:set tax/classes/default_product_tax_class 2" stepKey="setDefaultProductTaxClass"/> |
| 47 | + <!--Delete category and product--> |
| 48 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 49 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 50 | + <!--Delete customer--> |
| 51 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 52 | + <!-- Reset admin order filter --> |
| 53 | + <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/> |
| 54 | + <!-- Go to the tax rule page and delete the row we created--> |
| 55 | + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulesPage"/> |
| 56 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deleteRule"> |
| 57 | + <argument name="name" value="{{defaultTaxRule.code}}"/> |
| 58 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/> |
| 59 | + </actionGroup> |
| 60 | + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearTaxRuleFilter"/> |
| 61 | + <!-- Delete Tax Class --> |
| 62 | + <deleteData createDataKey="createProductTaxClass" stepKey="deleteProductTaxClass"/> |
| 63 | + <!--Logout--> |
| 64 | + <actionGroup ref="logout" stepKey="logout"/> |
| 65 | + </after> |
| 66 | + <!--Create new order--> |
| 67 | + <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> |
| 68 | + <argument name="customer" value="Simple_US_Customer_NY"/> |
| 69 | + </actionGroup> |
| 70 | + <!--Add product to order--> |
| 71 | + <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> |
| 72 | + <argument name="product" value="$createSimpleProduct$"/> |
| 73 | + </actionGroup> |
| 74 | + <!--Set shipping method--> |
| 75 | + <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShipping"/> |
| 76 | + <!--Submit order--> |
| 77 | + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> |
| 78 | + <!--Create order invoice--> |
| 79 | + <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/> |
| 80 | + <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> |
| 81 | + <!--Create Credit Memo--> |
| 82 | + <actionGroup ref="AdminStartToCreateCreditMemoFromOrderPageActionGroup" stepKey="createCreditMemo"/> |
| 83 | + <fillField selector="{{AdminCreditMemoTotalSection.refundShipping}}" userInput="0" stepKey="setRefundShipping"/> |
| 84 | + <actionGroup ref="UpdateCreditMemoTotalsActionGroup" stepKey="updateTotals"/> |
| 85 | + <actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/> |
| 86 | + <actionGroup ref="AdminOpenCreditMemoFromOrderPageActionGroup" stepKey="openCreditMemoFromOrderPageActionGroup"/> |
| 87 | + <actionGroup ref="AdminAssertCreditMemoGrandTotalActionGroup" stepKey="assertGrandTotal"> |
| 88 | + <argument name="expectedGrandTotal" value="$133.30"/> |
| 89 | + </actionGroup> |
| 90 | + </test> |
| 91 | +</tests> |
0 commit comments