Skip to content

Commit 225849b

Browse files
committed
Merge branch 'MC-40180' into 2.4-develop-jet-pr1
2 parents 27b552a + d32ec4f commit 225849b

File tree

6 files changed

+131
-4
lines changed

6 files changed

+131
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminImportUnsupportedCurrencyRatesActionGroup" extends="AdminImportCurrencyRatesActionGroup">
12+
<waitForElementVisible selector="{{AdminCurrencyRatesSection.oldRateLabel}}" stepKey="waitForOldRateVisible"/>
13+
</actionGroup>
14+
</actionGroups>

app/code/Magento/CurrencySymbol/Test/Mftf/Data/CurrencyRatesConfigData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
<data key="scope">websites</data>
3333
<data key="scope_code">base</data>
3434
</entity>
35+
<entity name="SetCurrencyRHDBaseConfig">
36+
<data key="path">currency/options/base</data>
37+
<data key="value">RHD</data>
38+
<data key="scope">websites</data>
39+
<data key="scope_code">base</data>
40+
</entity>
3541
<entity name="SetCurrencyAUDBaseConfig">
3642
<data key="path">currency/options/base</data>
3743
<data key="value">AUD</data>
@@ -62,6 +68,12 @@
6268
<data key="scope">websites</data>
6369
<data key="scope_code">base</data>
6470
</entity>
71+
<entity name="SetAllowedCurrenciesConfigForRHD">
72+
<data key="path">currency/options/allow</data>
73+
<data key="value">RHD</data>
74+
<data key="scope">websites</data>
75+
<data key="scope_code">base</data>
76+
</entity>
6577
<entity name="SetAllowedCurrenciesConfigForYEN">
6678
<data key="path">currency/options/allow</data>
6779
<data key="value">JPY</data>

app/code/Magento/CurrencySymbol/Test/Mftf/Section/AdminCurrencyRatesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<element name="saveCurrencyRates" type="button" selector="//button[@title='Save Currency Rates']"/>
1414
<element name="options" type="button" selector="//button[@title='Options']"/>
1515
<element name="oldRate" type="text" selector="//div[contains(@class, 'admin__field-note') and contains(text(), 'Old rate:')]/strong"/>
16+
<element name="oldRateLabel" type="text" selector="//div[contains(@class, 'admin__field-note') and contains(text(), 'Old rate:')]"/>
1617
<element name="rateService" type="select" selector="#rate_services"/>
1718
<element name="currencyRate" type="input" selector="input[name='rate[{{fistCurrency}}][{{secondCurrency}}]']" parameterized="true"/>
1819
</section>
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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>

app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminCurrencyConverterAPIConfigurationTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="AdminCurrencyConverterAPIConfigurationTest">
11+
<test name="AdminCurrencyConverterAPIConfigurationTest" deprecated="Use AdminCheckCurrencyConverterApiConfigurationTest instead">
1212
<annotations>
1313
<features value="CurrencySymbol"/>
1414
<stories value="Currency Rates"/>
15-
<title value="Currency Converter API configuration"/>
16-
<description value="Currency Converter API configuration"/>
15+
<title value="DEPRECATED. Currency Converter API configuration"/>
16+
<description value="DEPRECATED. Currency Converter API configuration"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MC-19272"/>
1919
<useCaseId value="MAGETWO-94919"/>
2020
<group value="currency"/>
2121
<skip>
22-
<issueId value="MQE-1578"/>
22+
<issueId value="DEPRECATED">Use AdminCheckCurrencyConverterApiConfigurationTest instead</issueId>
2323
</skip>
2424
</annotations>
2525
<before>

app/code/Magento/Directory/Test/Mftf/Data/CurrencyConfigData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@
1313
<data key="label">Russian Ruble</data>
1414
<data key="value">RUB</data>
1515
</entity>
16+
<entity name="CurrencyConverterApiKeyConfigData">
17+
<data key="path">currency/currencyconverterapi/api_key</data>
18+
<data key="value">{{_CREDS.magento/currency_currencyconverterapi_api_key}}</data>
19+
</entity>
20+
<entity name="DefaultCurrencyConverterApiKeyConfigData">
21+
<data key="path">currency/currencyconverterapi/api_key</data>
22+
<data key="value">''</data>
23+
</entity>
1624
</entities>

0 commit comments

Comments
 (0)