|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminCreateCategoryWithNoAnchorFieldTest"> |
| 11 | + <annotations> |
| 12 | + <stories value="Create categories"/> |
| 13 | + <title value="Create no anchor subcategory with all fields"/> |
| 14 | + <description value="Login as admin and create no anchor subcategory with all fields"/> |
| 15 | + <testCaseId value=""/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <group value="Catalog"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> |
| 22 | + <createData entity="_defaultBlock" stepKey="createDefaultCMSBlock"/> |
| 23 | + <createData entity="defaultSimpleProduct" stepKey="simpleProduct" /> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> |
| 27 | + <actionGroup ref="logout" stepKey="logout"/> |
| 28 | + <deleteData createDataKey="createDefaultCMSBlock" stepKey="deleteDefaultCMSBlock"/> |
| 29 | + <deleteData stepKey="deleteSimpleProduct" createDataKey="simpleProduct"/> |
| 30 | + </after> |
| 31 | + |
| 32 | + <!--Create SubCategory--> |
| 33 | + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/> |
| 34 | + <waitForPageLoad stepKey="waitForPageToLoaded"/> |
| 35 | + <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/> |
| 36 | + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{_defaultCategory.name}}" stepKey="fillCategoryName"/> |
| 37 | + <checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory"/> |
| 38 | + |
| 39 | + <!--Select Content and fill the options--> |
| 40 | + <scrollTo selector="{{AdminCategoryContentSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToContent"/> |
| 41 | + <click selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="selectContent"/> |
| 42 | + <scrollTo selector="{{AdminCategoryContentSection.AddCMSBlock}}" x="0" y="-80" stepKey="scrollToAddCMSBlock"/> |
| 43 | + <selectOption selector="{{AdminCategoryContentSection.AddCMSBlock}}" userInput="$$createDefaultCMSBlock.title$$" stepKey="selectCMSBlock"/> |
| 44 | + |
| 45 | + <!--Select Display Setting and fill the options--> |
| 46 | + <scrollTo selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" x="0" y="-80" stepKey="scrollToDisplaySetting"/> |
| 47 | + <click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="selectDisplaySetting"/> |
| 48 | + <selectOption selector="{{CategoryDisplaySettingsSection.displayMode}}" userInput="PRODUCTS_AND_PAGE" stepKey="selectdisplayMode"/> |
| 49 | + <click selector="{{CategoryDisplaySettingsSection.anchorLabel}}" stepKey="uncheckAnchor"/> |
| 50 | + <click selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" stepKey="enableTheAvailableProductList"/> |
| 51 | + <selectOption selector="{{CategoryDisplaySettingsSection.productList}}" parameterArray="['Position', 'Product Name', 'Price']" stepKey="selectPrice"/> |
| 52 | + <scrollTo selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" x="0" y="-80" stepKey="scrollToDefaultProductList"/> |
| 53 | + <click selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" stepKey="enableTheDefaultProductList"/> |
| 54 | + <selectOption selector="{{CategoryDisplaySettingsSection.defaultProductList}}" userInput="name" stepKey="selectProductName"/> |
| 55 | + <scrollTo selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}" x="0" y="-80" stepKey="scrollToLayeredNavPrice"/> |
| 56 | + <click selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}" stepKey="enableLayeredNavigationPrice"/> |
| 57 | + <fillField selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceInput}}" userInput="5.5" stepKey="fillThePrice"/> |
| 58 | + |
| 59 | + <!--Search the products and select the category products--> |
| 60 | + <actionGroup ref="AdminAddProductToCategoryActionGroup" stepKey="addProductToCategory"> |
| 61 | + <argument name="product" value="$$simpleProduct$$"/> |
| 62 | + </actionGroup> |
| 63 | + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="clickSaveButton"/> |
| 64 | + <waitForPageLoad stepKey="waitForCategorySaved"/> |
| 65 | + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the category." stepKey="assertSuccessMessage"/> |
| 66 | + <waitForPageLoad stepKey="waitForPageTitleToBeSaved"/> |
| 67 | + |
| 68 | + <!-- Get Category ID --> |
| 69 | + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> |
| 70 | + <argument name="category" value="{{_defaultCategory.name}}"/> |
| 71 | + </actionGroup> |
| 72 | + <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> |
| 73 | + |
| 74 | + <!--Verify the Category Title--> |
| 75 | + <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" /> |
| 76 | + |
| 77 | + <!--Verify Url Rewrite--> |
| 78 | + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> |
| 79 | + <argument name="redirectPath" value="{{_defaultCategory.name_lwr}}.html"/> |
| 80 | + <argument name="redirectType" value="No"/> |
| 81 | + <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> |
| 82 | + </actionGroup> |
| 83 | + |
| 84 | + <!--Verify Product in store front page--> |
| 85 | + <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.name_lwr)}}" stepKey="amOnCategoryPage"/> |
| 86 | + <waitForPageLoad stepKey="waitForPageToBeLoaded"/> |
| 87 | + <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/> |
| 88 | + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> |
| 89 | + <waitForPageLoad stepKey="waitForProductToLoad"/> |
| 90 | + <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.urlKey$$)}}" stepKey="seeProductInCategory"/> |
| 91 | + <dontSeeElement selector="{{StorefrontCategorySidebarSection.filterOptions}}" stepKey="dontSeeFilterOptionsForNonAnchorCategory"/> |
| 92 | + </test> |
| 93 | +</tests> |
0 commit comments