|
| 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="AdminCheckingCreditMemoTotalsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CreditMemo"/> |
| 14 | + <stories value="MAGETWO-82400: Credit Memo - Wrong tax calculation! #10982"/> |
| 15 | + <title value="Checking Credit Memo Totals"/> |
| 16 | + <description value="Checking Credit Memo Totals"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MAGETWO-97140"/> |
| 19 | + <group value="sales"/> |
| 20 | + <group value="tax"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!--Create category--> |
| 24 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 25 | + <!--Create simple product--> |
| 26 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + <field key="price">100</field> |
| 29 | + </createData> |
| 30 | + <!--Create Tax Rule--> |
| 31 | + <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> |
| 32 | + <!--Create customer--> |
| 33 | + <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> |
| 34 | + <!--Configure Tax Class for shipping--> |
| 35 | + <createData entity="TaxClassForShippingConfig" stepKey="configureTaxClassForShipping"/> |
| 36 | + <!--Configure Braintree--> |
| 37 | + <createData entity="SandboxBraintreeConfig" stepKey="configureBraintree"/> |
| 38 | + <!--Login to admin page--> |
| 39 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 40 | + </before> |
| 41 | + <after> |
| 42 | + <!--Delete category--> |
| 43 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 44 | + <!--Delete simple product--> |
| 45 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 46 | + <!--Delete Tax Rule--> |
| 47 | + <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> |
| 48 | + <!--Delete customer--> |
| 49 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 50 | + <!--Restore default configuration for Tax Class for shipping--> |
| 51 | + <createData entity="DefaultTaxClassForShippingConfig" stepKey="restoreTaxClassForShippingConfig"/> |
| 52 | + <!--Restore default configuration for Braintree--> |
| 53 | + <createData entity="DefaultBraintreeConfig" stepKey="restoreBraintreeConfig"/> |
| 54 | + <!--Logout from admin page--> |
| 55 | + <actionGroup ref="logout" stepKey="logout"/> |
| 56 | + </after> |
| 57 | + |
| 58 | + <!--Create new order with existing customer--> |
| 59 | + <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> |
| 60 | + <argument name="customer" value="$$createCustomer$$"/> |
| 61 | + </actionGroup> |
| 62 | + <!--Add simple product to order--> |
| 63 | + <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> |
| 64 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 65 | + </actionGroup> |
| 66 | + <!--Select Flat Rate shipping method--> |
| 67 | + <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/> |
| 68 | + <!--Fill Braintree credit card for payment method--> |
| 69 | + <actionGroup ref="AdminOrderFillBraintreeCreditCardActionGroup" stepKey="fillBraintreeCreditCard"/> |
| 70 | + <!--Submit order--> |
| 71 | + <click selector="{{AdminOrderFormActionSection.submitOrder}}" stepKey="submitOrder"/> |
| 72 | + <see selector="{{AdminMessagesSection.success}}" userInput="You created the order." |
| 73 | + stepKey="seeSuccessMessage"/> |
| 74 | + |
| 75 | + <!--Create invoice--> |
| 76 | + <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/> |
| 77 | + <!--Submit invoice--> |
| 78 | + <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> |
| 79 | + |
| 80 | + <!--Go to invoice page--> |
| 81 | + <click selector="{{AdminOrderViewTabsSection.invoices}}" stepKey="clickInvoicesTab"/> |
| 82 | + <waitForPageLoad stepKey="waitForInvoiceGridToLoad"/> |
| 83 | + <see selector="{{AdminOrderInvoicesTabSection.gridRow('1')}}" userInput="$113.66" stepKey="seeInvoiceInGrid"/> |
| 84 | + <click selector="{{AdminDataGridTableSection.rowViewAction('1')}}" stepKey="clickViewInvoice"/> |
| 85 | + |
| 86 | + <!--Create Credit Memo--> |
| 87 | + <click selector="{{AdminOrderInvoiceViewMainActionsSection.creditMemo}}" stepKey="clickCreditMemo"/> |
| 88 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoPageTitle"/> |
| 89 | + <fillField selector="{{AdminCreditMemoTotalSection.refundShipping}}" userInput="0" stepKey="setRefundShipping"/> |
| 90 | + <click selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="clickUpdateTotals"/> |
| 91 | + <waitForPageLoad stepKey="waitForUpdateTotals"/> |
| 92 | + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOffline"/> |
| 93 | + <see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." |
| 94 | + stepKey="seeCreatedCreditMemoSuccessMessage"/> |
| 95 | + |
| 96 | + <!--Go to Credit Memo tab--> |
| 97 | + <click selector="{{AdminOrderViewTabsSection.creditMemos}}" stepKey="clickCreditMemosTab"/> |
| 98 | + <waitForPageLoad stepKey="waitForCreditMemosGridToLoad"/> |
| 99 | + |
| 100 | + <!--Check refunded total --> |
| 101 | + <see selector="{{AdminOrderCreditMemosTabSection.gridRow('1')}}" userInput="$108.25" |
| 102 | + stepKey="seeCreditMemoInGrid"/> |
| 103 | + </test> |
| 104 | +</tests> |
0 commit comments