|
| 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="AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Delete Catalog Price Rule"/> |
| 14 | + <title value="Delete Catalog Price Rule for Simple Product"/> |
| 15 | + <description value="Assert that Catalog Price Rule is not applied for simple product."/> |
| 16 | + <testCaseId value="MC-14073"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <group value="CatalogRule"/> |
| 19 | + <group value="mtf_migrated"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <createData entity="Simple_US_Customer" stepKey="createCustomer1"/> |
| 24 | + <createData entity="_defaultCategory" stepKey="createCategory1"/> |
| 25 | + <createData entity="SimpleProduct" stepKey="createProduct1"> |
| 26 | + <requiredEntity createDataKey="createCategory1"/> |
| 27 | + </createData> |
| 28 | + |
| 29 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> |
| 30 | + |
| 31 | + <amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> |
| 32 | + <waitForPageLoad stepKey="waitForPageToLoad1"/> |
| 33 | + |
| 34 | + <actionGroup ref="CreateCatalogPriceRuleViaTheUi" stepKey="createCatalogPriceRuleViaTheUi1"> |
| 35 | + <argument name="catalogRule" value="DeleteActiveCatalogPriceRuleWithConditions"/> |
| 36 | + <argument name="customerGroup" value="General"/> |
| 37 | + <argument name="disregardRules" value="Yes"/> |
| 38 | + </actionGroup> |
| 39 | + |
| 40 | + <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="saveTheCatalogRule"/> |
| 41 | + <waitForPageLoad stepKey="waitForPageToLoad3"/> |
| 42 | + <see selector="{{AdminNewCatalogPriceRule.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> |
| 43 | + </before> |
| 44 | + <after> |
| 45 | + <actionGroup ref="logout" stepKey="logoutOfAdmin1"/> |
| 46 | + |
| 47 | + <deleteData createDataKey="createCustomer1" stepKey="deleteCustomer1"/> |
| 48 | + <deleteData createDataKey="createProduct1" stepKey="deleteSimpleProduct1"/> |
| 49 | + <deleteData createDataKey="createCategory1" stepKey="deleteCategoryFirst1"/> |
| 50 | + </after> |
| 51 | + |
| 52 | + <!-- Delete the simple product and catalog price rule --> |
| 53 | + <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage1"/> |
| 54 | + <waitForPageLoad stepKey="waitForPriceRulePage"/> |
| 55 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule1"> |
| 56 | + <argument name="name" value="{{DeleteActiveCatalogPriceRuleWithConditions.name}}"/> |
| 57 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> |
| 58 | + </actionGroup> |
| 59 | + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> |
| 60 | + |
| 61 | + <!-- Assert that the Success message is present after the delete --> |
| 62 | + <see selector="{{AdminMessagesSection.successMessage}}" userInput="You deleted the rule." stepKey="seeDeletedRuleMessage1"/> |
| 63 | + |
| 64 | + <!-- Reindex --> |
| 65 | + <magentoCLI command="cache:flush" stepKey="flushCache1"/> |
| 66 | + <magentoCLI command="indexer:reindex" stepKey="reindex1"/> |
| 67 | + |
| 68 | + <!-- Assert that the rule isn't present on the Category page --> |
| 69 | + <amOnPage url="$$createCategory1.name$$.html" stepKey="goToStorefrontCategoryPage1"/> |
| 70 | + <waitForPageLoad stepKey="waitForPageLoad3"/> |
| 71 | + <dontSee selector="{{StorefrontCategoryProductSection.ProductCatalogRulePriceTitleByName($$createProduct1.name$$)}}" userInput="Regular Price" stepKey="dontSeeRegularPriceText1"/> |
| 72 | + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName($$createProduct1.name$$)}}" stepKey="dontSeeSpecialPrice1"/> |
| 73 | + |
| 74 | + <!-- Assert that the rule isn't present on the Product page --> |
| 75 | + <amOnPage url="$$createProduct1.name$$.html" stepKey="goToStorefrontProductPage1"/> |
| 76 | + <waitForPageLoad stepKey="waitForPageLoad4"/> |
| 77 | + <dontSee selector="{{StorefrontProductInfoMainSection.oldPriceTag}}" userInput="Regular Price" stepKey="dontSeeRegularPRiceText2"/> |
| 78 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createProduct1.price$$" stepKey="seeTrueProductPrice1"/> |
| 79 | + |
| 80 | + <!-- Assert that the rule isn't present in the Shopping Cart --> |
| 81 | + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToShoppingCart1"> |
| 82 | + <argument name="productName" value="$$createProduct1.name$$"/> |
| 83 | + </actionGroup> |
| 84 | + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="openMiniShoppingCart1"/> |
| 85 | + <see selector="{{StorefrontMinicartSection.productPriceByName($$createProduct1.name$$)}}" userInput="$$createProduct1.price$$" stepKey="seeCorrectProductPrice1"/> |
| 86 | + |
| 87 | + <!-- Assert that the rule isn't present on the Checkout page --> |
| 88 | + <click selector="{{StorefrontMiniCartSection.goToCheckout}}" stepKey="goToCheckout1"/> |
| 89 | + <conditionalClick selector="{{CheckoutCartSummarySection.expandShoppingCartSummary}}" dependentSelector="{{CheckoutCartSummarySection.expandShoppingCartSummary}}" visible="true" stepKey="expandShoppingCartSummary1"/> |
| 90 | + <see selector="{{CheckoutCartProductSection.ProductRegularPriceByName($$createProduct1.name$$)}}" userInput="$$createProduct1.price$$" stepKey="seeCorrectProductPriceOnCheckout1"/> |
| 91 | + </test> |
| 92 | + |
| 93 | + <test name="AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest"> |
| 94 | + <annotations> |
| 95 | + <stories value="Delete Catalog Price Rule"/> |
| 96 | + <title value="Delete Catalog Price Rule for Configurable Product"/> |
| 97 | + <description value="Assert that Catalog Price Rule is not applied for configurable product"/> |
| 98 | + <testCaseId value="MC-14074"/> |
| 99 | + <severity value="CRITICAL"/> |
| 100 | + <group value="CatalogRule"/> |
| 101 | + <group value="mtf_migrated"/> |
| 102 | + </annotations> |
| 103 | + |
| 104 | + <before> |
| 105 | + <createData entity="Simple_US_Customer" stepKey="createCustomer1"/> |
| 106 | + <createData entity="SimpleSubCategory" stepKey="createCategory1"/> |
| 107 | + |
| 108 | + <!-- Create the configurable product based on the data in the /data folder --> |
| 109 | + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct1"> |
| 110 | + <requiredEntity createDataKey="createCategory1"/> |
| 111 | + </createData> |
| 112 | + |
| 113 | + <!-- Make the configurable product have two options, that are children of the default attribute set --> |
| 114 | + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute1"/> |
| 115 | + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> |
| 116 | + <requiredEntity createDataKey="createConfigProductAttribute1"/> |
| 117 | + </createData> |
| 118 | + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> |
| 119 | + <requiredEntity createDataKey="createConfigProductAttribute1"/> |
| 120 | + </createData> |
| 121 | + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> |
| 122 | + <requiredEntity createDataKey="createConfigProductAttribute1"/> |
| 123 | + </createData> |
| 124 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> |
| 125 | + <requiredEntity createDataKey="createConfigProductAttribute1"/> |
| 126 | + </getData> |
| 127 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> |
| 128 | + <requiredEntity createDataKey="createConfigProductAttribute1"/> |
| 129 | + </getData> |
| 130 | + |
| 131 | + <!-- Create the 2 children that will be a part of the configurable product --> |
| 132 | + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> |
| 133 | + <requiredEntity createDataKey="createConfigProductAttribute1"/> |
| 134 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 135 | + </createData> |
| 136 | + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> |
| 137 | + <requiredEntity createDataKey="createConfigProductAttribute1"/> |
| 138 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 139 | + </createData> |
| 140 | + |
| 141 | + <!-- Assign the two products to the configurable product --> |
| 142 | + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption1"> |
| 143 | + <requiredEntity createDataKey="createConfigProduct1"/> |
| 144 | + <requiredEntity createDataKey="createConfigProductAttribute1"/> |
| 145 | + <requiredEntity createDataKey="getConfigAttributeOption1"/> |
| 146 | + <requiredEntity createDataKey="getConfigAttributeOption2"/> |
| 147 | + </createData> |
| 148 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> |
| 149 | + <requiredEntity createDataKey="createConfigProduct1"/> |
| 150 | + <requiredEntity createDataKey="createConfigChildProduct1"/> |
| 151 | + </createData> |
| 152 | + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> |
| 153 | + <requiredEntity createDataKey="createConfigProduct1"/> |
| 154 | + <requiredEntity createDataKey="createConfigChildProduct2"/> |
| 155 | + </createData> |
| 156 | + |
| 157 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> |
| 158 | + |
| 159 | + <amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> |
| 160 | + <waitForPageLoad stepKey="waitForPageToLoad1"/> |
| 161 | + |
| 162 | + <actionGroup ref="CreateCatalogPriceRuleViaTheUi" stepKey="createCatalogPriceRuleViaTheUi1"> |
| 163 | + <argument name="catalogRule" value="DeleteActiveCatalogPriceRuleWithConditions"/> |
| 164 | + <argument name="customerGroup" value="General"/> |
| 165 | + <argument name="disregardRules" value="Yes"/> |
| 166 | + </actionGroup> |
| 167 | + |
| 168 | + <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="saveTheCatalogRule"/> |
| 169 | + <waitForPageLoad stepKey="waitForPageToLoad3"/> |
| 170 | + <see selector="{{AdminNewCatalogPriceRule.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> |
| 171 | + </before> |
| 172 | + <after> |
| 173 | + <actionGroup ref="logout" stepKey="logoutOfAdmin1"/> |
| 174 | + |
| 175 | + <deleteData createDataKey="createCustomer1" stepKey="deleteCustomer"/> |
| 176 | + <deleteData createDataKey="createCategory1" stepKey="deleteCategory1"/> |
| 177 | + <deleteData createDataKey="createConfigProduct1" stepKey="deleteConfigProduct1"/> |
| 178 | + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> |
| 179 | + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> |
| 180 | + <deleteData createDataKey="createConfigProductAttribute1" stepKey="deleteConfigProductAttribute1"/> |
| 181 | + </after> |
| 182 | + |
| 183 | + <!-- Delete the simple product and catalog price rule --> |
| 184 | + <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage1"/> |
| 185 | + <waitForPageLoad stepKey="waitForPriceRulePage"/> |
| 186 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule1"> |
| 187 | + <argument name="name" value="{{DeleteActiveCatalogPriceRuleWithConditions.name}}"/> |
| 188 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> |
| 189 | + </actionGroup> |
| 190 | + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> |
| 191 | + <see selector="{{AdminMessagesSection.successMessage}}" userInput="You deleted the rule." stepKey="seeDeletedRuleMessage1"/> |
| 192 | + |
| 193 | + <!-- Reindex --> |
| 194 | + <magentoCLI command="cache:flush" stepKey="flushCache1"/> |
| 195 | + <magentoCLI command="indexer:reindex" stepKey="reindex1"/> |
| 196 | + |
| 197 | + <!-- Assert that the rule isn't present on the Category page --> |
| 198 | + <amOnPage url="$$createCategory1.name$$.html" stepKey="goToStorefrontCategoryPage1"/> |
| 199 | + <waitForPageLoad stepKey="waitForPageLoad2"/> |
| 200 | + <see selector="{{StorefrontCategoryProductSection.ProductPriceByName($$createConfigProduct1.name$$)}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeRegularPriceText1"/> |
| 201 | + |
| 202 | + <!-- Assert that the rule isn't present on the Product page --> |
| 203 | + <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct1.custom_attributes[url_key]$$)}}" stepKey="goToStorefrontProductPage1"/> |
| 204 | + <waitForPageLoad stepKey="waitForPageLoad3"/> |
| 205 | + <dontSee selector="{{StorefrontProductInfoMainSection.oldPriceTag}}" userInput="Regular Price" stepKey="dontSeeRegularPriceText2"/> |
| 206 | + <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeTrueProductPrice1"/> |
| 207 | + |
| 208 | + <!-- Assert that the rule isn't present in the Shopping Cart --> |
| 209 | + <selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="option1" stepKey="selectOption1"/> |
| 210 | + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart1"/> |
| 211 | + <waitForPageLoad time="30" stepKey="waitForPageLoad4"/> |
| 212 | + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added $$createConfigProduct1.name$ to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> |
| 213 | + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="openMiniShoppingCart1"/> |
| 214 | + <waitForPageLoad time="30" stepKey="waitForPageLoad5"/> |
| 215 | + <see selector="{{StorefrontMinicartSection.productPriceByName($$createConfigProduct1.name$$)}}" userInput="$$createConfigProduct1.price$$" stepKey="seeCorrectProductPrice1"/> |
| 216 | + </test> |
| 217 | +</tests> |
0 commit comments