|
| 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" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="StoreFrontProductsDisplayUsingElasticSearchTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Display All Products"/> |
| 14 | + <title value="Display All Products on a Page"/> |
| 15 | + <description value="Set Up Elastic Search and Display all Products on Page"/> |
| 16 | + <testCaseId value="MC-30209"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <group value="Catalog"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!-- Login Admin --> |
| 22 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 23 | + <!--Create Category and Simple Products--> |
| 24 | + <createData entity="SimpleSubCategory" stepKey="createCategory1"/> |
| 25 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 26 | + <requiredEntity createDataKey="createCategory1"/> |
| 27 | + </createData> |
| 28 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct2"> |
| 29 | + <requiredEntity createDataKey="createCategory1"/> |
| 30 | + </createData> |
| 31 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct3"> |
| 32 | + <requiredEntity createDataKey="createCategory1"/> |
| 33 | + </createData> |
| 34 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct4"> |
| 35 | + <requiredEntity createDataKey="createCategory1"/> |
| 36 | + </createData> |
| 37 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct5"> |
| 38 | + <requiredEntity createDataKey="createCategory1"/> |
| 39 | + </createData> |
| 40 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct6"> |
| 41 | + <requiredEntity createDataKey="createCategory1"/> |
| 42 | + </createData> |
| 43 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct7"> |
| 44 | + <requiredEntity createDataKey="createCategory1"/> |
| 45 | + </createData> |
| 46 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct8"> |
| 47 | + <requiredEntity createDataKey="createCategory1"/> |
| 48 | + </createData> |
| 49 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct9"> |
| 50 | + <requiredEntity createDataKey="createCategory1"/> |
| 51 | + </createData> |
| 52 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct10"> |
| 53 | + <requiredEntity createDataKey="createCategory1"/> |
| 54 | + </createData> |
| 55 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct11"> |
| 56 | + <requiredEntity createDataKey="createCategory1"/> |
| 57 | + </createData> |
| 58 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct12"> |
| 59 | + <requiredEntity createDataKey="createCategory1"/> |
| 60 | + </createData> |
| 61 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct13"> |
| 62 | + <requiredEntity createDataKey="createCategory1"/> |
| 63 | + </createData> |
| 64 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct14"> |
| 65 | + <requiredEntity createDataKey="createCategory1"/> |
| 66 | + </createData> |
| 67 | + |
| 68 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct15"> |
| 69 | + <requiredEntity createDataKey="createCategory1"/> |
| 70 | + </createData> |
| 71 | + |
| 72 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct16"> |
| 73 | + <requiredEntity createDataKey="createCategory1"/> |
| 74 | + </createData> |
| 75 | + |
| 76 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct17"> |
| 77 | + <requiredEntity createDataKey="createCategory1"/> |
| 78 | + </createData> |
| 79 | + |
| 80 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct18"> |
| 81 | + <requiredEntity createDataKey="createCategory1"/> |
| 82 | + </createData> |
| 83 | + |
| 84 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct19"> |
| 85 | + <requiredEntity createDataKey="createCategory1"/> |
| 86 | + </createData> |
| 87 | + |
| 88 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct20"> |
| 89 | + <requiredEntity createDataKey="createCategory1"/> |
| 90 | + </createData> |
| 91 | + |
| 92 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct21"> |
| 93 | + <requiredEntity createDataKey="createCategory1"/> |
| 94 | + </createData> |
| 95 | + |
| 96 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct22"> |
| 97 | + <requiredEntity createDataKey="createCategory1"/> |
| 98 | + </createData> |
| 99 | + |
| 100 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct23"> |
| 101 | + <requiredEntity createDataKey="createCategory1"/> |
| 102 | + </createData> |
| 103 | + |
| 104 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct24"> |
| 105 | + <requiredEntity createDataKey="createCategory1"/> |
| 106 | + </createData> |
| 107 | + |
| 108 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct25"> |
| 109 | + <requiredEntity createDataKey="createCategory1"/> |
| 110 | + </createData> |
| 111 | + |
| 112 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct26"> |
| 113 | + <requiredEntity createDataKey="createCategory1"/> |
| 114 | + </createData> |
| 115 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct27"> |
| 116 | + <requiredEntity createDataKey="createCategory1"/> |
| 117 | + </createData> |
| 118 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct28"> |
| 119 | + <requiredEntity createDataKey="createCategory1"/> |
| 120 | + </createData> |
| 121 | + |
| 122 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct29"> |
| 123 | + <requiredEntity createDataKey="createCategory1"/> |
| 124 | + </createData> |
| 125 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct30"> |
| 126 | + <requiredEntity createDataKey="createCategory1"/> |
| 127 | + </createData> |
| 128 | + |
| 129 | + <!--Enable ElasticSearch as search engine.--> |
| 130 | + <magentoCLI command="config:set catalog/search/engine elasticsearch6" stepKey="enableElasticSearchAsSearchEngine"/> |
| 131 | + <magentoCLI command="indexer:reindex" stepKey="performReindexAfterElasticSearchEnable"/> |
| 132 | + <magentoCLI command="cache:flush" stepKey="cleanCacheAfterElasticSearchEnable"/> |
| 133 | + |
| 134 | + </before> |
| 135 | + <after> |
| 136 | + <!--Delete created products, category --> |
| 137 | + <deleteData createDataKey="createCategory1" stepKey="deleteCategory"/> |
| 138 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct1"/> |
| 139 | + <deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 140 | + <deleteData createDataKey="createSimpleProduct3" stepKey="deleteSimpleProduct3"/> |
| 141 | + <deleteData createDataKey="createSimpleProduct4" stepKey="deleteSimpleProduct4"/> |
| 142 | + <deleteData createDataKey="createSimpleProduct5" stepKey="deleteSimpleProduct5"/> |
| 143 | + <deleteData createDataKey="createSimpleProduct6" stepKey="deleteSimpleProduct6"/> |
| 144 | + <deleteData createDataKey="createSimpleProduct7" stepKey="deleteSimpleProduct7"/> |
| 145 | + <deleteData createDataKey="createSimpleProduct8" stepKey="deleteSimpleProduct8"/> |
| 146 | + <deleteData createDataKey="createSimpleProduct9" stepKey="deleteSimpleProduct9"/> |
| 147 | + <deleteData createDataKey="createSimpleProduct10" stepKey="deleteSimpleProduct10"/> |
| 148 | + <deleteData createDataKey="createSimpleProduct11" stepKey="deleteSimpleProduct11"/> |
| 149 | + <deleteData createDataKey="createSimpleProduct12" stepKey="deleteSimpleProduct12"/> |
| 150 | + <deleteData createDataKey="createSimpleProduct13" stepKey="deleteSimpleProduct13"/> |
| 151 | + <deleteData createDataKey="createSimpleProduct14" stepKey="deleteSimpleProduct14"/> |
| 152 | + <deleteData createDataKey="createSimpleProduct15" stepKey="deleteSimpleProduct15"/> |
| 153 | + <deleteData createDataKey="createSimpleProduct16" stepKey="deleteSimpleProduct16"/> |
| 154 | + <deleteData createDataKey="createSimpleProduct17" stepKey="deleteSimpleProduct17"/> |
| 155 | + <deleteData createDataKey="createSimpleProduct18" stepKey="deleteSimpleProduct18"/> |
| 156 | + <deleteData createDataKey="createSimpleProduct19" stepKey="deleteSimpleProduct19"/> |
| 157 | + <deleteData createDataKey="createSimpleProduct20" stepKey="deleteSimpleProduct20"/> |
| 158 | + <deleteData createDataKey="createSimpleProduct21" stepKey="deleteSimpleProduct21"/> |
| 159 | + <deleteData createDataKey="createSimpleProduct22" stepKey="deleteSimpleProduct22"/> |
| 160 | + <deleteData createDataKey="createSimpleProduct23" stepKey="deleteSimpleProduct23"/> |
| 161 | + <deleteData createDataKey="createSimpleProduct24" stepKey="deleteSimpleProduct24"/> |
| 162 | + <deleteData createDataKey="createSimpleProduct25" stepKey="deleteSimpleProduct25"/> |
| 163 | + <deleteData createDataKey="createSimpleProduct26" stepKey="deleteSimpleProduct26"/> |
| 164 | + <deleteData createDataKey="createSimpleProduct27" stepKey="deleteSimpleProduct27"/> |
| 165 | + <deleteData createDataKey="createSimpleProduct28" stepKey="deleteSimpleProduct28"/> |
| 166 | + <deleteData createDataKey="createSimpleProduct29" stepKey="deleteSimpleProduct29"/> |
| 167 | + <deleteData createDataKey="createSimpleProduct30" stepKey="deleteSimpleProduct30"/> |
| 168 | + |
| 169 | + |
| 170 | + <!--Revert ElasticSearch as search engine.--> |
| 171 | + <actionGroup ref="ResetSearchEngineConfigurationActionGroup" stepKey="resetCatalogSearchConfiguration"/> |
| 172 | + <magentoCLI command="indexer:reindex" stepKey="performReindexAfterElasticSearchDisable"/> |
| 173 | + <magentoCLI command="cache:flush" stepKey="cleanCacheAfterElasticSearchDisable"/> |
| 174 | + <actionGroup ref="logout" stepKey="logout"/> |
| 175 | + </after> |
| 176 | + |
| 177 | + <!--Open Storefront on the myCategory page--> |
| 178 | + <amOnPage url="/$$createCategory1.name$$.html" stepKey="GoToStorefrontCategory"/> |
| 179 | + <waitForPageLoad stepKey="waitForStorefrontCategoryPageLoad"/> |
| 180 | + |
| 181 | + <!--Select 12 items per page and verify number of products displayed in each page --> |
| 182 | + <conditionalClick selector="{{StorefrontCategoryTopToolbarSection.gridMode}}" visible="true" dependentSelector="{{StorefrontCategoryTopToolbarSection.gridMode}}" stepKey="seeProductGridIsActive"/> |
| 183 | + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToBottomToolbarSection"/> |
| 184 | + <selectOption selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" userInput="12" stepKey="selectPerPageOption"/> |
| 185 | + <!--Verify number of products displayed in First Page --> |
| 186 | + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="12" stepKey="seeNumberOfProductsInFirstPage"/> |
| 187 | + <!--Verify number of products displayed in Second Page --> |
| 188 | + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton"/> |
| 189 | + <click selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="clickOnNextPage"/> |
| 190 | + <waitForPageLoad stepKey="waitForPageToLoad4"/> |
| 191 | + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="12" stepKey="seeNumberOfProductsInSecondPage"/> |
| 192 | + <!--Verify number of products displayed in third Page --> |
| 193 | + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton1"/> |
| 194 | + <click selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="clickOnNextPage1"/> |
| 195 | + <waitForPageLoad stepKey="waitForPageToLoad2"/> |
| 196 | + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="6" stepKey="seeNumberOfProductsInThirdPage"/> |
| 197 | + |
| 198 | + <!--Select First Page using page number--> |
| 199 | + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.previousPage}}" stepKey="scrollToPreviousPage4"/> |
| 200 | + <click selector="{{StorefrontCategoryBottomToolbarSection.pageNumber('1')}}" stepKey="clickOnFirstPage"/> |
| 201 | + <waitForPageLoad stepKey="waitForPageToLoad9"/> |
| 202 | + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="12" stepKey="seeNumberOfProductsFirstPage2"/> |
| 203 | + <!--Select 24 items per page and verify number of products displayed in each page --> |
| 204 | + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToPerPage"/> |
| 205 | + <selectOption selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" userInput="24" stepKey="selectPerPageOption1"/> |
| 206 | + <waitForPageLoad stepKey="waitForPageToLoad10"/> |
| 207 | + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="24" stepKey="seeNumberOfProductsInFirstPage3"/> |
| 208 | + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="scrollToNextButton2"/> |
| 209 | + <click selector="{{StorefrontCategoryBottomToolbarSection.nextPage}}" stepKey="clickOnNextPage2"/> |
| 210 | + <waitForPageLoad stepKey="waitForPageToLoad11"/> |
| 211 | + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="6" stepKey="seeNumberOfProductsInSecondPage3"/> |
| 212 | + <!--Select First Page using page number--> |
| 213 | + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.pageNumber('1')}}" stepKey="scrollToPreviousPage5"/> |
| 214 | + <click selector="{{StorefrontCategoryBottomToolbarSection.pageNumber('1')}}" stepKey="clickOnFirstPage2"/> |
| 215 | + <waitForPageLoad stepKey="waitForPageToLoad13"/> |
| 216 | + <!--Select 36 items per page and verify number of products displayed in each page --> |
| 217 | + <scrollTo selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" stepKey="scrollToPerPage4"/> |
| 218 | + <selectOption selector="{{StorefrontCategoryBottomToolbarSection.perPage}}" userInput="36" stepKey="selectPerPageOption2"/> |
| 219 | + <waitForPageLoad stepKey="waitForPageToLoad12"/> |
| 220 | + <seeNumberOfElements selector="{{StorefrontCategoryMainSection.productLink}}" userInput="30" stepKey="seeNumberOfProductsInFirstPage4"/> |
| 221 | + </test> |
| 222 | +</tests> |
0 commit comments