Skip to content

Commit e8d1ccd

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-67450-rebase' into EPAM-PR-81
2 parents 24f1d73 + a698461 commit e8d1ccd

12 files changed

+338
-4
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="CatalogPriceScopeWebsiteConfigData">
12+
<data key="path">catalog/price/scope</data>
13+
<data key="value">1</data>
14+
</entity>
15+
<entity name="CatalogPriceScopeGlobalConfigData">
16+
<data key="path">catalog/price/scope</data>
17+
<data key="value">0</data>
18+
</entity>
19+
</entities>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminSetCurrencyRatesActionGroup">
12+
<arguments>
13+
<argument name="firstCurrency" type="string" defaultValue="USD"/>
14+
<argument name="secondCurrency" type="string" defaultValue="EUR"/>
15+
<argument name="rate" type="string" defaultValue="0.5"/>
16+
</arguments>
17+
<fillField selector="{{AdminCurrencyRatesSection.currencyRate(firstCurrency, secondCurrency)}}" userInput="{{rate}}" stepKey="setCurrencyRate"/>
18+
<click selector="{{AdminCurrencyRatesSection.saveCurrencyRates}}" stepKey="clickSaveCurrencyRates"/>
19+
<waitForPageLoad stepKey="waitForSave"/>
20+
<see selector="{{AdminMessagesSection.success}}" userInput="{{AdminSaveCurrencyRatesMessageData.success}}" stepKey="seeSuccessMessage"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="StorefrontSwitchCurrency">
12+
<arguments>
13+
<argument name="currency" type="string" defaultValue="EUR"/>
14+
</arguments>
15+
<click selector="{{StorefrontSwitchCurrencyRatesSection.currencyTrigger}}" stepKey="openTrigger"/>
16+
<waitForElementVisible selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="waitForCurrency"/>
17+
<click selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="chooseCurrency"/>
18+
<see selector="{{StorefrontSwitchCurrencyRatesSection.selectedCurrency}}" userInput="{{currency}}" stepKey="seeSelectedCurrency"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 14 additions & 0 deletions
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="AdminSaveCurrencyRatesMessageData">
12+
<data key="success">All valid rates have been saved.</data>
13+
</entity>
14+
</entities>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="SetCurrencyUSDBaseConfig">
12+
<data key="path">currency/options/base</data>
13+
<data key="value">USD</data>
14+
<data key="scope">websites</data>
15+
<data key="scope_code">base</data>
16+
</entity>
17+
<entity name="SetCurrencyEURBaseConfig">
18+
<data key="path">currency/options/base</data>
19+
<data key="value">EUR</data>
20+
<data key="scope">websites</data>
21+
<data key="scope_code">base</data>
22+
</entity>
23+
<entity name="SetAllowedCurrenciesConfigForUSD">
24+
<data key="path">currency/options/allow</data>
25+
<data key="value">USD</data>
26+
<data key="scope">websites</data>
27+
<data key="scope_code">base</data>
28+
</entity>
29+
<entity name="SetAllowedCurrenciesConfigForEUR">
30+
<data key="path">currency/options/allow</data>
31+
<data key="value">EUR</data>
32+
<data key="scope">websites</data>
33+
<data key="scope_code">base</data>
34+
</entity>
35+
<entity name="SetAllowedCurrenciesConfigForRUB">
36+
<data key="path">currency/options/allow</data>
37+
<data key="value">RUB</data>
38+
<data key="scope">websites</data>
39+
<data key="scope_code">base</data>
40+
</entity>
41+
<entity name="SetDefaultCurrencyEURConfig">
42+
<data key="path">currency/options/default</data>
43+
<data key="value">EUR</data>
44+
<data key="scope">websites</data>
45+
<data key="scope_code">base</data>
46+
</entity>
47+
<entity name="SetDefaultCurrencyUSDConfig">
48+
<data key="path">currency/options/default</data>
49+
<data key="value">USD</data>
50+
<data key="scope">websites</data>
51+
<data key="scope_code">base</data>
52+
</entity>
53+
</entities>
Lines changed: 14 additions & 0 deletions
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminCurrencyRatesPage" url="admin/system_currency/" area="admin" module="CurrencySymbol">
12+
<section name="AdminCurrencyRatesSection"/>
13+
</page>
14+
</pages>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCurrencyRatesSection">
12+
<element name="import" type="button" selector="//button[@title='Import']"/>
13+
<element name="saveCurrencyRates" type="button" selector="//button[@title='Save Currency Rates']"/>
14+
<element name="oldRate" type="text" selector="//div[contains(@class, 'admin__field-note') and contains(text(), 'Old rate:')]/strong"/>
15+
<element name="currencyRate" type="input" selector="input[name='rate[{{fistCurrency}}][{{secondCurrency}}]']" parameterized="true"/>
16+
</section>
17+
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontSwitchCurrencyRatesSection">
12+
<element name="currencyTrigger" type="select" selector="#switcher-currency-trigger" timeout="30"/>
13+
<element name="currency" type="button" selector="//div[@id='switcher-currency-trigger']/following-sibling::ul//a[contains(text(), '{{currency}}')]" parameterized="true" timeout="10"/>
14+
<element name="selectedCurrency" type="text" selector="#switcher-currency-trigger span"/>
15+
</section>
16+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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="AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest" extends="AdminOrderRateDisplayedInOneLineTest">
12+
<annotations>
13+
<features value="CurrencySymbol"/>
14+
<stories value="Currency rates order page"/>
15+
<title value="Order rate converting currency for 'Base Currency' and 'Default Display Currency' displayed correct"/>
16+
<description value="Order rate converting currency for 'Base Currency' and 'Default Display Currency' displayed correct"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-17255" />
19+
<useCaseId value="MAGETWO-67450"/>
20+
<group value="currency"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<!--Create product-->
25+
<createData entity="SimpleProduct2" stepKey="createNewProduct"/>
26+
<!--Set Currency options for Website-->
27+
<magentoCLI command="config:set --scope={{SetCurrencyUSDBaseConfig.scope}} --scope-code={{SetCurrencyUSDBaseConfig.scope_code}} {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="setCurrencyBaseUSDWebsites"/>
28+
<magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}},{{SetAllowedCurrenciesConfigForRUB.value}}" stepKey="setAllowedCurrencyWebsitesEURandRUBandUSD"/>
29+
<magentoCLI command="config:set --scope={{SetDefaultCurrencyEURConfig.scope}} --scope-code={{SetDefaultCurrencyEURConfig.scope_code}} {{SetDefaultCurrencyEURConfig.path}} {{SetDefaultCurrencyEURConfig.value}}" stepKey="setCurrencyDefaultEURWebsites"/>
30+
</before>
31+
<after>
32+
<!--Delete created product-->
33+
<comment userInput="Delete created product" stepKey="commentDeleteCreatedProduct"/>
34+
<deleteData createDataKey="createNewProduct" stepKey="deleteNewProduct"/>
35+
<actionGroup ref="logout" stepKey="logout"/>
36+
</after>
37+
<!--Set currency rates-->
38+
<amOnPage url="{{AdminCurrencyRatesPage.url}}" stepKey="gotToCurrencyRatesPageSecondTime"/>
39+
<waitForPageLoad stepKey="waitForLoadRatesPageSecondTime"/>
40+
<actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRates">
41+
<argument name="firstCurrency" value="USD"/>
42+
<argument name="secondCurrency" value="RUB"/>
43+
<argument name="rate" value="0.8"/>
44+
</actionGroup>
45+
<!--Open created product on Storefront and place for order-->
46+
<amOnPage url="{{StorefrontProductPage.url($$createNewProduct.custom_attributes[url_key]$$)}}" stepKey="goToNewProductPage"/>
47+
<waitForPageLoad stepKey="waitForNewProductPagePageLoad"/>
48+
<actionGroup ref="StorefrontSwitchCurrency" stepKey="switchCurrency">
49+
<argument name="currency" value="RUB"/>
50+
</actionGroup>
51+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontNewProductPage">
52+
<argument name="productName" value="$$createNewProduct.name$$"/>
53+
</actionGroup>
54+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutNewProductFromMinicart" />
55+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutNewFillingShippingSection">
56+
</actionGroup>
57+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="guestSelectNewCheckMoneyOrderPayment" />
58+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="guestPlaceNewOrder">
59+
<argument name="orderNumberMessage" value="CONST.successGuestCheckoutOrderNumberMessage" />
60+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage" />
61+
</actionGroup>
62+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabNewOrderNumber"/>
63+
<!--Open order and check rates display in one line-->
64+
<actionGroup ref="OpenOrderById" stepKey="openNewOrderById">
65+
<argument name="orderId" value="$grabNewOrderNumber"/>
66+
</actionGroup>
67+
<see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="EUR / USD rate" stepKey="seeUSDandEURRate"/>
68+
<see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="RUB / USD rate:" stepKey="seeRUBandEURRate"/>
69+
<grabMultiple selector="{{AdminOrderDetailsInformationSection.rate}}" stepKey="grabRates" />
70+
<assertEquals stepKey="assertRates">
71+
<actualResult type="variable">grabRates</actualResult>
72+
<expectedResult type="array">['EUR / USD rate:', 'RUB / USD rate:']</expectedResult>
73+
</assertEquals>
74+
</test>
75+
</tests>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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="AdminOrderRateDisplayedInOneLineTest">
12+
<annotations>
13+
<features value="CurrencySymbol"/>
14+
<stories value="Currency rates order page"/>
15+
<title value="Order rate converting currency for 'Base Currency' and 'Default Display Currency' displayed correct once"/>
16+
<description value="Order rate converting currency for 'Base Currency' and 'Default Display Currency' displayed correct once"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-17255" />
19+
<useCaseId value="MAGETWO-67450"/>
20+
<group value="currency"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<!--Create product-->
25+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
26+
<!--Set price scope website-->
27+
<magentoCLI command="config:set {{CatalogPriceScopeWebsiteConfigData.path}} {{CatalogPriceScopeWebsiteConfigData.value}}" stepKey="setCatalogPriceScopeWebsite"/>
28+
<!--Set Currency options for Default Config-->
29+
<magentoCLI command="config:set {{SetCurrencyEURBaseConfig.path}} {{SetCurrencyEURBaseConfig.value}}" stepKey="setCurrencyBaseEUR"/>
30+
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyEURandUSD"/>
31+
<magentoCLI command="config:set {{SetDefaultCurrencyEURConfig.path}} {{SetDefaultCurrencyEURConfig.value}}" stepKey="setCurrencyDefaultEUR"/>
32+
<!--Set Currency options for Website-->
33+
<magentoCLI command="config:set --scope={{SetCurrencyUSDBaseConfig.scope}} --scope-code={{SetCurrencyUSDBaseConfig.scope_code}} {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="setCurrencyBaseEURWebsites"/>
34+
<magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForEUR.value}}" stepKey="setAllowedCurrencyWebsitesForEURandUSD"/>
35+
<magentoCLI command="config:set --scope={{SetDefaultCurrencyEURConfig.scope}} --scope-code={{SetDefaultCurrencyEURConfig.scope_code}} {{SetDefaultCurrencyEURConfig.path}} {{SetDefaultCurrencyEURConfig.value}}" stepKey="setCurrencyDefaultEURWebsites"/>
36+
</before>
37+
<after>
38+
<!--Delete created product-->
39+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
40+
<!--Reset configurations-->
41+
<magentoCLI command="config:set {{CatalogPriceScopeGlobalConfigData.path}} {{CatalogPriceScopeGlobalConfigData.value}}" stepKey="setCatalogPriceScopeGlobal"/>
42+
<magentoCLI command="config:set {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="setCurrencyBaseUSD"/>
43+
<magentoCLI command="config:set {{SetDefaultCurrencyUSDConfig.path}} {{SetDefaultCurrencyUSDConfig.value}}" stepKey="setCurrencyDefaultUSD"/>
44+
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="setAllowedCurrencyUSD"/>
45+
<!--Set Currency options for Website-->
46+
<magentoCLI command="config:set --scope={{SetCurrencyUSDBaseConfig.scope}} --scope-code={{SetCurrencyUSDBaseConfig.scope_code}} {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="setCurrencyBaseUSDWebsites"/>
47+
<magentoCLI command="config:set --scope={{SetDefaultCurrencyUSDConfig.scope}} --scope-code={{SetDefaultCurrencyUSDConfig.scope_code}} {{SetDefaultCurrencyUSDConfig.path}} {{SetDefaultCurrencyUSDConfig.value}}" stepKey="setCurrencyDefaultUSDWebsites"/>
48+
<magentoCLI command="config:set --scope={{SetAllowedCurrenciesConfigForUSD.scope}} --scope-code={{SetAllowedCurrenciesConfigForUSD.scope_code}} {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="setAllowedCurrencyUSDWebsites"/>
49+
<actionGroup ref="logout" stepKey="logout"/>
50+
</after>
51+
<!--Open created product on Storefront and place for order-->
52+
<amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/>
53+
<waitForPageLoad stepKey="waitForProductPagePageLoad"/>
54+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage">
55+
<argument name="productName" value="$$createProduct.name$$"/>
56+
</actionGroup>
57+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart" />
58+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSection">
59+
</actionGroup>
60+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="guestSelectCheckMoneyOrderPayment" />
61+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="guestPlaceOrder">
62+
<argument name="orderNumberMessage" value="CONST.successGuestCheckoutOrderNumberMessage" />
63+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage" />
64+
</actionGroup>
65+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
66+
<!--Open order and check rates display in one line-->
67+
<actionGroup ref="OpenOrderById" stepKey="openOrderById">
68+
<argument name="orderId" value="$grabOrderNumber"/>
69+
</actionGroup>
70+
<see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="EUR / USD rate" stepKey="seeEURandUSDRate"/>
71+
<grabMultiple selector="{{AdminOrderDetailsInformationSection.rate}}" stepKey="grabRate" />
72+
<assertEquals stepKey="assertSelectedCategories">
73+
<actualResult type="variable">grabRate</actualResult>
74+
<expectedResult type="array">[EUR / USD rate:]</expectedResult>
75+
</assertEquals>
76+
</test>
77+
</tests>

0 commit comments

Comments
 (0)