|
| 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="CreateCreditMemowithBaseCurrencyUSDandDisplayCurrencyEuroTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Order"/> |
| 14 | + <stories value="Create Credit Memo if Base Currency is USD and Display Currency is Euro"/> |
| 15 | + <title value="Create Credit Memo if Base Currency is USD and Display Currency is Euro"/> |
| 16 | + <description value="Create Credit Memo if Base Currency is USD and Display Currency is Euro"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-4521"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <!-- Create customer --> |
| 23 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 24 | + <!-- Create SimpleProductWithPrice100 --> |
| 25 | + <createData entity="SimpleProduct_100" stepKey="createProduct"/> |
| 26 | + <!-- Currency Options settings --> |
| 27 | + <magentoCLI command="config:set {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="setCurrencyBaseUSD"/> |
| 28 | + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyEURandUSD"/> |
| 29 | + <magentoCLI command="config:set {{SetDefaultCurrencyEURConfig.path}} {{SetDefaultCurrencyEURConfig.value}}" stepKey="setCurrencyDefaultEUR"/> |
| 30 | + <!-- Login as Admin --> |
| 31 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 32 | + <!-- Navigate to curency rates page --> |
| 33 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="naviagteToCurrencyRatesPage"/> |
| 34 | + <!-- Currency Rates (Stores > Currency Rates): 1.000 USD = 0.7067 EUR --> |
| 35 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRates"> |
| 36 | + <argument name="firstCurrency" value="USD"/> |
| 37 | + <argument name="secondCurrency" value="EUR"/> |
| 38 | + <argument name="rate" value="0.7067"/> |
| 39 | + </actionGroup> |
| 40 | + <magentoCLI stepKey="reindex" command="indexer:reindex"/> |
| 41 | + <magentoCLI stepKey="flushCache" command="cache:flush"/> |
| 42 | + </before> |
| 43 | + |
| 44 | + <after> |
| 45 | + <!-- Admin log out --> |
| 46 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 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 | + </after> |
| 54 | + |
| 55 | + <!--Login as customer --> |
| 56 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 57 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 58 | + </actionGroup> |
| 59 | + <!--Navigate To Simple Product Page --> |
| 60 | + <comment userInput="Add product to the shopping cart" stepKey="addSimpleProductToCart"/> |
| 61 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> |
| 62 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 63 | + |
| 64 | + <!-- Verify price for simple product with attribute option €70.67 --> |
| 65 | + <actionGroup ref="AssertStorefrontProductPricesActionGroup" stepKey="assertFirstSimpleProductPrices"> |
| 66 | + <argument name="productPrice" value="€70.67"/> |
| 67 | + <argument name="productFinalPrice" value="€70.67"/> |
| 68 | + </actionGroup> |
| 69 | + |
| 70 | + <!-- Customer placed order from storefront with payment method --> |
| 71 | + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> |
| 72 | + <argument name="product" value="$$createProduct$$"/> |
| 73 | + </actionGroup> |
| 74 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> |
| 75 | + <!-- verify flat rate €3.53--> |
| 76 | + <see 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 | + <!-- application issue --> |
| 87 | + <see userInput="$105.00" selector="{{CheckoutPaymentSection.productChargedFor}}" stepKey="assertProductChargedFor"/> |
| 88 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> |
| 89 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/> |
| 90 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> |
| 91 | + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> |
| 92 | + |
| 93 | + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> |
| 94 | + <!-- Generate invoice --> |
| 95 | + <click selector="{{AdminOrderFormItemsSection.tab_invoice}}" stepKey="clickOnInvoiceBtn"/> |
| 96 | + <click selector="{{AdminOrderFormItemsSection.invoice_submit}}" stepKey="submitInvoice"/> |
| 97 | + <waitForElementVisible selector="{{AdminMessagesSection.successMsg}}" stepKey="waitForSuccessMessage"/> |
| 98 | + <!-- Click 'Credit Memo' button and create new memo --> |
| 99 | + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemo"/> |
| 100 | + <seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewCreditMemoPage"/> |
| 101 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoInPageTitle"/> |
| 102 | + |
| 103 | + <actionGroup ref="AssertAdminCreditMemoNewPageTotalsActionGroup" stepKey="assertCreditMemoRefundTotals"> |
| 104 | + <argument name="refundShipping" value="5.00"/> |
| 105 | + <argument name="adjustmentRefund" value="0.00"/> |
| 106 | + <argument name="adjustmentFee" value="0.00"/> |
| 107 | + <argument name="subtotalRow" value="$100.00"/> |
| 108 | + <argument name="grandTotal" value="$105.00"/> |
| 109 | + </actionGroup> |
| 110 | + <seeElement selector="{{AdminCreditMemoTotalSection.orderTotalPrices('Grand Total','€74.20')}}" stepKey="seeGrandTotalValueEURO"/> |
| 111 | + <seeElement selector="{{AdminCreditMemoTotalSection.subtotalAndShipping('Subtotal','€70.67')}}" stepKey="seeSubTotalValueEURO"/> |
| 112 | + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemo"/> |
| 113 | + <waitForElementVisible selector="{{AdminMessagesSection.successMsg}}" stepKey="waitForMessageAppears"/> |
| 114 | + <see selector="{{AdminMessagesSection.successMsg}}" userInput="You created the credit memo." stepKey="seeCreditMemoCreateSuccess"/> |
| 115 | + |
| 116 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPageAgain"/> |
| 117 | + |
| 118 | + <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsdropDown"/> |
| 119 | + <checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Total Refunded')}}" stepKey="showRefundedColumn"/> |
| 120 | + <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsdropDown"/> |
| 121 | + |
| 122 | + <seeElement selector="{{AdminGridHeaders.headerNameandValueUSD('Grand Total (Base)','105.00')}}" stepKey="seeGrandTotalBase"/> |
| 123 | + <seeElement selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Grand Total (Purchased)','€74.20')}}" stepKey="seeGrandTotalPurchased"/> |
| 124 | + <seeElement selector="{{AdminGridHeaders.headerNameandValueOtherCurrency('Total Refunded','€74.20')}}" stepKey="seeTotalRefunded"/> |
| 125 | + |
| 126 | + </test> |
| 127 | +</tests> |
0 commit comments