-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 #84 from magento-pangolin/MC-4428
- Loading branch information
Showing
11 changed files
with
272 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...e/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateNewCatalogPriceRuleActionGroup.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,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminCreateNewCatalogPriceRuleActionGroup"> | ||
<arguments> | ||
<argument name="catalogRule" defaultValue="_defaultCatalogRule"/> | ||
<argument name="customerGroup" type="string"/> | ||
</arguments> | ||
<amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> | ||
<waitForPageLoad stepKey="waitForPageToLoad"/> | ||
<fillField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/> | ||
<fillField stepKey="fillDescription" selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}"/> | ||
<selectOption selector="{{AdminNewCatalogPriceRule.status}}" userInput="{{catalogRule.is_active}}" stepKey="selectStatus"/> | ||
<selectOption stepKey="selectWebSite" selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{catalogRule.website_ids[0]}}"/> | ||
<selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup"/> | ||
<scrollTo selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="scrollToActionTab"/> | ||
<click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/> | ||
<selectOption stepKey="discountType" selector="{{AdminNewCatalogPriceRuleActions.apply}}" userInput="{{catalogRule.simple_action}}"/> | ||
<fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/> | ||
<selectOption stepKey="discardSubsequentRules" selector="{{AdminNewCatalogPriceRuleActions.disregardRules}}" userInput="Yes"/> | ||
<waitForPageLoad stepKey="waitForApplied"/> | ||
</actionGroup> | ||
</actionGroups> |
18 changes: 18 additions & 0 deletions
18
app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminDeleteCatalogRuleActionGroup.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,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminDeleteCatalogRuleActionGroup"> | ||
<click selector="{{AdminNewCatalogPriceRule.delete}}" stepKey="clickOnDeleteButton"/> | ||
<waitForElementVisible selector="{{AdminNewCatalogPriceRule.okButton}}" stepKey="waitForOkButtonToBeVisible"/> | ||
<click selector="{{AdminNewCatalogPriceRule.okButton}}" stepKey="clickOnOkButton"/> | ||
<waitForPageLoad stepKey="waitForPagetoLoad"/> | ||
<see selector="{{AdminNewCatalogPriceRule.successMessage}}" userInput="You deleted the rule." stepKey="seeSuccessDeleteMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
21 changes: 21 additions & 0 deletions
21
app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSaveAndApplyRulesActionGroup.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,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminSaveAndApplyRulesActionGroup"> | ||
<waitForPageLoad stepKey="waitForPageToLoad"/> | ||
<scrollToTopOfPage stepKey="scrollToTop"/> | ||
<click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="saveTheCatalogRule"/> | ||
<waitForPageLoad stepKey="waitForPageToLoad1"/> | ||
<seeElement selector="{{AdminCatalogPriceRuleGrid.updateMessage}}" stepKey="seeMessageToUpdateTheCatalogRules"/> | ||
<see selector="{{AdminNewCatalogPriceRule.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> | ||
<click stepKey="applyRules" selector="{{AdminCatalogPriceRuleGrid.applyRules}}"/> | ||
<see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="Updated rules applied."/> | ||
</actionGroup> | ||
</actionGroups> |
23 changes: 23 additions & 0 deletions
23
...ode/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSearchCatalogRuleInGridActionGroup.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,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminSearchCatalogRuleInGridActionGroup"> | ||
<arguments> | ||
<argument name="catalogRuleName" type="string"/> | ||
</arguments> | ||
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> | ||
<waitForPageLoad stepKey="waitForPriceRulePage"/> | ||
<click selector="{{AdminCatalogPriceRuleGrid.resetFilter}}" stepKey="clickOnResetFilter"/> | ||
<waitForPageLoad stepKey="waitForTheGridPageToLoad"/> | ||
<fillField selector="{{AdminCatalogPriceRuleGrid.ruleFilter}}" userInput="{{catalogRuleName}}" stepKey="fillTheRuleFilter"/> | ||
<click selector="{{AdminCatalogPriceRuleGrid.search}}" stepKey="clickOnSearchButton"/> | ||
<waitForPageLoad stepKey="waitForTheSearchResult"/> | ||
</actionGroup> | ||
</actionGroups> |
18 changes: 18 additions & 0 deletions
18
...e/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminSelectCatalogRuleFromGridActionGroup.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,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminSelectCatalogRuleFromGridActionGroup"> | ||
<arguments> | ||
<argument name="catalogRuleName" type="string"/> | ||
</arguments> | ||
<click selector="{{AdminCatalogPriceRuleGrid.selectRowByRuleName(catalogRuleName)}}" stepKey="selectRow"/> | ||
<waitForPageLoad stepKey="waitForPageToLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
29 changes: 29 additions & 0 deletions
29
app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogPriceRuleFormActionGroup.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,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertCatalogPriceRuleFormActionGroup"> | ||
<arguments> | ||
<argument name="catalogRule" defaultValue="inactiveCatalogRule" /> | ||
<argument name="status" type="string" defaultValue=""/> | ||
<argument name="websites" type="string"/> | ||
<argument name="customerGroup" type="string"/> | ||
</arguments> | ||
<seeInField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/> | ||
<seeInField stepKey="fillDescription" selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}"/> | ||
<seeOptionIsSelected selector="{{AdminNewCatalogPriceRule.status}}" userInput="{{status}}" stepKey="selectStatus"/> | ||
<see stepKey="seeWebSite" selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{websites}}"/> | ||
<seeOptionIsSelected selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup"/> | ||
<scrollTo selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="scrollToActionTab"/> | ||
<click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/> | ||
<seeInField stepKey="discountType" selector="{{AdminNewCatalogPriceRuleActions.apply}}" userInput="{{catalogRule.simple_action}}"/> | ||
<seeInField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/> | ||
<waitForPageLoad stepKey="waitForPageToLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
23 changes: 23 additions & 0 deletions
23
app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AssertCatalogRuleInGridActionGroup.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,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertCatalogRuleInGridActionGroup"> | ||
<arguments> | ||
<argument name="catalogRuleName" type="string"/> | ||
<argument name="status" type="string" defaultValue=""/> | ||
<argument name="websites" type="string"/> | ||
<argument name="catalogRuleId" type="string"/> | ||
</arguments> | ||
<see selector="{{AdminCatalogPriceRuleGrid.firstRow}}" userInput="{{catalogRuleId}}" stepKey="seeCatalogRuleId"/> | ||
<see selector="{{AdminCatalogPriceRuleGrid.firstRow}}" userInput="{{catalogRuleName}}" stepKey="seeCatalogRuleName"/> | ||
<see selector="{{AdminCatalogPriceRuleGrid.firstRow}}" userInput="{{status}}" stepKey="seeCatalogRuleStatus"/> | ||
<see selector="{{AdminCatalogPriceRuleGrid.firstRow}}" userInput="{{websites}}" stepKey="seeCatalogRuleWebsite"/> | ||
</actionGroup> | ||
</actionGroups> |
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
14 changes: 14 additions & 0 deletions
14
app/code/Magento/CatalogRule/Test/Mftf/Page/AdminNewCatalogPriceRulePage.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,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> | ||
<page name="AdminNewCatalogPriceRulePage" url="catalog_rule/promo_catalog/new/" module="Magento_CatalogRule" area="admin"> | ||
<section name="AdminNewCatalogPriceRule"/> | ||
</page> | ||
</pages> |
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
75 changes: 75 additions & 0 deletions
75
app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateInactiveCatalogPriceRuleTest.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,75 @@ | ||
<?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="AdminCreateInactiveCatalogPriceRuleTest"> | ||
<annotations> | ||
<stories value="Create Catalog Price Rule"/> | ||
<title value="Create Inactive Catalog Price Rule"/> | ||
<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> |