From 1936cfad30a62b712b841929f984cde00750d763 Mon Sep 17 00:00:00 2001 From: Kavitha Date: Wed, 27 Mar 2019 13:08:05 -0500 Subject: [PATCH] MC-4428: Convert CreateCatalogPriceRuleEntityTest to MFTF --- ...inCreateNewCatalogPriceRuleActionGroup.xml | 30 ++++++++ .../AdminDeleteCatalogRuleActionGroup.xml | 18 +++++ .../AdminSaveAndApplyRulesActionGroup.xml | 21 ++++++ ...dminSearchCatalogRuleInGridActionGroup.xml | 23 ++++++ ...inSelectCatalogRuleFromGridActionGroup.xml | 18 +++++ .../AssertCatalogPriceRuleFormActionGroup.xml | 29 +++++++ .../AssertCatalogRuleInGridActionGroup.xml | 23 ++++++ .../Test/Mftf/Data/CatalogRuleData.xml | 13 ++++ .../Page/AdminNewCatalogPriceRulePage.xml | 14 ++++ .../AdminNewCatalogPriceRuleSection.xml | 8 ++ ...dminCreateInactiveCatalogPriceRuleTest.xml | 75 +++++++++++++++++++ 11 files changed, 272 insertions(+) create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateNewCatalogPriceRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminDeleteCatalogRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSaveAndApplyRulesActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSearchCatalogRuleInGridActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSelectCatalogRuleFromGridActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogPriceRuleFormActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogRuleInGridActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/Page/AdminNewCatalogPriceRulePage.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.xml diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateNewCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateNewCatalogPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..4599e325e39cb --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateNewCatalogPriceRuleActionGroup.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminDeleteCatalogRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminDeleteCatalogRuleActionGroup.xml new file mode 100644 index 0000000000000..ea2d6821917e3 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminDeleteCatalogRuleActionGroup.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSaveAndApplyRulesActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSaveAndApplyRulesActionGroup.xml new file mode 100644 index 0000000000000..2584b8b36b769 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSaveAndApplyRulesActionGroup.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSearchCatalogRuleInGridActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSearchCatalogRuleInGridActionGroup.xml new file mode 100644 index 0000000000000..c7d5d853642c0 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSearchCatalogRuleInGridActionGroup.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSelectCatalogRuleFromGridActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSelectCatalogRuleFromGridActionGroup.xml new file mode 100644 index 0000000000000..f0e927ea84048 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSelectCatalogRuleFromGridActionGroup.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogPriceRuleFormActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogPriceRuleFormActionGroup.xml new file mode 100644 index 0000000000000..330c2ad7e15f6 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogPriceRuleFormActionGroup.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogRuleInGridActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogRuleInGridActionGroup.xml new file mode 100644 index 0000000000000..8be41c3b07af6 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogRuleInGridActionGroup.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml b/app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml index 5b75708d1ae0a..d04957a7cdfb5 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml @@ -94,4 +94,17 @@ by_percent 10 + + InactiveCatalogRule + Inactive Catalog Price Rule Description + 0 + + 1 + + + 1 + + by_fixed + 10 + diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Page/AdminNewCatalogPriceRulePage.xml b/app/code/Magento/CatalogRule/Test/Mftf/Page/AdminNewCatalogPriceRulePage.xml new file mode 100644 index 0000000000000..fded4f5e5f322 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/Page/AdminNewCatalogPriceRulePage.xml @@ -0,0 +1,14 @@ + + + + + +
+ + diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml b/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml index 635260888e7fb..0b1c935a3c248 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml @@ -13,6 +13,8 @@ + + @@ -49,5 +51,11 @@
+ + + + + +
diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.xml new file mode 100644 index 0000000000000..5223b18df4e4a --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.xml @@ -0,0 +1,75 @@ + + + + + + + + <description value="Login as admin and create inactive catalog price Rule"/> + <testCaseId value="MC-13977"/> + <severity value="CRITICAL"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + </before> + <after> + <actionGroup ref="AdminSearchCatalogRuleInGridActionGroup" stepKey="searchCreatedCatalogRule"> + <argument name="catalogRuleName" value="{{InactiveCatalogRule.name}}"/> + </actionGroup> + <actionGroup ref="AdminSelectCatalogRuleFromGridActionGroup" stepKey="selectCreatedCatalogRule"> + <argument name="catalogRuleName" value="{{InactiveCatalogRule.name}}"/> + </actionGroup> + <actionGroup ref="AdminDeleteCatalogRuleActionGroup" stepKey="deleteTheCatalogRule"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Create Inactive Catalog Price Rule --> + <actionGroup ref="AdminCreateNewCatalogPriceRuleActionGroup" stepKey="createCatalogPriceRule"> + <argument name="catalogRule" value="InactiveCatalogRule"/> + <argument name="customerGroup" value="General"/> + </actionGroup> + + <!-- Save and Apply Rules --> + <actionGroup ref="AdminSaveAndApplyRulesActionGroup" stepKey="saveAndApplyRules"/> + + <!-- Search Catalog Rule in Grid --> + <actionGroup ref="AdminSearchCatalogRuleInGridActionGroup" stepKey="searchAndSelectCreatedCatalogRule"> + <argument name="catalogRuleName" value="{{InactiveCatalogRule.name}}"/> + </actionGroup> + + <!--Select Catalog Rule in Grid --> + <actionGroup ref="AdminSelectCatalogRuleFromGridActionGroup" stepKey="selectCreatedCatalogRule"> + <argument name="catalogRuleName" value="{{InactiveCatalogRule.name}}"/> + </actionGroup> + <grabFromCurrentUrl stepKey="catalogRuleId" regex="#\/([0-9]*)?\/$#"/> + + <!-- Assert catalog Price Rule Form --> + <actionGroup ref="AssertCatalogPriceRuleFormActionGroup" stepKey="assertCatalogRuleForm"> + <argument name="catalogRule" value="InactiveCatalogRule"/> + <argument name="status" value="Inactive"/> + <argument name="websites" value="Main Website"/> + <argument name="customerGroup" value="General"/> + </actionGroup> + + <!-- Search Catalog Rule in Grid --> + <actionGroup ref="AdminSearchCatalogRuleInGridActionGroup" stepKey="searchCreatedCatalogRule"> + <argument name="catalogRuleName" value="{{InactiveCatalogRule.name}}"/> + </actionGroup> + + <!-- Assert Catalog Rule In Grid --> + <actionGroup ref="AssertCatalogRuleInGridActionGroup" stepKey="assertCatalogRuleInGrid"> + <argument name="catalogRuleName" value="{{InactiveCatalogRule.name}}"/> + <argument name="status" value="Inactive"/> + <argument name="websites" value="Main Website"/> + <argument name="catalogRuleId" value="$catalogRuleId"/> + </actionGroup> + </test> +</tests>