|
| 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="CreateCreditMemoWithBaseCurrencyUSDAndDisplayCurrencyEuroTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Order"/> |
| 13 | + <stories value="Create Credit Memo"/> |
| 14 | + <title value="Create Credit Memo with Base Currency as USD and Display Currency as Euro"/> |
| 15 | + <description value="The purpose of this test is to create credit memo with base currency as USD and display currency as Euro and validate the corresponding prices and currency symbols"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="AC-4521"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- Create customer --> |
| 21 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 22 | + <!-- Create SimpleProductWithPrice100 --> |
| 23 | + <createData entity="SimpleProduct_100" stepKey="createProduct"/> |
| 24 | + <!-- Currency Options settings --> |
| 25 | + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyEURAndUSD"/> |
| 26 | + <magentoCLI command="config:set currency/options/default EUR" stepKey="setCurrencyDefaultEUR"/> |
| 27 | + <!-- Login as Admin --> |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + <!-- Navigate to currency rates page --> |
| 30 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="naviagteToCurrencyRatesPage"/> |
| 31 | + <!-- Currency Rates (Stores > Currency Rates): 1.000 USD = 0.7067 EUR --> |
| 32 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRates"> |
| 33 | + <argument name="firstCurrency" value="USD"/> |
| 34 | + <argument name="secondCurrency" value="EUR"/> |
| 35 | + <argument name="rate" value="0.7067"/> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> |
| 38 | + <argument name="tags" value="config full_page"/> |
| 39 | + </actionGroup> |
| 40 | + </before> |
| 41 | + <after> |
| 42 | + <magentoCLI command="config:set {{SetDefaultCurrencyUSDConfig.path}} {{SetDefaultCurrencyUSDConfig.value}}" stepKey="resetDefaultCurrencyBaseBackToUSD"/> |
| 43 | + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="resetAllowedCurrencyBaseBackToUSD"/> |
| 44 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> |
| 45 | + <argument name="tags" value="config full_page"/> |
| 46 | + </actionGroup> |
| 47 | + <!-- Customer log out --> |
| 48 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> |
| 49 | + <!-- Delete customer --> |
| 50 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 51 | + <!-- Delete product --> |
| 52 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 53 | + <!-- Admin log out --> |
| 54 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 55 | + </after> |
| 56 | + <!-- Login as customer --> |
| 57 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 58 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 59 | + </actionGroup> |
| 60 | + <!-- Navigate To Simple Product Page --> |
| 61 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToSimpleProductPage"> |
| 62 | + <argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/> |
| 63 | + </actionGroup> |
| 64 | + <!-- Verify product prices for simple product --> |
| 65 | + <actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertSimpleProductPrices"> |
| 66 | + <argument name="productPrice" value="€70.67"/> |
| 67 | + <argument name="productFinalPrice" value="€70.67"/> |
| 68 | + </actionGroup> |
| 69 | + <!-- Add product to cart --> |
| 70 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 71 | + <argument name="product" value="$$createProduct$$"/> |
| 72 | + </actionGroup> |
| 73 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToShoppingCart"/> |
| 74 | + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/> |
| 75 | + <!-- verify flat rate €3.53 --> |
| 76 | + <waitForText selector="{{CheckoutShippingMethodsSection.price}}" stepKey="seeFlatRate" userInput="€3.53"/> |
| 77 | + <!-- click on Next button --> |
| 78 | + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> |
| 79 | + <!-- verify order summary --> |
| 80 | + <actionGroup ref="CheckOrderSummaryInCheckoutActionGroup" stepKey="checkOrderSummary"> |
| 81 | + <argument name="subtotal" value="€70.67"/> |
| 82 | + <argument name="shippingTotal" value="€3.53"/> |
| 83 | + <argument name="shippingMethod" value="Flat Rate - Fixed"/> |
| 84 | + <argument name="total" value="€74.20"/> |
| 85 | + </actionGroup> |
| 86 | + <waitForText userInput="$105.00" selector="{{CheckoutPaymentSection.productChargedFor}}" stepKey="assertProductChargedFor"/> |
| 87 | + <!-- Place order --> |
| 88 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> |
| 89 | + <waitForElement selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="waitForOrderId"/> |
| 90 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/> |
| 91 | + <!-- Navigate to Sales order page --> |
| 92 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> |
| 93 | + <!-- Open created order --> |
| 94 | + <actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="filterOrdersGridById"> |
| 95 | + <argument name="entityId" value="{$orderId}"/> |
| 96 | + </actionGroup> |
| 97 | + <!-- Submit invoice --> |
| 98 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickOnInvoiceBtn"/> |
| 99 | + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> |
| 100 | + <waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> |
| 101 | + <!-- Click 'Credit Memo' button and create new memo --> |
| 102 | + <actionGroup ref="AdminStartToCreateCreditMemoFromOrderPageActionGroup" stepKey="createCreditMemo"/> |
| 103 | + <!-- Assert Credit Memo refund prices --> |
| 104 | + <actionGroup ref="AssertAdminCreditMemoNewPageTotalsActionGroup" stepKey="assertCreditMemoRefundTotals"> |
| 105 | + <argument name="refundShipping" value="5.00"/> |
| 106 | + <argument name="adjustmentRefund" value="0.00"/> |
| 107 | + <argument name="adjustmentFee" value="0.00"/> |
| 108 | + <argument name="subtotalRow" value="$100.00"/> |
| 109 | + <argument name="grandTotal" value="$105.00"/> |
| 110 | + </actionGroup> |
| 111 | + <!-- Assert Grand total and subtotal value --> |
| 112 | + <waitForElementVisible selector="{{AdminOrderTotalSection.orderTotalPrices('Grand Total','€74.20')}}" stepKey="waitForGrandTotalValueEURO"/> |
| 113 | + <waitForElementVisible selector="{{AdminOrderTotalSection.subTotalAndShipping('Subtotal','€70.67')}}" stepKey="waitForSubTotalValueEURO"/> |
| 114 | + <!-- Refund Offline --> |
| 115 | + <actionGroup ref="AdminClickRefundOfflineOnCreditMemoDetailPageActionGroup" stepKey="clickRefundOffline"/> |
| 116 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPageAgain"/> |
| 117 | + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> |
| 118 | + <waitForElementClickable selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="waitForColumnsDropdownToBeOpened"/> |
| 119 | + <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropDown"/> |
| 120 | + <!-- Enable to display Total Refunded column and validate currency --> |
| 121 | + <checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Total Refunded')}}" stepKey="showRefundedColumn"/> |
| 122 | + <waitForElementClickable selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="waitForColumnsDropdownToBeClickedToClose"/> |
| 123 | + <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropDown"/> |
| 124 | + <waitForElement selector="{{AdminProductGridSection.headerNameAndValueOtherCurrency('Grand Total (Base)','105.00')}}" stepKey="waitForGrandTotalBaseValue"/> |
| 125 | + <grabTextFrom selector="{{AdminProductGridSection.headerNameAndValueOtherCurrency('Grand Total (Base)','105.00')}}" stepKey="grabGrandTotalBaseValue"/> |
| 126 | + <assertEquals stepKey="seeGrandTotalBase"> |
| 127 | + <actualResult type="const">$grabGrandTotalBaseValue</actualResult> |
| 128 | + <expectedResult type="string">$105.00</expectedResult> |
| 129 | + </assertEquals> |
| 130 | + <waitForElementVisible selector="{{AdminProductGridSection.headerNameAndValueOtherCurrency('Grand Total (Purchased)','€74.20')}}" stepKey="seeGrandTotalPurchased"/> |
| 131 | + <waitForElementVisible selector="{{AdminProductGridSection.headerNameAndValueOtherCurrency('Total Refunded','€74.20')}}" stepKey="seeTotalRefunded"/> |
| 132 | + </test> |
| 133 | +</tests> |
0 commit comments