|
| 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="PageBuilderCatalogCategoryVerifyCategoryFullWidthLayoutTest"> |
| 11 | + <annotations> |
| 12 | + <features value="PageBuilder"/> |
| 13 | + <stories value="Catalog Category"/> |
| 14 | + <title value="Verify the Category – Full Width layout on the storefront with all category content"/> |
| 15 | + <description value="This test is intended to verify the category - full width layout on the storefront with all category content"/> |
| 16 | + <severity value="CRITICAL"/> |
| 17 | + <useCaseId value=""/> |
| 18 | + <testCaseId value="MC-15481"/> |
| 19 | + <group value="pagebuilder"/> |
| 20 | + <group value="pagebuilder-layout"/> |
| 21 | + <group value="pagebuilder-fullwidth"/> |
| 22 | + <group value="pagebuilder-catalog-category"/> |
| 23 | + </annotations> |
| 24 | + <before> |
| 25 | + <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> |
| 26 | + <createData entity="_defaultProduct" stepKey="createPreReqProduct1"> |
| 27 | + <requiredEntity createDataKey="createPreReqCategory"/> |
| 28 | + </createData> |
| 29 | + <createData entity="_defaultProduct" stepKey="createPreReqProduct2"> |
| 30 | + <requiredEntity createDataKey="createPreReqCategory"/> |
| 31 | + </createData> |
| 32 | + <createData entity="_emptyCmsBlock" stepKey="createPreReqCMSBlock"/> |
| 33 | + <resizeWindow width="1280" height="1024" stepKey="resizeWindowToDesktop1"/> |
| 34 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 35 | + |
| 36 | + <!-- Navigate to CMS Block --> |
| 37 | + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToAPageWithPageBuilder"> |
| 38 | + <argument name="CMSBlockPage" value="$$createPreReqCMSBlock$$"/> |
| 39 | + </actionGroup> |
| 40 | + <actionGroup ref="AdminOpenPageBuilderFromContentPreviewOverlayActionGroup" stepKey="openPageBuilderFullScreen"/> |
| 41 | + <!-- Add Row --> |
| 42 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer1"> |
| 43 | + <argument name="contentType" value="PageBuilderRowContentType"/> |
| 44 | + <argument name="containerTargetType" value="PageBuilderRootContainerContentType"/> |
| 45 | + </actionGroup> |
| 46 | + <!-- Edit Row --> |
| 47 | + <actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage1"> |
| 48 | + <argument name="contentType" value="PageBuilderRowContentType"/> |
| 49 | + </actionGroup> |
| 50 | + <actionGroup ref="chooseVisualSelectOption" stepKey="setAppearance1"> |
| 51 | + <argument name="property" value="PageBuilderRowAppearance_FullWidth"/> |
| 52 | + </actionGroup> |
| 53 | + <actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBackgroundColor1"> |
| 54 | + <argument name="property" value="PageBuilderBackgroundColor_Cornflower"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="saveEditPanelSettingsFullScreen" stepKey="saveEditPanelSettings1"/> |
| 57 | + <!-- Add Heading to Row --> |
| 58 | + <actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection1"> |
| 59 | + <argument name="contentType" value="PageBuilderHeadingContentType"/> |
| 60 | + </actionGroup> |
| 61 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragHeadingOntoStage1"> |
| 62 | + <argument name="contentType" value="PageBuilderHeadingContentType"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="enterHeadingOnStage" stepKey="enterHeadingOnStage1"> |
| 65 | + <argument name="headingText" value="PageBuilderHeadingTextSample5"/> |
| 66 | + </actionGroup> |
| 67 | + <!-- Save CMS Block --> |
| 68 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen1"/> |
| 69 | + <actionGroup ref="SaveCMSBlockActionGroup" stepKey="saveCMSBlock"/> |
| 70 | + </before> |
| 71 | + <after> |
| 72 | + <resizeWindow width="1280" height="1024" stepKey="resizeWindowToDesktop2"/> |
| 73 | + <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> |
| 74 | + <deleteData createDataKey="createPreReqProduct1" stepKey="deletePreReqProduct1"/> |
| 75 | + <deleteData createDataKey="createPreReqProduct2" stepKey="deletePreReqProduct2"/> |
| 76 | + <deleteData createDataKey="createPreReqCMSBlock" stepKey="deletePreReqCMSBlock"/> |
| 77 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 78 | + </after> |
| 79 | + <!-- Navigate to Category --> |
| 80 | + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedCategory"> |
| 81 | + <argument name="Category" value="$$createPreReqCategory$$"/> |
| 82 | + </actionGroup> |
| 83 | + <actionGroup ref="expandAdminCategorySection" stepKey="expandAdminCategorySection"/> |
| 84 | + <!-- Add Row --> |
| 85 | + <actionGroup ref="openPageBuilderForAttribute" stepKey="enablePageBuilderOnCatalog"/> |
| 86 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer2"> |
| 87 | + <argument name="contentType" value="PageBuilderRowContentType"/> |
| 88 | + <argument name="containerTargetType" value="PageBuilderRootContainerContentType"/> |
| 89 | + </actionGroup> |
| 90 | + <!-- Edit Row --> |
| 91 | + <actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage2"> |
| 92 | + <argument name="contentType" value="PageBuilderRowContentType"/> |
| 93 | + </actionGroup> |
| 94 | + <!-- Set Appearance to Full-Width --> |
| 95 | + <actionGroup ref="chooseVisualSelectOption" stepKey="setAppearance2"> |
| 96 | + <argument name="property" value="PageBuilderRowAppearance_FullWidth"/> |
| 97 | + </actionGroup> |
| 98 | + <!-- Set Background Color --> |
| 99 | + <actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterBackgroundColor2"> |
| 100 | + <argument name="property" value="PageBuilderBackgroundColor_Sprout"/> |
| 101 | + </actionGroup> |
| 102 | + <actionGroup ref="saveEditPanelSettingsFullScreen" stepKey="saveEditPanelSettings2"/> |
| 103 | + <!-- Add Heading to Row --> |
| 104 | + <actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandPageBuilderPanelMenuSection2"> |
| 105 | + <argument name="contentType" value="PageBuilderHeadingContentType"/> |
| 106 | + </actionGroup> |
| 107 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragHeadingOntoStage2"> |
| 108 | + <argument name="contentType" value="PageBuilderHeadingContentType"/> |
| 109 | + </actionGroup> |
| 110 | + <actionGroup ref="enterHeadingOnStage" stepKey="enterHeadingOnStage2"> |
| 111 | + <argument name="headingText" value="PageBuilderHeadingTextSample1"/> |
| 112 | + </actionGroup> |
| 113 | + <actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen2"/> |
| 114 | + <actionGroup ref="saveCatalogCategory" stepKey="saveCatalogCategory1"/> |
| 115 | + |
| 116 | + <!-- Add Category Image --> |
| 117 | + <actionGroup ref="AddCategoryImageActionGroup" stepKey="addCategoryImage"> |
| 118 | + <argument name="image" value="PageBuilderImageProperty_PNG"/> |
| 119 | + </actionGroup> |
| 120 | + <!-- Add CMS Block --> |
| 121 | + <selectOption selector="{{AdminCategoryContentSection.AddCMSBlock}}" stepKey="selectSavedBlock" userInput="{{_emptyCmsBlock.title}}"/> |
| 122 | + <!-- Set Display Mode: Static block and products --> |
| 123 | + <waitForElementVisible selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" stepKey="waitForDisplaySettingsSection"/> |
| 124 | + <conditionalClick selector="{{AdminCategoryDisplaySettingsSection.settingsHeader}}" dependentSelector="{{AdminCategoryDisplaySettingsSection.displayMode}}" visible="false" stepKey="openDisplaySettingsSection"/> |
| 125 | + <waitForPageLoad stepKey="waitForDisplaySettingsLoad"/> |
| 126 | + <selectOption userInput="Static block and products" selector="{{AdminCategoryDisplaySettingsSection.displayMode}}" stepKey="selectStaticBlockAndProductsOption"/> |
| 127 | + <!-- Set Products in Category --> |
| 128 | + <actionGroup ref="OpenProductsInCategorySectionActionGroup" stepKey="openProductsInCategorySection"/> |
| 129 | + <actionGroup ref="GoToAddProductsBySearchActionGroup" stepKey="goToAddProductsBySearch"/> |
| 130 | + <!-- Assign First Product --> |
| 131 | + <actionGroup ref="SearchAProductForCategoryByKeywordActionGroup" stepKey="searchFirstProductForCategoryByKeyword"> |
| 132 | + <argument name="keyword" value="$$createPreReqProduct1.sku$$"/> |
| 133 | + </actionGroup> |
| 134 | + <!-- Assign Second Product --> |
| 135 | + <actionGroup ref="SearchAProductForCategoryByKeywordActionGroup" stepKey="searchSecondProductForCategoryByKeyword"> |
| 136 | + <argument name="keyword" value="$$createPreReqProduct2.name$$"/> |
| 137 | + </actionGroup> |
| 138 | + <!-- Click save and close --> |
| 139 | + <click selector="{{AdminCategoryAddProductsModalSection.saveClose}}" stepKey="clickSaveClose"/> |
| 140 | + <!-- Use Category - Full Width layout --> |
| 141 | + <actionGroup ref="SetLayoutActionGroup" stepKey="setCategoryFullWidthLayout"> |
| 142 | + <argument name="designSection" value="CmsDesignSection"/> |
| 143 | + <argument name="layoutOption" value="PageBuilderFullWidthLayout.category"/> |
| 144 | + </actionGroup> |
| 145 | + <!-- Save Category --> |
| 146 | + <actionGroup ref="saveCatalogCategory" stepKey="saveCatalogCategory2"/> |
| 147 | + |
| 148 | + <!-- Navigate to Storefront Category Page --> |
| 149 | + <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openStorefrontCategoryPage"> |
| 150 | + <argument name="categoryName" value="$$createPreReqCategory.name$$"/> |
| 151 | + </actionGroup> |
| 152 | + |
| 153 | + <!-- Validate in Storefront - Fullscreen --> |
| 154 | + <seeElement selector="{{StorefrontCategoryMainSection.imageSource(PageBuilderImageProperty_PNG.filename)}}" stepKey="seeCategoryImage1"/> |
| 155 | + <actionGroup ref="StorefrontValidateCategoryDescriptionAppearanceActionGroup" stepKey="validateDataAppearance1"> |
| 156 | + <argument name="dataAppearance" value="full-width"/> |
| 157 | + </actionGroup> |
| 158 | + <waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextSample1.value, '1')}}" stepKey="waitForStorefrontHeadingText1"/> |
| 159 | + <waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextSample5.value, '1')}}" stepKey="waitForStorefrontHeadingText2"/> |
| 160 | + <actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeFirstProductInCategory1"> |
| 161 | + <argument name="selector" value="{{StorefrontCategoryProductSection.ProductTitleByName('$$createPreReqProduct1.name$$')}}"/> |
| 162 | + </actionGroup> |
| 163 | + <actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeSecondProductInCategory1"> |
| 164 | + <argument name="selector" value="{{StorefrontCategoryProductSection.ProductTitleByName('$$createPreReqProduct2.name$$')}}"/> |
| 165 | + </actionGroup> |
| 166 | + <!-- Assert sections on page are in correct order --> |
| 167 | + <executeJS function="return document.querySelectorAll('{{StorefrontCategoryMainSection.categoryImage}}')[0].getBoundingClientRect().y" stepKey="categoryImagePosition1"/> |
| 168 | + <executeJS function="return document.querySelectorAll('{{StorefrontCategoryMainSection.categoryDescription}}')[0].getBoundingClientRect().y" stepKey="categoryDescriptionPosition1"/> |
| 169 | + <executeJS function="return document.querySelectorAll('{{StorefrontCategoryMainSection.categoryCMS}}')[0].getBoundingClientRect().y" stepKey="categoryCMSPosition1"/> |
| 170 | + <assertGreaterThan stepKey="assertDescriptionBelowCategoryImage1"> |
| 171 | + <expectedResult type="variable">categoryImagePosition1</expectedResult> |
| 172 | + <actualResult type="variable">categoryDescriptionPosition1</actualResult> |
| 173 | + </assertGreaterThan> |
| 174 | + <assertGreaterThan stepKey="assertCategoryCMSBelowCategoryDescription1"> |
| 175 | + <expectedResult type="variable">categoryDescriptionPosition1</expectedResult> |
| 176 | + <actualResult type="variable">categoryCMSPosition1</actualResult> |
| 177 | + </assertGreaterThan> |
| 178 | + |
| 179 | + |
| 180 | + <!-- Validate in Storefront - 1600px width --> |
| 181 | + <resizeWindow width="1600" height="1024" stepKey="resizeWindowWidth1"/> |
| 182 | + <seeElement selector="{{StorefrontCategoryMainSection.imageSource(PageBuilderImageProperty_PNG.filename)}}" stepKey="seeCategoryImage2"/> |
| 183 | + <actionGroup ref="StorefrontValidateCategoryDescriptionAppearanceActionGroup" stepKey="validateDataAppearance2"> |
| 184 | + <argument name="dataAppearance" value="full-width"/> |
| 185 | + </actionGroup> |
| 186 | + <waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextSample1.value, '1')}}" stepKey="waitForStorefrontHeadingText3"/> |
| 187 | + <waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextSample5.value, '1')}}" stepKey="waitForStorefrontHeadingText4"/> |
| 188 | + <actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeFirstProductInCategory2"> |
| 189 | + <argument name="selector" value="{{StorefrontCategoryProductSection.ProductTitleByName('$$createPreReqProduct1.name$$')}}"/> |
| 190 | + </actionGroup> |
| 191 | + <actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeSecondProductInCategory2"> |
| 192 | + <argument name="selector" value="{{StorefrontCategoryProductSection.ProductTitleByName('$$createPreReqProduct2.name$$')}}"/> |
| 193 | + </actionGroup> |
| 194 | + <!-- Assert sections on page are in correct order --> |
| 195 | + <executeJS function="return document.querySelectorAll('{{StorefrontCategoryMainSection.categoryImage}}')[0].getBoundingClientRect().y" stepKey="categoryImagePosition2"/> |
| 196 | + <executeJS function="return document.querySelectorAll('{{StorefrontCategoryMainSection.categoryDescription}}')[0].getBoundingClientRect().y" stepKey="categoryDescriptionPosition2"/> |
| 197 | + <executeJS function="return document.querySelectorAll('{{StorefrontCategoryMainSection.categoryCMS}}')[0].getBoundingClientRect().y" stepKey="categoryCMSPosition2"/> |
| 198 | + <assertGreaterThan stepKey="assertDescriptionBelowCategoryImage2"> |
| 199 | + <expectedResult type="variable">categoryImagePosition2</expectedResult> |
| 200 | + <actualResult type="variable">categoryDescriptionPosition2</actualResult> |
| 201 | + </assertGreaterThan> |
| 202 | + <assertGreaterThan stepKey="assertCategoryCMSBelowCategoryDescription2"> |
| 203 | + <expectedResult type="variable">categoryDescriptionPosition2</expectedResult> |
| 204 | + <actualResult type="variable">categoryCMSPosition2</actualResult> |
| 205 | + </assertGreaterThan> |
| 206 | + |
| 207 | + <!-- Validate in Storefront - 600px width --> |
| 208 | + <resizeWindow width="600" height="1024" stepKey="resizeWindowWidth2"/> |
| 209 | + <seeElement selector="{{StorefrontCategoryMainSection.imageSource(PageBuilderImageProperty_PNG.filename)}}" stepKey="seeCategoryImage3"/> |
| 210 | + <actionGroup ref="StorefrontValidateCategoryDescriptionAppearanceActionGroup" stepKey="validateDataAppearance3"> |
| 211 | + <argument name="dataAppearance" value="full-width"/> |
| 212 | + </actionGroup> |
| 213 | + <waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextSample1.value, '1')}}" stepKey="waitForStorefrontHeadingText5"/> |
| 214 | + <waitForElementVisible selector="{{HeadingOnStorefront.headingText(PageBuilderHeadingTypeProperty_H2.value, PageBuilderHeadingTextSample5.value, '1')}}" stepKey="waitForStorefrontHeadingText6"/> |
| 215 | + <actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeFirstProductInCategory3"> |
| 216 | + <argument name="selector" value="{{StorefrontCategoryProductSection.ProductTitleByName('$$createPreReqProduct1.name$$')}}"/> |
| 217 | + </actionGroup> |
| 218 | + <actionGroup ref="AssertStorefrontSeeElementActionGroup" stepKey="seeSecondProductInCategory3"> |
| 219 | + <argument name="selector" value="{{StorefrontCategoryProductSection.ProductTitleByName('$$createPreReqProduct2.name$$')}}"/> |
| 220 | + </actionGroup> |
| 221 | + <!-- Assert sections on page are in correct order --> |
| 222 | + <executeJS function="return document.querySelectorAll('{{StorefrontCategoryMainSection.categoryImage}}')[0].getBoundingClientRect().y" stepKey="categoryImagePosition3"/> |
| 223 | + <executeJS function="return document.querySelectorAll('{{StorefrontCategoryMainSection.categoryDescription}}')[0].getBoundingClientRect().y" stepKey="categoryDescriptionPosition3"/> |
| 224 | + <executeJS function="return document.querySelectorAll('{{StorefrontCategoryMainSection.categoryCMS}}')[0].getBoundingClientRect().y" stepKey="categoryCMSPosition3"/> |
| 225 | + <assertGreaterThan stepKey="assertDescriptionBelowCategoryImage3"> |
| 226 | + <expectedResult type="variable">categoryImagePosition3</expectedResult> |
| 227 | + <actualResult type="variable">categoryDescriptionPosition3</actualResult> |
| 228 | + </assertGreaterThan> |
| 229 | + <assertGreaterThan stepKey="assertCategoryCMSBelowCategoryDescription3"> |
| 230 | + <expectedResult type="variable">categoryDescriptionPosition3</expectedResult> |
| 231 | + <actualResult type="variable">categoryCMSPosition3</actualResult> |
| 232 | + </assertGreaterThan> |
| 233 | + </test> |
| 234 | +</tests> |
0 commit comments