|
| 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" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> |
| 10 | + <test name="PriceRuleCategoryNestingTest"> |
| 11 | + <annotations> |
| 12 | + <description value="Category nesting level must be the same as were created in categories."/> |
| 13 | + <severity value="CRITICAL"/> |
| 14 | + <testCaseId value="MAGETWO-88031"/> |
| 15 | + <group value="sale_rules"/> |
| 16 | + </annotations> |
| 17 | + <before> |
| 18 | + <createData entity="_defaultCategory" stepKey="subcategory1"/> |
| 19 | + <createData entity="SubCategoryWithParent" stepKey="subcategory2"> |
| 20 | + <requiredEntity createDataKey="subcategory1"/> |
| 21 | + </createData> |
| 22 | + <createData entity="SubCategoryWithParent" stepKey="subcategory3"> |
| 23 | + <requiredEntity createDataKey="subcategory2"/> |
| 24 | + </createData> |
| 25 | + <createData entity="SubCategoryWithParent" stepKey="subcategory4"> |
| 26 | + <requiredEntity createDataKey="subcategory3"/> |
| 27 | + </createData> |
| 28 | + <createData entity="SubCategoryWithParent" stepKey="subcategory5"> |
| 29 | + <requiredEntity createDataKey="subcategory4"/> |
| 30 | + </createData> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <deleteData createDataKey="subcategory1" stepKey="deleteCategory1" /> |
| 34 | + <deleteData createDataKey="subcategory2" stepKey="deleteCategory2" /> |
| 35 | + <deleteData createDataKey="subcategory3" stepKey="deleteCategory3" /> |
| 36 | + <deleteData createDataKey="subcategory4" stepKey="deleteCategory4" /> |
| 37 | + <deleteData createDataKey="subcategory5" stepKey="deleteCategory5" /> |
| 38 | + <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/auth/logout/" stepKey="amOnLogoutPage" /> |
| 39 | + </after> |
| 40 | + |
| 41 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> |
| 42 | + <amOnPage stepKey="openCatalogPriceRulePage" url="{{PriceRuleNewPage.url}}" /> |
| 43 | + <waitForPageLoad stepKey="waitCatalogPriceRulePageLoad"/> |
| 44 | + <click stepKey="openConditionsSection" selector="{{PriceRuleConditionsSection.conditionsTab}}" /> |
| 45 | + <click stepKey="createNewRule" selector="{{PriceRuleConditionsSection.createNewRule}}" /> |
| 46 | + <selectOption stepKey="selectProductAttributes" selector="{{PriceRuleConditionsSection.rulesDropdown}}" userInput="Magento\SalesRule\Model\Rule\Condition\Product\Found" /> |
| 47 | + <waitForAjaxLoad stepKey="ajaxLoad1"/> |
| 48 | + <waitForElement stepKey="wait1" selector="{{PriceRuleConditionsSection.addProductAttributesButton}}" /> |
| 49 | + <click stepKey="clickToshowAttributes" selector="{{PriceRuleConditionsSection.addProductAttributesButton}}"/> |
| 50 | + <selectOption stepKey="selectCategoryAttribute" selector="{{PriceRuleConditionsSection.productAttributesDropdown}}" userInput="Magento\SalesRule\Model\Rule\Condition\Product|category_ids" /> |
| 51 | + <waitForAjaxLoad stepKey="ajaxLoad2"/> |
| 52 | + |
| 53 | + <waitForElement stepKey="wait2" selector="{{PriceRuleConditionsSection.changeCategoriesButton}}" /> |
| 54 | + <click stepKey="changeCategories" selector="{{PriceRuleConditionsSection.changeCategoriesButton}}" /> |
| 55 | + <click stepKey="showCategoriesChooser" selector="{{PriceRuleConditionsSection.categoriesChooser}}" /> |
| 56 | + <waitForAjaxLoad stepKey="ajaxLoad3"/> |
| 57 | + |
| 58 | + <waitForElement selector="{{PriceRuleConditionsSection.treeRoot}}" stepKey="wait3"/> |
| 59 | + <click stepKey="openLatestTreeNode1" selector="{{PriceRuleConditionsSection.lastTreeNode" /> |
| 60 | + <click stepKey="openLatestTreeNode2" selector="{{PriceRuleConditionsSection.lastTreeNode" /> |
| 61 | + <click stepKey="openLatestTreeNode3" selector="{{PriceRuleConditionsSection.lastTreeNode" /> |
| 62 | + <waitForAjaxLoad stepKey="ajaxLoad4"/> |
| 63 | + <waitForElement selector="{{PriceRuleConditionsSection.subcategory4level}}" stepKey="wait4"/> |
| 64 | + <click stepKey="openLatestTreeNode4" selector="{{PriceRuleConditionsSection.subcategory4level}}" /> |
| 65 | + </test> |
| 66 | +</tests> |
0 commit comments