|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2024 Adobe |
| 5 | + * All Rights Reserved. |
| 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="StorefrontCheckBundlePriceInOtherCurrencyWithSpecialPriceTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Bundle"/> |
| 14 | + <title value="Bundle price on Storefront in other currency with special price"/> |
| 15 | + <description value="Checks bundle price in other currency on Storefront when special price is applied"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-15624"/> |
| 18 | + <useCaseId value="ACP2E-4110"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Set currency --> |
| 22 | + <magentoCLI command="config:set currency/options/allow EUR,GBP,USD" stepKey="setCurrencyAllow"/> |
| 23 | + <magentoCLI command="config:set currency/options/default GBP" stepKey="setCurrencyDisplay"/> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 25 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="gotToCurrencyRatesPage"/> |
| 26 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRate"> |
| 27 | + <argument name="firstCurrency" value="USD"/> |
| 28 | + <argument name="secondCurrency" value="GBP"/> |
| 29 | + <argument name="rate" value="0.75"/> |
| 30 | + </actionGroup> |
| 31 | + <!-- Create Category --> |
| 32 | + <createData entity="SimpleSubCategory" stepKey="createSubCategory"/> |
| 33 | + <!-- Create bundle Product --> |
| 34 | + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> |
| 35 | + <field key="price">40.25</field> |
| 36 | + </createData> |
| 37 | + <createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct"> |
| 38 | + <requiredEntity createDataKey="createSubCategory"/> |
| 39 | + </createData> |
| 40 | + <createData entity="DropDownBundleOption" stepKey="createBundleOption1_1"> |
| 41 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 42 | + <field key="required">True</field> |
| 43 | + </createData> |
| 44 | + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> |
| 45 | + <requiredEntity createDataKey="createBundleProduct"/> |
| 46 | + <requiredEntity createDataKey="createBundleOption1_1"/> |
| 47 | + <requiredEntity createDataKey="simpleProduct1"/> |
| 48 | + </createData> |
| 49 | + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToBundleProduct"> |
| 50 | + <argument name="product" value="$$createBundleProduct$$"/> |
| 51 | + </actionGroup> |
| 52 | + <grabTextFrom selector="{{AdminProductFormBundleSection.currentBundleOption}}" stepKey="grabBundleOption"/> |
| 53 | + <assertNotEmpty stepKey="assertBundleOptionNotEmpty"> |
| 54 | + <actualResult type="const">$grabBundleOption</actualResult> |
| 55 | + </assertNotEmpty> |
| 56 | + <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceToProduct"> |
| 57 | + <argument name="price" value="97.5"/> |
| 58 | + </actionGroup> |
| 59 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> |
| 60 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductGridFilters"/> |
| 61 | + <!-- Reindex and clear cache --> |
| 62 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexConfig"> |
| 63 | + <argument name="indices" value=""/> |
| 64 | + </actionGroup> |
| 65 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCache"> |
| 66 | + <argument name="tags" value="config full_page"/> |
| 67 | + </actionGroup> |
| 68 | + </before> |
| 69 | + |
| 70 | + <after> |
| 71 | + <!-- Delete products and category --> |
| 72 | + <deleteData createDataKey="createSubCategory" stepKey="deleteCategory1"/> |
| 73 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> |
| 74 | + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> |
| 75 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 76 | + <!-- Revert currency settings --> |
| 77 | + <magentoCLI command="config:set currency/options/default USD" stepKey="unsetCurrencyDisplay"/> |
| 78 | + <magentoCLI command="config:set currency/options/allow EUR,USD" stepKey="unsetCurrencyAllow"/> |
| 79 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexConfigAfterReverting"> |
| 80 | + <argument name="indices" value=""/> |
| 81 | + </actionGroup> |
| 82 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanFullPageCacheAfterReverting"> |
| 83 | + <argument name="tags" value="config full_page"/> |
| 84 | + </actionGroup> |
| 85 | + </after> |
| 86 | + |
| 87 | + <!-- Open Bundle product page --> |
| 88 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> |
| 89 | + <argument name="productUrl" value="$$createBundleProduct.custom_attributes[url_key]$$"/> |
| 90 | + </actionGroup> |
| 91 | + <waitForPageLoad stepKey="waitForStorefrontPage"/> |
| 92 | + |
| 93 | + <!-- Assert Bundle Product Price --> |
| 94 | + <see userInput="£29.43" selector="{{StorefrontProductInfoMainSection.fixedFinalPrice}}" stepKey="seeBundlePrice"/> |
| 95 | + |
| 96 | + </test> |
| 97 | +</tests> |
0 commit comments