|
| 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="TierPricingWhenPriceScopeIsWebsiteWorkingProperlyWithMultipleCurrenciesConfiguredTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Tire Price"/> |
| 14 | + <title value="Tier pricing when price scope is Website working properly with multiple currencies configured"/> |
| 15 | + <description value="Tier pricing when price scope is Website working properly with multiple currencies configured"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-6094"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- Set in Stores > Configuration > Catalog > Catalog > Price - Catalog Price Scope = "Website" --> |
| 21 | + <magentoCLI command="config:set {{WebsiteCatalogPriceScopeConfigData.path}} {{WebsiteCatalogPriceScopeConfigData.value}}" stepKey="setPriceScopeWebsite"/> |
| 22 | + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> |
| 23 | + <field key="price">100.00</field> |
| 24 | + </createData> |
| 25 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 26 | + <!-- Create website, Store and Store View --> |
| 27 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> |
| 28 | + <argument name="newWebsiteName" value="{{NewWebSiteData.name}}"/> |
| 29 | + <argument name="websiteCode" value="{{NewWebSiteData.code}}"/> |
| 30 | + </actionGroup> |
| 31 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore"> |
| 32 | + <argument name="website" value="{{NewWebSiteData.name}}"/> |
| 33 | + <argument name="storeGroupName" value="{{NewStoreData.name}}"/> |
| 34 | + <argument name="storeGroupCode" value="{{NewStoreData.code}}"/> |
| 35 | + </actionGroup> |
| 36 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 37 | + <argument name="StoreGroup" value="NewStoreData"/> |
| 38 | + <argument name="customStore" value="NewStoreViewData"/> |
| 39 | + </actionGroup> |
| 40 | + <amOnPage url="{{ConfigCurrencySetupPage.url}}" stepKey="navigateToConfigCurrencySetupPage1"/> |
| 41 | + <click selector="{{CurrencySetupSection.currencyOptions}}" stepKey="openCurrencyOptions"/> |
| 42 | + <selectOption selector="{{CurrencySetupSection.baseCurrency}}" userInput="Swedish Krona" stepKey="setBaseCurrencyField"/> |
| 43 | + <selectOption selector="{{CurrencySetupSection.allowCurrencies}}" parameterArray="['Euro', 'US Dollar']" stepKey="selectCurrencies"/> |
| 44 | + <click stepKey="saveConfigs" selector="{{AdminConfigSection.saveButton}}"/> |
| 45 | + <wait time="15" stepKey="waitfordefaultupdate"/> |
| 46 | + <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="AdminSwitchStoreView"> |
| 47 | + <argument name="website" value="NewWebSiteData"/> |
| 48 | + </actionGroup> |
| 49 | + <waitForPageLoad stepKey="waitForPageLoad7"/> |
| 50 | + <actionGroup ref="AdminSetBaseCurrencyActionGroup" stepKey="setBaseCurrencyEUR"> |
| 51 | + <argument name="currency" value="Euro"/> |
| 52 | + </actionGroup> |
| 53 | + <actionGroup ref="AdminSetDefaultCurrencyActionGroup" stepKey="setDefaultCurrencyEUR"> |
| 54 | + <argument name="currency" value="Euro"/> |
| 55 | + </actionGroup> |
| 56 | + <uncheckOption selector="{{CurrencySetupSection.allowcurrenciescheckbox}}" stepKey="uncheckAllowCurrencyUseDefaultOption1"/> |
| 57 | + <unselectOption selector="{{CurrencySetupSection.allowCurrencies}}" parameterArray="['US Dollar']" stepKey="deselectUSCurrency"/> |
| 58 | + <click stepKey="saveConfigs1" selector="{{AdminConfigSection.saveButton}}"/> |
| 59 | + <wait time="15" stepKey="waitforNewWebsiteupdate"/> |
| 60 | + <click selector="{{AdminMainActionsSection.storeViewDropdown}}" stepKey="clickWebsiteSwitchDropdown"/> |
| 61 | + <waitForElementVisible selector="{{AdminMainActionsSection.websiteByName('Main Website')}}" stepKey="waitForWebsiteAreVisible"/> |
| 62 | + <click selector="{{AdminMainActionsSection.allStoreViews}}" stepKey="clickWebsiteByName"/> |
| 63 | + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitingForInformationModal"/> |
| 64 | + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmStoreSwitch"/> |
| 65 | + <waitForPageLoad stepKey="waitForPageLoad8"/> |
| 66 | + |
| 67 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="gotToCurrencyRatesPage"/> |
| 68 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="revertCurrencyRates1"> |
| 69 | + <argument name="firstCurrency" value="EUR"/> |
| 70 | + <argument name="secondCurrency" value="SEK"/> |
| 71 | + <argument name="rate" value="10.7500"/> |
| 72 | + </actionGroup> |
| 73 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="revertCurrencyRates2"> |
| 74 | + <argument name="firstCurrency" value="EUR"/> |
| 75 | + <argument name="secondCurrency" value="USD"/> |
| 76 | + <argument name="rate" value="1.1200"/> |
| 77 | + </actionGroup> |
| 78 | + |
| 79 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="revertCurrencyRates3"> |
| 80 | + <argument name="firstCurrency" value="SEK"/> |
| 81 | + <argument name="secondCurrency" value="EUR"/> |
| 82 | + <argument name="rate" value="0.0930"/> |
| 83 | + </actionGroup> |
| 84 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="revertCurrencyRates4"> |
| 85 | + <argument name="firstCurrency" value="SEK"/> |
| 86 | + <argument name="secondCurrency" value="USD"/> |
| 87 | + <argument name="rate" value="0.1000"/> |
| 88 | + </actionGroup> |
| 89 | + <magentoCron groups="index" stepKey="reindex"/> |
| 90 | + |
| 91 | + <!-- Go to Catalog -> Products --> |
| 92 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductPage"/> |
| 93 | + |
| 94 | + <!-- Click Edit option for Simple2 --> |
| 95 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterSimopleProduct2"> |
| 96 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 97 | + </actionGroup> |
| 98 | + <click selector="{{AdminDataGridTableSection.rowViewAction('1')}}" stepKey="clickProduct2"/> |
| 99 | + <waitForPageLoad stepKey="waitForEditProductPage"/> |
| 100 | + |
| 101 | + <actionGroup ref="ProductSetAdvancedPricingWithIndexActionGroup" stepKey="addProductTierPrice1"> |
| 102 | + <argument name="quantity" value="10"/> |
| 103 | + <argument name="price" value="Discount"/> |
| 104 | + <argument name="amount" value="10"/> |
| 105 | + <argument name="index" value="0"/> |
| 106 | + </actionGroup> |
| 107 | + <actionGroup ref="ProductSetAdvancedPricingWithIndexActionGroup" stepKey="addProductTierPrice2"> |
| 108 | + <argument name="quantity" value="20"/> |
| 109 | + <argument name="price" value="Discount"/> |
| 110 | + <argument name="amount" value="20"/> |
| 111 | + <argument name="index" value="1"/> |
| 112 | + </actionGroup> |
| 113 | + <actionGroup ref="ProductSetAdvancedPricingWithIndexActionGroup" stepKey="addProductTierPrice3"> |
| 114 | + <argument name="quantity" value="30"/> |
| 115 | + <argument name="price" value="Discount"/> |
| 116 | + <argument name="amount" value="30"/> |
| 117 | + <argument name="index" value="2"/> |
| 118 | + </actionGroup> |
| 119 | + <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteForProduct2"> |
| 120 | + <argument name="website" value="{{NewWebSiteData.name}}"/> |
| 121 | + </actionGroup> |
| 122 | + <uncheckOption selector="{{ProductInWebsitesSection.website(_defaultWebsite.name)}}" stepKey="uncheckMainWebsite"/> |
| 123 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> |
| 124 | + <actionGroup ref="AdminGoCreatedWebsitePageActionGroup" stepKey="openWebsiteToGetId"> |
| 125 | + <argument name="websiteName" value="{{NewWebSiteData.name}}"/> |
| 126 | + </actionGroup> |
| 127 | + <click selector="{{AdminNewWebsiteActionsSection.setAsDefault}}" stepKey="setNewWebsiteAsDefault"/> |
| 128 | + <click selector="{{AdminNewWebsiteActionsSection.saveWebsite}}" stepKey="clickSaveNewWebsite"/> |
| 129 | + <waitForPageLoad stepKey="waitForSuccess"/> |
| 130 | + </before> |
| 131 | + <after> |
| 132 | + <magentoCLI command="config:set {{GlobalCatalogPriceScopeConfigData.path}} {{GlobalCatalogPriceScopeConfigData.value}}" stepKey="setPriceScopeGlobal"/> |
| 133 | + <amOnPage url="{{ConfigCurrencySetupPage.url}}" stepKey="navigateToConfigCurrencySetupPage2"/> |
| 134 | + <click selector="{{CurrencySetupSection.currencyOptions}}" stepKey="openCurrencyOptions2"/> |
| 135 | + <click selector="{{CurrencySetupSection.currencyOptions}}" stepKey="openCurrencyOptions3"/> |
| 136 | + <selectOption selector="{{CurrencySetupSection.baseCurrency}}" userInput="US Dollar" stepKey="setBaseCurrencyFieldUSD"/> |
| 137 | + <unselectOption selector="{{CurrencySetupSection.allowCurrencies}}" parameterArray="['Euro']" stepKey="unselectCurrencies"/> |
| 138 | + <click stepKey="saveConfigs" selector="{{AdminConfigSection.saveButton}}"/> |
| 139 | + <!-- Delete data --> |
| 140 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 141 | + <actionGroup ref="AdminGoCreatedWebsitePageActionGroup" stepKey="openOldWebsiteToGetId"> |
| 142 | + <argument name="websiteName" value="{{_defaultWebsite.name}}"/> |
| 143 | + </actionGroup> |
| 144 | + <click selector="{{AdminNewWebsiteActionsSection.setAsDefault}}" stepKey="setOldWebsiteAsDefault"/> |
| 145 | + <click selector="{{AdminNewWebsiteActionsSection.saveWebsite}}" stepKey="clickSaveOldWebsite"/> |
| 146 | + <waitForPageLoad stepKey="waitForSuccess"/> |
| 147 | + |
| 148 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> |
| 149 | + <argument name="websiteName" value="{{NewWebSiteData.name}}"/> |
| 150 | + </actionGroup> |
| 151 | + <magentoCron groups="index" stepKey="reindex"/> |
| 152 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 153 | + </after> |
| 154 | + <!-- Click Edit option for Simple2 --> |
| 155 | + <!-- Go to Catalog -> Products --> |
| 156 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductPage1"/> |
| 157 | + |
| 158 | + <!-- Click Edit option for Simple2 --> |
| 159 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterSimopleProduct3"> |
| 160 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 161 | + </actionGroup> |
| 162 | + <click selector="{{AdminDataGridTableSection.rowViewAction('1')}}" stepKey="clickProduct3"/> |
| 163 | + <waitForPageLoad stepKey="waitForEditProductPage"/> |
| 164 | + |
| 165 | + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="fillPrice"> |
| 166 | + <argument name="price" value="10"/> |
| 167 | + </actionGroup> |
| 168 | + <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveSimpleProduct1"/> |
| 169 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage"/> |
| 170 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront"> |
| 171 | + <argument name="product" value="$createSimpleProduct$"/> |
| 172 | + </actionGroup> |
| 173 | + <actionGroup ref="AssertStorefrontProductDetailPageTierPriceWithCurrencyActionGroup" stepKey="assertProductTierPriceText"> |
| 174 | + <argument name="tierProductPriceDiscountQuantity" value="10"/> |
| 175 | + <argument name="productPriceWithAppliedTierPriceDiscount" value="0.84"/> |
| 176 | + <argument name="productSavedPricePercent" value="92"/> |
| 177 | + <argument name="index" value="1"/> |
| 178 | + </actionGroup> |
| 179 | + <actionGroup ref="AssertStorefrontProductDetailPageTierPriceWithCurrencyActionGroup" stepKey="assertProductTierPriceText2"> |
| 180 | + <argument name="tierProductPriceDiscountQuantity" value="20"/> |
| 181 | + <argument name="productPriceWithAppliedTierPriceDiscount" value="0.74"/> |
| 182 | + <argument name="productSavedPricePercent" value="93"/> |
| 183 | + <argument name="index" value="2"/> |
| 184 | + </actionGroup> |
| 185 | + <actionGroup ref="AssertStorefrontProductDetailPageTierPriceWithCurrencyActionGroup" stepKey="assertProductTierPriceText3"> |
| 186 | + <argument name="tierProductPriceDiscountQuantity" value="30"/> |
| 187 | + <argument name="productPriceWithAppliedTierPriceDiscount" value="0.65"/> |
| 188 | + <argument name="productSavedPricePercent" value="94"/> |
| 189 | + <argument name="index" value="3"/> |
| 190 | + </actionGroup> |
| 191 | + </test> |
| 192 | +</tests> |
0 commit comments