|
| 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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="StorefrontApplyCatalogRuleForSimpleProductsWithCustomOptionsMultiCurrencyStoreTest"> |
| 11 | + <annotations> |
| 12 | + <features value="CatalogRule"/> |
| 13 | + <stories value="Apply catalog price rule"/> |
| 14 | + <title value="Admin should be able to apply the catalog price rule for simple product with 1 custom options in multi currency store"/> |
| 15 | + <description value="Admin should be able to apply the catalog price rule for simple product with 1 custom options in multi currency store"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <testCaseId value="AC-2688"/> |
| 18 | + <group value="catalogRule"/> |
| 19 | + <group value="catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlEnable"/> |
| 23 | + |
| 24 | + <!-- Login as Admin --> |
| 25 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 26 | + |
| 27 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 28 | + <argument name="customStore" value="customStore"/> |
| 29 | + </actionGroup> |
| 30 | + |
| 31 | + <actionGroup ref="AdminNavigateToCurrencySetupPageActionGroup" stepKey="goToCurrencySetupPage"/> |
| 32 | + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToDefaultStoreView"> |
| 33 | + <argument name="storeView" value="_defaultStore.name"/> |
| 34 | + </actionGroup> |
| 35 | + <uncheckOption selector="{{AdminConfigSection.allowedCurrencyCheckbox}}" stepKey="uncheckUseSystemValueDisplayCurrency"/> |
| 36 | + <uncheckOption selector="{{AdminConfigSection.defaultCurrencyCheckbox}}" stepKey="uncheckUseSystemValueAllowedCurrency"/> |
| 37 | + <selectOption selector="{{AdminConfigSection.defaultCurrency}}" userInput="Euro" stepKey="selectAllowedDisplayCurrency"/> |
| 38 | + <selectOption selector="{{AdminConfigSection.allowedCurrencies}}" parameterArray="['Euro']" stepKey="selectDefaultDisplayCurrency"/> |
| 39 | + <actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration"/> |
| 40 | + |
| 41 | + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToDefaultStoreViewCustom"> |
| 42 | + <argument name="storeView" value="customStore.name"/> |
| 43 | + </actionGroup> |
| 44 | + <uncheckOption selector="{{AdminConfigSection.allowedCurrencyCheckbox}}" stepKey="uncheckUseSystemValueDisplayCurrency1"/> |
| 45 | + <uncheckOption selector="{{AdminConfigSection.defaultCurrencyCheckbox}}" stepKey="uncheckUseSystemValueAllowedCurrency1"/> |
| 46 | + <selectOption selector="{{AdminConfigSection.defaultCurrency}}" userInput="Norwegian Krone" stepKey="selectAllowedDisplayCurrency1"/> |
| 47 | + <selectOption selector="{{AdminConfigSection.allowedCurrencies}}" parameterArray="['Norwegian Krone']" stepKey="selectDefaultDisplayCurrency1"/> |
| 48 | + <actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration1"/> |
| 49 | + |
| 50 | + <actionGroup ref="AdminOpenCurrencyRatesPageActionGroup" stepKey="gotToCurrencyRatesPageSecondTime"/> |
| 51 | + <comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForLoadRatesPageSecondTime"/> |
| 52 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRates"> |
| 53 | + <argument name="firstCurrency" value="USD"/> |
| 54 | + <argument name="secondCurrency" value="EUR"/> |
| 55 | + <argument name="rate" value="1"/> |
| 56 | + </actionGroup> |
| 57 | + <actionGroup ref="AdminSetCurrencyRatesActionGroup" stepKey="setCurrencyRatesNOK"> |
| 58 | + <argument name="firstCurrency" value="USD"/> |
| 59 | + <argument name="secondCurrency" value="NOK"/> |
| 60 | + <argument name="rate" value="10"/> |
| 61 | + </actionGroup> |
| 62 | + |
| 63 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 64 | + <createData entity="_defaultProduct" stepKey="createProduct1"> |
| 65 | + <requiredEntity createDataKey="createCategory"/> |
| 66 | + <field key="price">10</field> |
| 67 | + </createData> |
| 68 | + |
| 69 | + <!-- Update all products to have custom options --> |
| 70 | + <updateData createDataKey="createProduct1" entity="productWithCheckbox" stepKey="updateProductWithOptions"/> |
| 71 | + |
| 72 | + <!-- Clear all catalog price rules before test --> |
| 73 | + <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogRulesBeforeTest"/> |
| 74 | + <magentoCron groups="index" stepKey="fixInvalidatedIndicesBeforeTest"/> |
| 75 | + </before> |
| 76 | + <after> |
| 77 | + <magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlDisable"/> |
| 78 | + |
| 79 | + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView1"> |
| 80 | + <argument name="customStore" value="customStore"/> |
| 81 | + </actionGroup> |
| 82 | + |
| 83 | + <actionGroup ref="AdminNavigateToCurrencySetupPageActionGroup" stepKey="goToCurrencySetupPage"/> |
| 84 | + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToDefaultStoreView"> |
| 85 | + <argument name="storeView" value="_defaultStore.name"/> |
| 86 | + </actionGroup> |
| 87 | + <actionGroup ref="AdminCheckUseSystemValueActionGroup" stepKey="checkUseSystemValueForAllowedCurrency"> |
| 88 | + <argument name="rowId" value="row_currency_options_allow"/> |
| 89 | + </actionGroup> |
| 90 | + <actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration"/> |
| 91 | + |
| 92 | + <!-- Delete products and category --> |
| 93 | + <deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> |
| 94 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 95 | + |
| 96 | + <!-- Delete the catalog price rule --> |
| 97 | + <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogRulesAfterTest"/> |
| 98 | + <magentoCron groups="index" stepKey="fixInvalidatedIndicesAfterTest"/> |
| 99 | + |
| 100 | + <!-- Logout --> |
| 101 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> |
| 102 | + </after> |
| 103 | + <!-- 1. Begin creating a new catalog price rule --> |
| 104 | + <actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="openNewCatalogPriceRulePage"/> |
| 105 | + <actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForCatalogPriceRule"> |
| 106 | + <argument name="groups" value="'NOT LOGGED IN'"/> |
| 107 | + </actionGroup> |
| 108 | + <actionGroup ref="AdminFillCatalogRuleConditionActionGroup" stepKey="fillConditionsForCatalogPriceRule"> |
| 109 | + <argument name="conditionValue" value="$createCategory.id$"/> |
| 110 | + </actionGroup> |
| 111 | + <actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForCatalogPriceRule"> |
| 112 | + <argument name="apply" value="by_percent"/> |
| 113 | + <argument name="discountAmount" value="10"/> |
| 114 | + </actionGroup> |
| 115 | + <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> |
| 116 | + |
| 117 | + |
| 118 | + <!-- Navigate to product 1 on store front --> |
| 119 | + <actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl"> |
| 120 | + <argument name="product" value="$createProduct1$"/> |
| 121 | + <argument name="storeView" value="customStore"/> |
| 122 | + </actionGroup> |
| 123 | + |
| 124 | + <actionGroup ref="AssertStorefrontCustomOptionCheckboxByPriceActionGroup" stepKey="checkPriceProductOptionEUR"> |
| 125 | + <argument name="price" value="110.7"/> |
| 126 | + </actionGroup> |
| 127 | + </test> |
| 128 | +</tests> |
0 commit comments