Skip to content

Commit ac180ed

Browse files
committed
ACP2E-1012: No space between a custom currency symbol and a price
1 parent fc2d417 commit ac180ed

File tree

4 files changed

+125
-0
lines changed

4 files changed

+125
-0
lines changed
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="AdminSaveCurrencySymbolMessageData">
12+
<data key="success">You applied the custom currency symbols.</data>
13+
</entity>
14+
</entities>

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,22 @@
152152
<data key="scope">websites</data>
153153
<data key="scope_code">base</data>
154154
</entity>
155+
<entity name="SetCurrencyIDRBaseConfig">
156+
<data key="path">currency/options/base</data>
157+
<data key="value">IDR</data>
158+
<data key="scope">websites</data>
159+
<data key="scope_code">base</data>
160+
</entity>
161+
<entity name="SetDefaultCurrencyIDRConfig">
162+
<data key="path">currency/options/default</data>
163+
<data key="value">IDR</data>
164+
<data key="scope">websites</data>
165+
<data key="scope_code">base</data>
166+
</entity>
167+
<entity name="SetAllowedCurrenciesConfigForIDR">
168+
<data key="path">currency/options/allow</data>
169+
<data key="value">IDR</data>
170+
<data key="scope">websites</data>
171+
<data key="scope_code">base</data>
172+
</entity>
155173
</entities>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCurrencySymbolsGridSection">
1212
<element name="currencyElement" type="input" selector="#currency-symbols-form #custom_currency_symbol{{currency}}" parameterized="true"/>
13+
<element name="currencyCheckElement" type="checkbox" selector="#currency-symbols-form #custom_currency_symbol_inherit{{currency}}" parameterized="true"/>
14+
<element name="saveCurrencySymbols" type="button" selector="//button[@title='Save Currency Symbols']"/>
1315
</section>
1416
</sections>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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="CustomCurrencySymbolWithSpaceTest">
12+
<annotations>
13+
<features value="CurrencySymbol"/>
14+
<stories value="No space between a custom currency symbol and a price."/>
15+
<title value="Custom currency symbol and currency amount separated by single space on storefront and admin dashboard."/>
16+
<description value="Custom currency symbol and currency amount separated by single space on storefront and admin dashboard."/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="AC-6031" />
19+
<useCaseId value="ACP2E-1012"/>
20+
<group value="currency"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<createData entity="_defaultCategory" stepKey="createDefaultCategory"/>
25+
<createData entity="ApiSimpleProduct" stepKey="simpleProduct">
26+
<requiredEntity createDataKey="createDefaultCategory"/>
27+
</createData>
28+
29+
<!--Set Currency options for Default Config-->
30+
<magentoCLI command="config:set {{SetCurrencyIDRBaseConfig.path}} {{SetCurrencyIDRBaseConfig.value}}" stepKey="setCurrencyBaseEUR"/>
31+
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForIDR.path}} {{SetAllowedCurrenciesConfigForUSD.value}},{{SetAllowedCurrenciesConfigForIDR.value}}" stepKey="setAllowedCurrencyEURandUSD"/>
32+
<magentoCLI command="config:set {{SetDefaultCurrencyIDRConfig.path}} {{SetDefaultCurrencyIDRConfig.value}}" stepKey="setCurrencyDefaultEUR"/>
33+
</before>
34+
<after>
35+
<magentoCLI command="config:set {{SetCurrencyUSDBaseConfig.path}} {{SetCurrencyUSDBaseConfig.value}}" stepKey="setCurrencyBaseUSD"/>
36+
<magentoCLI command="config:set {{SetDefaultCurrencyUSDConfig.path}} {{SetDefaultCurrencyUSDConfig.value}}" stepKey="setCurrencyDefaultUSD"/>
37+
<magentoCLI command="config:set {{SetAllowedCurrenciesConfigForUSD.path}} {{SetAllowedCurrenciesConfigForUSD.value}}" stepKey="setAllowedCurrencyUSD"/>
38+
39+
<!--Restore currency symbols to default-->
40+
<actionGroup ref="AdminNavigateToCurrencySymbolsPageActionGroup" stepKey="navigateToCurrencySymbolsPageToRestore"/>
41+
<checkOption selector="{{AdminCurrencySymbolsGridSection.currencyCheckElement(SetAllowedCurrenciesConfigForUSD.value)}}" stepKey="checkConfigSettingsMessage"/>
42+
<click selector="{{AdminCurrencySymbolsGridSection.saveCurrencySymbols}}" stepKey="clickSaveCurrencySymbolsToRestore"/>
43+
44+
<deleteData createDataKey="createDefaultCategory" stepKey="deleteDefaultCategory"/>
45+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
46+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
47+
</after>
48+
<!--Redirect to admin currency setup page-->
49+
<actionGroup ref="AdminNavigateToCurrencySetupPageActionGroup" stepKey="goToCurrencySetupPage"/>
50+
<waitForPageLoad stepKey="waitForProductPagePageLoad"/>
51+
52+
<!--Verify that allowed currency symbols are there in disabled mode-->
53+
<actionGroup ref="AdminNavigateToCurrencySymbolsPageActionGroup" stepKey="navigateToCurrencySymbolsPage"/>
54+
<actionGroup ref="AssertAdminCurrencySymbolIsDisabledActionGroup" stepKey="assertEURDisabledInput">
55+
<argument name="currency" value="{{SetAllowedCurrenciesConfigForIDR.value}}"/>
56+
</actionGroup>
57+
<actionGroup ref="AssertAdminCurrencySymbolIsDisabledActionGroup" stepKey="assertUSDDisabledInput">
58+
<argument name="currency" value="{{SetAllowedCurrenciesConfigForUSD.value}}"/>
59+
</actionGroup>
60+
61+
<!--Replace standard currency symbol by custom currency symbol-->
62+
<uncheckOption selector="{{AdminCurrencySymbolsGridSection.currencyCheckElement(SetAllowedCurrenciesConfigForIDR.value)}}" stepKey="uncheckConfigSettingsMessage"/>
63+
<fillField selector="{{AdminCurrencySymbolsGridSection.currencyElement(SetAllowedCurrenciesConfigForIDR.value)}}" userInput="IDRx" stepKey="fillDefaultLabel"/>
64+
<!--Save custom currency symbol-->
65+
<click selector="{{AdminCurrencySymbolsGridSection.saveCurrencySymbols}}" stepKey="clickSaveCurrencySymbols"/>
66+
<waitForPageLoad stepKey="waitForSave"/>
67+
<see selector="{{AdminMessagesSection.success}}" userInput="{{AdminSaveCurrencySymbolMessageData.success}}" stepKey="seeSuccessMessage"/>
68+
69+
<!--Redirect back to admin dashboard screen-->
70+
<actionGroup ref="AdminReloadDashboardDataActionGroup" stepKey="reloadDashboardData" />
71+
<!--Verify there is a space between custom currency symbol respective amounts on admin dashboard-->
72+
<grabTextFrom selector="{{AdminDashboardSection.dashboardTotals('Revenue')}}" stepKey="grabStartQuantity"/>
73+
<assertEquals stepKey="assertInputIsDisabled">
74+
<actualResult type="const">$grabStartQuantity</actualResult>
75+
<expectedResult type="string">IDRx 0.00</expectedResult>
76+
</assertEquals>
77+
78+
<!--Verify Category in store front page-->
79+
<amOnPage url="{{StorefrontCategoryPage.url($createDefaultCategory.custom_attributes[url_key]$)}}" stepKey="openStorefrontCategoryPage"/>
80+
<!--Verify product name is on Store Front-->
81+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="assertProductOnStorefrontProductPage">
82+
<argument name="product" value="$simpleProduct$"/>
83+
</actionGroup>
84+
<!--Verify there is a space space between custom currency symbol and product price on Store Front-->
85+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.asLowAs}}" stepKey="grabProductPrice"/>
86+
<assertEquals message="ExpectedPrice" stepKey="assertBundleProductPrice">
87+
<actualResult type="variable">grabProductPrice</actualResult>
88+
<expectedResult type="string">IDRx {{ApiSimpleProduct.price}}</expectedResult>
89+
</assertEquals>
90+
</test>
91+
</tests>

0 commit comments

Comments
 (0)