|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2024 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminAsLowAsPriceNotDisplayedForDifferentWebsiteCatalogPriceScopeWebsiteTest"> |
| 11 | + <annotations> |
| 12 | + <features value="ConfigurableProduct"/> |
| 13 | + <stories value="As low as pricing behaviour for products across multiple websites"/> |
| 14 | + <title value="Customer should not see 'As low as' label for products with different website prices"/> |
| 15 | + <description value="Ensure that the 'As low as' label is not shown for Product with varied pricing across websites when catalog price scope is set to website"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-4270"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <createData entity="ApiCategory" stepKey="createFirstCategory"/> |
| 21 | + <createData entity="NewRootCategory" stepKey="createRootCategory"/> |
| 22 | + <createData entity="SimpleRootSubCategory" stepKey="createSecondCategory"> |
| 23 | + <requiredEntity createDataKey="createRootCategory"/> |
| 24 | + </createData> |
| 25 | + <!--Set catalog price scope to Website--> |
| 26 | + <actionGroup ref="AdminSetCatalogPriceToWebsiteActionGroup" stepKey="setPriceScopeWebsite"/> |
| 27 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct"> |
| 28 | + <field key="name">Configurable product p1</field> |
| 29 | + <requiredEntity createDataKey="createFirstCategory"/> |
| 30 | + </createData> |
| 31 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 32 | + <!--Create website--> |
| 33 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> |
| 34 | + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> |
| 35 | + <argument name="websiteCode" value="{{customWebsite.code}}"/> |
| 36 | + </actionGroup> |
| 37 | + <!--Create custom store group--> |
| 38 | + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> |
| 39 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 40 | + <argument name="store" value="{{customStoreGroup.name}}"/> |
| 41 | + <argument name="rootCategory" value="$$createRootCategory.name$$"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createNewStoreView"> |
| 44 | + <argument name="StoreGroup" value="customStoreGroup"/> |
| 45 | + <argument name="customStore" value="customStore"/> |
| 46 | + </actionGroup> |
| 47 | + <!-- Create text swatch attribute with 3 options: Black, White and Blue --> |
| 48 | + <actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute"> |
| 49 | + <argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/> |
| 50 | + <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> |
| 51 | + <argument name="option1" value="Red"/> |
| 52 | + <argument name="option2" value="Green"/> |
| 53 | + <argument name="option3" value="Blue"/> |
| 54 | + </actionGroup> |
| 55 | + <!-- Open configurable product edit page --> |
| 56 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProduct"> |
| 57 | + <argument name="productId" value="$createConfigurableProduct.id$"/> |
| 58 | + </actionGroup> |
| 59 | + <!-- Generate configurations for configurable product p1 --> |
| 60 | + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createProductConfigurations"> |
| 61 | + <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> |
| 62 | + </actionGroup> |
| 63 | + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForRed"> |
| 64 | + <argument name="productAttributes" value="Color: Red"/> |
| 65 | + <argument name="productPrice" value="10"/> |
| 66 | + </actionGroup> |
| 67 | + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForGreen"> |
| 68 | + <argument name="productAttributes" value="Color: Green"/> |
| 69 | + <argument name="productPrice" value="10"/> |
| 70 | + </actionGroup> |
| 71 | + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForBlue"> |
| 72 | + <argument name="productAttributes" value="Color: Blue"/> |
| 73 | + <argument name="productPrice" value="10"/> |
| 74 | + </actionGroup> |
| 75 | + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> |
| 76 | + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsiteSecondForConfigurable"> |
| 77 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 78 | + </actionGroup> |
| 79 | + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignProductToSecondCategory"> |
| 80 | + <argument name="categoryName" value="$$createSecondCategory.name$$"/> |
| 81 | + </actionGroup> |
| 82 | + <!-- Open Red product edit page --> |
| 83 | + <actionGroup ref="SearchForProductOnBackendByNameActionGroup" stepKey="searchForRedProduct"> |
| 84 | + <argument name="productName" value="red"/> |
| 85 | + </actionGroup> |
| 86 | + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="openRedProduct"/> |
| 87 | + <waitForElement selector="{{AdminProductFormSection.visibility}}" stepKey="waitForVisibilityToBeVisibleForRed"/> |
| 88 | + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="Catalog, Search" stepKey="selectVisibilityForRed"/> |
| 89 | + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignRedProductToSecondCategory"> |
| 90 | + <argument name="categoryName" value="$$createSecondCategory.name$$"/> |
| 91 | + </actionGroup> |
| 92 | + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsiteSecondForRed"> |
| 93 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 94 | + </actionGroup> |
| 95 | + <!-- Open blue product edit page --> |
| 96 | + <actionGroup ref="SearchForProductOnBackendByNameActionGroup" stepKey="searchForBlueProduct"> |
| 97 | + <argument name="productName" value="blue"/> |
| 98 | + </actionGroup> |
| 99 | + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="openBlueProduct"/> |
| 100 | + <waitForElement selector="{{AdminProductFormSection.visibility}}" stepKey="waitForVisibilityToBeVisibleForBlue"/> |
| 101 | + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="Catalog, Search" stepKey="selectVisibilityForBlue"/> |
| 102 | + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignBlueProductToSecondCategory"> |
| 103 | + <argument name="categoryName" value="$$createSecondCategory.name$$"/> |
| 104 | + </actionGroup> |
| 105 | + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsiteSecondForBlue"> |
| 106 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 107 | + </actionGroup> |
| 108 | + <!-- Open Green product edit page --> |
| 109 | + <actionGroup ref="SearchForProductOnBackendByNameActionGroup" stepKey="searchForGreenProduct"> |
| 110 | + <argument name="productName" value="Green"/> |
| 111 | + </actionGroup> |
| 112 | + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="openGreenProduct"/> |
| 113 | + <waitForElement selector="{{AdminProductFormSection.visibility}}" stepKey="waitForVisibilityToBeVisibleForGreen"/> |
| 114 | + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="Catalog, Search" stepKey="selectVisibilityForGreen"/> |
| 115 | + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignGreenProductToSecondCategory"> |
| 116 | + <argument name="categoryName" value="$$createSecondCategory.name$$"/> |
| 117 | + </actionGroup> |
| 118 | + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsiteSecondForGreen"> |
| 119 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 120 | + </actionGroup> |
| 121 | + <!-- Open Red product edit page --> |
| 122 | + <actionGroup ref="SearchForProductOnBackendByNameActionGroup" stepKey="searchForRedProductAgain"> |
| 123 | + <argument name="productName" value="red"/> |
| 124 | + </actionGroup> |
| 125 | + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="againOpenRedProduct"/> |
| 126 | + <!-- Switch to custom website store view --> |
| 127 | + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView"> |
| 128 | + <argument name="storeView" value="customStore.name"/> |
| 129 | + </actionGroup> |
| 130 | + <uncheckOption selector="{{AdminProductFormSection.productPriceUseDefault}}" stepKey="uncheckPriceDefaultValue"/> |
| 131 | + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="5" stepKey="fillSimpleProductPrice"/> |
| 132 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveRedProductInCustomStoreView"/> |
| 133 | + <!-- Switch to the All store view --> |
| 134 | + <actionGroup ref="AdminSwitchToAllStoreViewActionGroup" stepKey="switchAllStoreViewProduct"/> |
| 135 | + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="1" stepKey="fillSimpleProductPriceInAllStoreView"/> |
| 136 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductInAllStoreView"/> |
| 137 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> |
| 138 | + <argument name="indices" value="catalog_category_product catalog_product_category"/> |
| 139 | + </actionGroup> |
| 140 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCache"> |
| 141 | + <argument name="tags" value="full_page"/> |
| 142 | + </actionGroup> |
| 143 | + </before> |
| 144 | + <after> |
| 145 | + <!--set main website as default--> |
| 146 | + <actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="setMainWebsiteAsDefault"> |
| 147 | + <argument name="websiteName" value="Main Website"/> |
| 148 | + </actionGroup> |
| 149 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> |
| 150 | + <argument name="websiteName" value="{{customWebsite.name}}"/> |
| 151 | + </actionGroup> |
| 152 | + <deleteData createDataKey="createFirstCategory" stepKey="deleteCategory"/> |
| 153 | + <deleteData createDataKey="createSecondCategory" stepKey="deleteSubCategory"/> |
| 154 | + <deleteData createDataKey="createRootCategory" stepKey="deleteRootCategory"/> |
| 155 | + <actionGroup ref="AdminSetDefaultCatalogPriceActionGroup" stepKey="setDefaultCatalogConfigurations"/> |
| 156 | + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteCreatedProducts"/> |
| 157 | + <!-- Delete color attribute --> |
| 158 | + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute"> |
| 159 | + <argument name="ProductAttribute" value="ProductColorAttribute"/> |
| 160 | + </actionGroup> |
| 161 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAfter"> |
| 162 | + <argument name="indices" value="catalog_category_product catalog_product_category"/> |
| 163 | + </actionGroup> |
| 164 | + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCacheAfter"> |
| 165 | + <argument name="tags" value="full_page"/> |
| 166 | + </actionGroup> |
| 167 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> |
| 168 | + </after> |
| 169 | + <!-- Open created category on Storefront --> |
| 170 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPageOnMainWebsite"> |
| 171 | + <argument name="category" value="$createFirstCategory$"/> |
| 172 | + </actionGroup> |
| 173 | + <actionGroup ref="StorefrontAssertProductPriceAndPriceLabelIsNotPresentOnCategoryPageActionGroup" stepKey="assertPriceAndPriceLabelForProductOnMainWebsite"> |
| 174 | + <argument name="productName" value="Configurable product p1-Red"/> |
| 175 | + <argument name="price" value="1"/> |
| 176 | + <argument name="priceLabel" value="As low as"/> |
| 177 | + </actionGroup> |
| 178 | + <actionGroup ref="StorefrontOpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategoryPageOnMainWebsite"> |
| 179 | + <argument name="productName" value="Configurable product p1-Red"/> |
| 180 | + </actionGroup> |
| 181 | + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeAsLowAsLabelProducPageOnMainWebsite"/> |
| 182 | + <actionGroup ref="AssertStorefrontProductDetailPageFinalPriceActionGroup" stepKey="assertProductFinalPriceForRedOnMainWebsite"> |
| 183 | + <argument name="finalProductPrice" value="1.00"/> |
| 184 | + </actionGroup> |
| 185 | + <actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="SetSecondaryWebsiteAsDefault"> |
| 186 | + <argument name="websiteName" value="{{customWebsite.name}}"/> |
| 187 | + </actionGroup> |
| 188 | + <!-- Clean config and full page cache--> |
| 189 | + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> |
| 190 | + <argument name="tags" value="config full_page"/> |
| 191 | + </actionGroup> |
| 192 | + <!-- Open created second category on second website --> |
| 193 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPageOnSecondWebsite"> |
| 194 | + <argument name="category" value="$createSecondCategory$"/> |
| 195 | + </actionGroup> |
| 196 | + <actionGroup ref="StorefrontAssertProductPriceAndPriceLabelIsNotPresentOnCategoryPageActionGroup" stepKey="assertPriceAndPriceLabelForProductOnSecondWebsite"> |
| 197 | + <argument name="productName" value="Configurable product p1-Red"/> |
| 198 | + <argument name="price" value="5"/> |
| 199 | + <argument name="priceLabel" value="As low as"/> |
| 200 | + </actionGroup> |
| 201 | + <actionGroup ref="StorefrontOpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategoryPageOnSecondWebsite"> |
| 202 | + <argument name="productName" value="Configurable product p1-Red"/> |
| 203 | + </actionGroup> |
| 204 | + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeAsLowAsLabelForProductOnSecondWebsite"/> |
| 205 | + <actionGroup ref="AssertStorefrontProductDetailPageFinalPriceActionGroup" stepKey="assertProductFinalPriceForRedOnSecondWebsite"> |
| 206 | + <argument name="finalProductPrice" value="5.00"/> |
| 207 | + </actionGroup> |
| 208 | + </test> |
| 209 | +</tests> |
0 commit comments