diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml index cc165e0b5dc96..544200e5e5123 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml @@ -91,4 +91,8 @@ - + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionActionGroup.xml new file mode 100644 index 0000000000000..66f89bfc37365 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionActionGroup.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleConditionsSectionActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleConditionsSectionActionGroup.xml new file mode 100644 index 0000000000000..ab45aae46db1d --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleConditionsSectionActionGroup.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleLabelsSectionActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleLabelsSectionActionGroup.xml new file mode 100644 index 0000000000000..4133cc44ebc15 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleLabelsSectionActionGroup.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleRuleInfoSectionActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleRuleInfoSectionActionGroup.xml new file mode 100644 index 0000000000000..27b9634cbe28c --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleRuleInfoSectionActionGroup.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml index 35e1bee0952cf..7a3a20e603255 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml @@ -18,4 +18,9 @@ - + + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AssertCartPriceRuleSuccessSaveMessageActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AssertCartPriceRuleSuccessSaveMessageActionGroup.xml new file mode 100644 index 0000000000000..8fe0250307c6a --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AssertCartPriceRuleSuccessSaveMessageActionGroup.xml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml new file mode 100644 index 0000000000000..f9c9a9fd357ee --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontAddToTheCartActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontAddToTheCartActionGroup.xml new file mode 100644 index 0000000000000..fa474194635e6 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontAddToTheCartActionGroup.xml @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontClickOnMiniCartActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontClickOnMiniCartActionGroup.xml new file mode 100644 index 0000000000000..59028ee1a17b5 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontClickOnMiniCartActionGroup.xml @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml index 8f6e63534b0ca..74ee28de2d3fa 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml @@ -193,4 +193,52 @@ by_fixed - + + Cart Price Rule with Specific Coupon + Description for Cart Price Rule + Yes + Main Website + 'NOT LOGGED IN' + Specific Coupon + 123-abc-ABC-987 + Percent of product price discount + 50 + Cart Price Rule with Specific Coupon + Cart Price Rule with Specific Coupon + + + Cart Price Rule with complex conditions + Cart Price Rule with complex conditions + Yes + Main Website + 'NOT LOGGED IN', 'General', 'Wholesale', 'Retailer' + Specific Coupon + 123-abc-ABC-987 + 13 + 63 + 1 + Yes + 300 + US + 123456789a + Percent of product price discount + 50 + 0 + 0 + Yes + Yes + For matching items only + Cart Price Rule with complex conditions + Cart Price Rule with complex conditions + + + Inactive Cart Price Rule + Inactive Cart Price Rule + 0 + Main Website + 'NOT LOGGED IN' + No Coupon + Percent of product price discount + 50 + + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml index c8da82407457d..b701389a13418 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml @@ -16,6 +16,8 @@ + + @@ -26,6 +28,7 @@ + @@ -39,6 +42,11 @@ + + + + + @@ -58,10 +66,18 @@ + + + + + + + + @@ -69,4 +85,4 @@ - + \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesSection.xml index 14d3a734408db..60bf3d63e7e54 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesSection.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesSection.xml @@ -18,5 +18,6 @@ + diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithComplexConditionsAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithComplexConditionsAndVerifyDeleteMessageTest.xml new file mode 100644 index 0000000000000..4403010e1ffc9 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithComplexConditionsAndVerifyDeleteMessageTest.xml @@ -0,0 +1,69 @@ + + + + + + + + <description value="Test log in to Cart Price Rule and Delete Active Sales Rule With Complex Conditions Test"/> + <testCaseId value="MC-15450"/> + <severity value="CRITICAL"/> + <group value="salesRule"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <!--Create active cart price rule--> + <actionGroup ref="AdminCreateCartPriceRuleRuleInfoSectionActionGroup" stepKey="createActiveCartPriceRuleRuleInfoSection"> + <argument name="ruleName" value="ActiveSalesRuleWithComplexConditions"/> + </actionGroup> + <!--Fill values for Condition Section--> + <actionGroup ref="AdminCreateCartPriceRuleConditionsSectionSubtotalActionGroup" stepKey="createActiveCartPriceRuleConditionsSubtotalSection"> + <argument name="ruleName" value="ActiveSalesRuleWithComplexConditions"/> + <argument name="condition1" value="Subtotal"/> + </actionGroup> + <actionGroup ref="AdminCreateCartPriceRuleConditionsSectionShippingCountryActionGroup" stepKey="createActiveCartPriceRuleConditionsShippingCountrySection"> + <argument name="ruleName" value="ActiveSalesRuleWithComplexConditions"/> + <argument name="condition2" value="Shipping Country"/> + </actionGroup> + <actionGroup ref="AdminCreateCartPriceRuleConditionsSectionShippingPostcodeActionGroup" stepKey="createActiveCartPriceRuleConditionsShippingPostcodeSection"> + <argument name="ruleName" value="ActiveSalesRuleWithComplexConditions"/> + <argument name="condition3" value="Shipping Postcode"/> + </actionGroup> + <!--Fill values for Action Section--> + <actionGroup ref="AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup" stepKey="createActiveCartPriceRuleActionsSection"> + <argument name="ruleName" value="ActiveSalesRuleWithComplexConditions"/> + </actionGroup> + <actionGroup ref="AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup" stepKey="createActiveCartPriceRuleShippingAmountActionsSection"/> + <actionGroup ref="AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup" stepKey="createActiveCartPriceRuleDiscardSubsequentRulesActionsSection"/> + <actionGroup ref="AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup" stepKey="createActiveCartPriceRuleFreeShippingActionsSection"> + <argument name="ruleName" value="{{ActiveSalesRuleWithComplexConditions.simple_free_shipping}}"/> + </actionGroup> + <!--Fill values for Labels Section--> + <actionGroup ref="AdminCreateCartPriceRuleLabelsSectionActionGroup" stepKey="createActiveCartPriceRuleLabelsSection"> + <argument name="ruleName" value="ActiveSalesRuleWithComplexConditions"/> + </actionGroup> + <actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="assertVerifyCartPriceRuleSuccessSaveMessage"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Delete active cart price rule--> + <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteActiveCartPriceRule"> + <argument name="ruleName" value="{{ActiveSalesRuleWithComplexConditions.name}}"/> + </actionGroup> + + <!--Go to grid and verify AssertCartPriceRuleIsNotPresentedInGrid--> + <actionGroup ref="AdminCartPriceRuleNotInGridActionGroup" stepKey="searchAndVerifyActiveCartPriceRuleNotInGrid"> + <argument name="ruleName" value="ActiveSalesRuleWithComplexConditions.name"/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml new file mode 100644 index 0000000000000..41e4221a2c37f --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml @@ -0,0 +1,44 @@ +<?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="AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest"> + <annotations> + <stories value="Delete Sales Rule"/> + <title value="Delete Active Sales Rule With Percent Price And Verify Delete Message"/> + <description value="Test log in to Cart Price Rule and Delete Active Sales Rule Test"/> + <testCaseId value="MC-15449"/> + <severity value="CRITICAL"/> + <group value="salesRule"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <!--Create active cart price rule--> + <actionGroup ref="AdminCreateCartPriceRuleWithCouponCode" stepKey="createActiveCartPriceRule"> + <argument name="ruleName" value="ActiveSalesRuleWithPercentPriceDiscountCoupon"/> + <argument name="couponCode" value="ActiveSalesRuleWithPercentPriceDiscountCoupon.coupon_code"/> + </actionGroup> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Delete active cart price rule--> + <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteActiveCartPriceRule"> + <argument name="ruleName" value="{{ActiveSalesRuleWithPercentPriceDiscountCoupon.name}}"/> + </actionGroup> + + <!--Go to grid and verify AssertCartPriceRuleIsNotPresentedInGrid--> + <actionGroup ref="AdminCartPriceRuleNotInGridActionGroup" stepKey="searchAndVerifyActiveCartPriceRuleNotInGrid"> + <argument name="ruleName" value="ActiveSalesRuleWithPercentPriceDiscountCoupon.name"/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml new file mode 100644 index 0000000000000..1570bfbdb7a23 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml @@ -0,0 +1,65 @@ +<?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="AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest"> + <annotations> + <stories value="Delete Sales Rule"/> + <title value="Delete Inactive Sales Rule And Verify Delete Message"/> + <description value="Test log in to Cart Price Rule and Delete Inactive Sales Rule Test"/> + <testCaseId value="MC-15451"/> + <severity value="CRITICAL"/> + <group value="salesRule"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"/> + <!--Create inactive cart price rule--> + <actionGroup ref="AdminInactiveCartPriceRuleActionGroup" stepKey="createInactiveCartPriceRule"> + <argument name="ruleName" value="InactiveSalesRule"/> + <argument name="custGrp" value="NOT LOGGED IN"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="initialSimpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Delete inactive cart price rule--> + <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteInactiveCartPriceRule"> + <argument name="ruleName" value="{{InactiveSalesRule.name}}"/> + </actionGroup> + + <!--Go to grid and verify AssertCartPriceRuleIsNotPresentedInGrid--> + <actionGroup ref="AdminCartPriceRuleNotInGridActionGroup" stepKey="searchAndVerifyInactiveCartPriceRuleNotInGrid"> + <argument name="ruleName" value="InactiveSalesRule.name"/> + </actionGroup> + + <!--Verify customer don't see updated virtual product link on category page --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$initialSimpleProduct$$"/> + </actionGroup> + + <!--Click on Add To Cart button--> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="clickOnAddToCartButton"/> + + <!--Click on mini cart--> + <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> + + <!--Open mini cart and verify Shopping cart subtotal equals to grand total - price rule has not been applied.--> + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="verifyCartSubtotalEqualsGrandTotal"> + <argument name="productName" value="$$initialSimpleProduct.name$$"/> + <argument name="productPrice" value="$560.00"/> + <argument name="cartSubtotal" value="$560.00" /> + <argument name="qty" value="1"/> + </actionGroup> + </test> +</tests> \ No newline at end of file