forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request magento#99 from magento-pangolin/MC-4431
- Loading branch information
Showing
8 changed files
with
283 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
217 changes: 217 additions & 0 deletions
217
app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminDeleteCatalogPriceRuleEntityFromSimpleProductTest"> | ||
<annotations> | ||
<stories value="Delete Catalog Price Rule"/> | ||
<title value="Delete Catalog Price Rule for Simple Product"/> | ||
<description value="Assert that Catalog Price Rule is not applied for simple product."/> | ||
<testCaseId value="MC-14073"/> | ||
<severity value="CRITICAL"/> | ||
<group value="CatalogRule"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
|
||
<before> | ||
<createData entity="Simple_US_Customer" stepKey="createCustomer1"/> | ||
<createData entity="_defaultCategory" stepKey="createCategory1"/> | ||
<createData entity="SimpleProduct" stepKey="createProduct1"> | ||
<requiredEntity createDataKey="createCategory1"/> | ||
</createData> | ||
|
||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> | ||
|
||
<amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> | ||
<waitForPageLoad stepKey="waitForPageToLoad1"/> | ||
|
||
<actionGroup ref="CreateCatalogPriceRuleViaTheUi" stepKey="createCatalogPriceRuleViaTheUi1"> | ||
<argument name="catalogRule" value="DeleteActiveCatalogPriceRuleWithConditions"/> | ||
<argument name="customerGroup" value="General"/> | ||
<argument name="disregardRules" value="Yes"/> | ||
</actionGroup> | ||
|
||
<click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="saveTheCatalogRule"/> | ||
<waitForPageLoad stepKey="waitForPageToLoad3"/> | ||
<see selector="{{AdminNewCatalogPriceRule.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> | ||
</before> | ||
<after> | ||
<actionGroup ref="logout" stepKey="logoutOfAdmin1"/> | ||
|
||
<deleteData createDataKey="createCustomer1" stepKey="deleteCustomer1"/> | ||
<deleteData createDataKey="createProduct1" stepKey="deleteSimpleProduct1"/> | ||
<deleteData createDataKey="createCategory1" stepKey="deleteCategoryFirst1"/> | ||
</after> | ||
|
||
<!-- Delete the simple product and catalog price rule --> | ||
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage1"/> | ||
<waitForPageLoad stepKey="waitForPriceRulePage"/> | ||
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule1"> | ||
<argument name="name" value="{{DeleteActiveCatalogPriceRuleWithConditions.name}}"/> | ||
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> | ||
</actionGroup> | ||
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/> | ||
|
||
<!-- Assert that the Success message is present after the delete --> | ||
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You deleted the rule." stepKey="seeDeletedRuleMessage1"/> | ||
|
||
<!-- Reindex --> | ||
<magentoCLI command="cache:flush" stepKey="flushCache1"/> | ||
<magentoCLI command="indexer:reindex" stepKey="reindex1"/> | ||
|
||
<!-- Assert that the rule isn't present on the Category page --> | ||
<amOnPage url="$$createCategory1.name$$.html" stepKey="goToStorefrontCategoryPage1"/> | ||
<waitForPageLoad stepKey="waitForPageLoad3"/> | ||
<dontSee selector="{{StorefrontCategoryProductSection.ProductCatalogRulePriceTitleByName($$createProduct1.name$$)}}" userInput="Regular Price" stepKey="dontSeeRegularPriceText1"/> | ||
<dontSeeElement selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName($$createProduct1.name$$)}}" stepKey="dontSeeSpecialPrice1"/> | ||
|
||
<!-- Assert that the rule isn't present on the Product page --> | ||
<amOnPage url="$$createProduct1.name$$.html" stepKey="goToStorefrontProductPage1"/> | ||
<waitForPageLoad stepKey="waitForPageLoad4"/> | ||
<dontSee selector="{{StorefrontProductInfoMainSection.oldPriceTag}}" userInput="Regular Price" stepKey="dontSeeRegularPRiceText2"/> | ||
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createProduct1.price$$" stepKey="seeTrueProductPrice1"/> | ||
|
||
<!-- Assert that the rule isn't present in the Shopping Cart --> | ||
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToShoppingCart1"> | ||
<argument name="productName" value="$$createProduct1.name$$"/> | ||
</actionGroup> | ||
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="openMiniShoppingCart1"/> | ||
<see selector="{{StorefrontMinicartSection.productPriceByName($$createProduct1.name$$)}}" userInput="$$createProduct1.price$$" stepKey="seeCorrectProductPrice1"/> | ||
|
||
<!-- Assert that the rule isn't present on the Checkout page --> | ||
<click selector="{{StorefrontMiniCartSection.goToCheckout}}" stepKey="goToCheckout1"/> | ||
<conditionalClick selector="{{CheckoutCartSummarySection.expandShoppingCartSummary}}" dependentSelector="{{CheckoutCartSummarySection.expandShoppingCartSummary}}" visible="true" stepKey="expandShoppingCartSummary1"/> | ||
<see selector="{{CheckoutCartProductSection.ProductRegularPriceByName($$createProduct1.name$$)}}" userInput="$$createProduct1.price$$" stepKey="seeCorrectProductPriceOnCheckout1"/> | ||
</test> | ||
|
||
<test name="AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest"> | ||
<annotations> | ||
<stories value="Delete Catalog Price Rule"/> | ||
<title value="Delete Catalog Price Rule for Configurable Product"/> | ||
<description value="Assert that Catalog Price Rule is not applied for configurable product"/> | ||
<testCaseId value="MC-14074"/> | ||
<severity value="CRITICAL"/> | ||
<group value="CatalogRule"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
|
||
<before> | ||
<createData entity="Simple_US_Customer" stepKey="createCustomer1"/> | ||
<createData entity="SimpleSubCategory" stepKey="createCategory1"/> | ||
|
||
<!-- Create the configurable product based on the data in the /data folder --> | ||
<createData entity="ApiConfigurableProduct" stepKey="createConfigProduct1"> | ||
<requiredEntity createDataKey="createCategory1"/> | ||
</createData> | ||
|
||
<!-- Make the configurable product have two options, that are children of the default attribute set --> | ||
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute1"/> | ||
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> | ||
<requiredEntity createDataKey="createConfigProductAttribute1"/> | ||
</createData> | ||
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> | ||
<requiredEntity createDataKey="createConfigProductAttribute1"/> | ||
</createData> | ||
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> | ||
<requiredEntity createDataKey="createConfigProductAttribute1"/> | ||
</createData> | ||
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> | ||
<requiredEntity createDataKey="createConfigProductAttribute1"/> | ||
</getData> | ||
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> | ||
<requiredEntity createDataKey="createConfigProductAttribute1"/> | ||
</getData> | ||
|
||
<!-- Create the 2 children that will be a part of the configurable product --> | ||
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> | ||
<requiredEntity createDataKey="createConfigProductAttribute1"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption1"/> | ||
</createData> | ||
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> | ||
<requiredEntity createDataKey="createConfigProductAttribute1"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption2"/> | ||
</createData> | ||
|
||
<!-- Assign the two products to the configurable product --> | ||
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption1"> | ||
<requiredEntity createDataKey="createConfigProduct1"/> | ||
<requiredEntity createDataKey="createConfigProductAttribute1"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption1"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption2"/> | ||
</createData> | ||
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> | ||
<requiredEntity createDataKey="createConfigProduct1"/> | ||
<requiredEntity createDataKey="createConfigChildProduct1"/> | ||
</createData> | ||
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> | ||
<requiredEntity createDataKey="createConfigProduct1"/> | ||
<requiredEntity createDataKey="createConfigChildProduct2"/> | ||
</createData> | ||
|
||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> | ||
|
||
<amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> | ||
<waitForPageLoad stepKey="waitForPageToLoad1"/> | ||
|
||
<actionGroup ref="CreateCatalogPriceRuleViaTheUi" stepKey="createCatalogPriceRuleViaTheUi1"> | ||
<argument name="catalogRule" value="DeleteActiveCatalogPriceRuleWithConditions"/> | ||
<argument name="customerGroup" value="General"/> | ||
<argument name="disregardRules" value="Yes"/> | ||
</actionGroup> | ||
|
||
<click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="saveTheCatalogRule"/> | ||
<waitForPageLoad stepKey="waitForPageToLoad3"/> | ||
<see selector="{{AdminNewCatalogPriceRule.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> | ||
</before> | ||
<after> | ||
<actionGroup ref="logout" stepKey="logoutOfAdmin1"/> | ||
|
||
<deleteData createDataKey="createCustomer1" stepKey="deleteCustomer"/> | ||
<deleteData createDataKey="createCategory1" stepKey="deleteCategory1"/> | ||
<deleteData createDataKey="createConfigProduct1" stepKey="deleteConfigProduct1"/> | ||
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> | ||
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> | ||
<deleteData createDataKey="createConfigProductAttribute1" stepKey="deleteConfigProductAttribute1"/> | ||
</after> | ||
|
||
<!-- Delete the simple product and catalog price rule --> | ||
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage1"/> | ||
<waitForPageLoad stepKey="waitForPriceRulePage"/> | ||
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule1"> | ||
<argument name="name" value="{{DeleteActiveCatalogPriceRuleWithConditions.name}}"/> | ||
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> | ||
</actionGroup> | ||
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/> | ||
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You deleted the rule." stepKey="seeDeletedRuleMessage1"/> | ||
|
||
<!-- Reindex --> | ||
<magentoCLI command="cache:flush" stepKey="flushCache1"/> | ||
<magentoCLI command="indexer:reindex" stepKey="reindex1"/> | ||
|
||
<!-- Assert that the rule isn't present on the Category page --> | ||
<amOnPage url="$$createCategory1.name$$.html" stepKey="goToStorefrontCategoryPage1"/> | ||
<waitForPageLoad stepKey="waitForPageLoad2"/> | ||
<see selector="{{StorefrontCategoryProductSection.ProductPriceByName($$createConfigProduct1.name$$)}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeRegularPriceText1"/> | ||
|
||
<!-- Assert that the rule isn't present on the Product page --> | ||
<amOnPage url="{{StorefrontProductPage.url($$createConfigProduct1.custom_attributes[url_key]$$)}}" stepKey="goToStorefrontProductPage1"/> | ||
<waitForPageLoad stepKey="waitForPageLoad3"/> | ||
<dontSee selector="{{StorefrontProductInfoMainSection.oldPriceTag}}" userInput="Regular Price" stepKey="dontSeeRegularPriceText2"/> | ||
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeTrueProductPrice1"/> | ||
|
||
<!-- Assert that the rule isn't present in the Shopping Cart --> | ||
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="option1" stepKey="selectOption1"/> | ||
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart1"/> | ||
<waitForPageLoad time="30" stepKey="waitForPageLoad4"/> | ||
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added $$createConfigProduct1.name$ to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> | ||
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="openMiniShoppingCart1"/> | ||
<waitForPageLoad time="30" stepKey="waitForPageLoad5"/> | ||
<see selector="{{StorefrontMinicartSection.productPriceByName($$createConfigProduct1.name$$)}}" userInput="$$createConfigProduct1.price$$" stepKey="seeCorrectProductPrice1"/> | ||
</test> | ||
</tests> |
Oops, something went wrong.