|
| 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="AdminCheckCurrencyConverterApiConfigurationTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CurrencySymbol"/> |
| 14 | + <stories value="Currency Rates"/> |
| 15 | + <title value="Currency Converter API configuration"/> |
| 16 | + <description value="Admin should be able to import currency rates using Currency Converter API"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-28786"/> |
| 19 | + <useCaseId value="MAGETWO-94919"/> |
| 20 | + <group value="currency"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!--Set currency configuration--> |
| 24 | + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForRHD.value}}" stepKey="setAllowedCurrencyRHDAndUSD"/> |
| 25 | + <magentoCLI command="config:set {{CurrencyConverterApiKeyConfigData.path}} {{CurrencyConverterApiKeyConfigData.value}}" stepKey="setCurrencyConverterApiKey"/> |
| 26 | + <!--Create product--> |
| 27 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 28 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <!--Set currency allow previous config--> |
| 32 | + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="setDefaultAllowedCurrencies"/> |
| 33 | + <magentoCLI command="config:set {{DefaultCurrencyConverterApiKeyConfigData.path}} {{DefaultCurrencyConverterApiKeyConfigData.value}}" stepKey="setDefaultCurrencyConverterApiKey"/> |
| 34 | + <!--Delete created data--> |
| 35 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 36 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 37 | + </after> |
| 38 | + <!--Import rates from Currency Converter API--> |
| 39 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="openCurrencyRatesPage"/> |
| 40 | + <actionGroup ref="AdminImportUnsupportedCurrencyRatesActionGroup" stepKey="importCurrencyRates"> |
| 41 | + <argument name="rateService" value="Currency Converter API"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeWarningMessageForRHD"> |
| 44 | + <argument name="message" value="We can't retrieve a rate from https://free.currconv.com for RHD."/> |
| 45 | + <argument name="messageType" value="warning"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeWarningMessageSaved"> |
| 48 | + <argument name="message" value='Click "Save" to apply the rates we found.'/> |
| 49 | + <argument name="messageType" value="warning"/> |
| 50 | + </actionGroup> |
| 51 | + <actionGroup ref="AdminSaveCurrencyRatesActionGroup" stepKey="saveCurrencyRates"/> |
| 52 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeRHDMessageAfterSave"> |
| 53 | + <argument name="message" value="{{AdminSaveCurrencyRatesMessageData.success}}"/> |
| 54 | + </actionGroup> |
| 55 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeValidRatesSaved"> |
| 56 | + <argument name="message" value='Please correct the input data for "USD => RHD" rate'/> |
| 57 | + <argument name="messageType" value="warning"/> |
| 58 | + </actionGroup> |
| 59 | + <magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyEURAndUSD"/> |
| 60 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="openCurrencyRatesPageAfterSetEUR"/> |
| 61 | + <actionGroup ref="AdminImportCurrencyRatesActionGroup" stepKey="importCurrencyRatesAfterEUR"> |
| 62 | + <argument name="rateService" value="Currency Converter API"/> |
| 63 | + </actionGroup> |
| 64 | + <dontSee selector="{{AdminMessagesSection.warning}}" userInput="We can't retrieve a rate from https://free.currconv.com for EUR." stepKey="dontSeeWarningMessageForEUR"/> |
| 65 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessageForSaveRates"> |
| 66 | + <argument name="message" value='Click "Save" to apply the rates we found.'/> |
| 67 | + </actionGroup> |
| 68 | + <actionGroup ref="AdminSaveCurrencyRatesActionGroup" stepKey="saveCurrencyRatesAfterEUR"/> |
| 69 | + <dontSee selector="{{AdminMessagesSection.warning}}" userInput='Please correct the input data for "USD => EUR" rate' stepKey="dontSeeWarningMessageCorrectForEUR"/> |
| 70 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeValidRatesEURSaved"> |
| 71 | + <argument name="message" value="{{AdminSaveCurrencyRatesMessageData.success}}"/> |
| 72 | + </actionGroup> |
| 73 | + <!--Go to the Storefront and check currency rates--> |
| 74 | + <amOnPage url="{{StorefrontProductPage.url($createProduct.custom_attributes[url_key]$)}}" stepKey="openCreatedProductPage"/> |
| 75 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 76 | + <actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchToEURCurrency"> |
| 77 | + <argument name="currency" value="EUR"/> |
| 78 | + </actionGroup> |
| 79 | + <see selector="{{StorefrontCategoryMainSection.productPrice}}" userInput="€" stepKey="seeEURCurrencySymbolInPrice"/> |
| 80 | + <!--Set allowed currencies greater then 10--> |
| 81 | + <magentoCLI command="config:set currency/options/allow RHD,CHW,YER,ZMK,CHE,EUR,USD,AMD,RUB,DZD,ARS,AWG" stepKey="setGreaterThanTenAllowedCurrencies"/> |
| 82 | + <!--Import rates from Currency Converter API with currencies greater then 10--> |
| 83 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="openCurrencyRatesPageAfterChangeAllowed"/> |
| 84 | + <actionGroup ref="AdminImportUnsupportedCurrencyRatesActionGroup" stepKey="importCurrencyRatesGreaterThen10"> |
| 85 | + <argument name="rateService" value="Currency Converter API"/> |
| 86 | + </actionGroup> |
| 87 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeTooManyPairsMessage"> |
| 88 | + <argument name="message" value="Too many pairs. Maximum of 2 is supported for this free version."/> |
| 89 | + <argument name="messageType" value="warning"/> |
| 90 | + </actionGroup> |
| 91 | + </test> |
| 92 | +</tests> |
0 commit comments