|
| 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