|
| 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="AdminSortingAssociatedProductsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="GroupedProduct"/> |
| 14 | + <stories value="MAGETWO-91633: Grouped Products: Associated Products Can't Be Sorted Between Pages"/> |
| 15 | + <title value="Grouped Products: Sorting Associated Products Between Pages"/> |
| 16 | + <description value="Make sure that products in grid were recalculated when sorting associated products between pages"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MAGETWO-95085"/> |
| 19 | + <group value="GroupedProduct"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 23 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 24 | + <!-- Create 23 products so that grid can have more than one page --> |
| 25 | + <createData entity="ApiSimpleProduct" stepKey="product1"> |
| 26 | + <requiredEntity createDataKey="category"/> |
| 27 | + </createData> |
| 28 | + <createData entity="ApiSimpleProduct" stepKey="product2"> |
| 29 | + <requiredEntity createDataKey="category"/> |
| 30 | + </createData> |
| 31 | + <createData entity="ApiSimpleProduct" stepKey="product3"> |
| 32 | + <requiredEntity createDataKey="category"/> |
| 33 | + </createData> |
| 34 | + <createData entity="ApiSimpleProduct" stepKey="product4"> |
| 35 | + <requiredEntity createDataKey="category"/> |
| 36 | + </createData> |
| 37 | + <createData entity="ApiSimpleProduct" stepKey="product5"> |
| 38 | + <requiredEntity createDataKey="category"/> |
| 39 | + </createData> |
| 40 | + <createData entity="ApiSimpleProduct" stepKey="product6"> |
| 41 | + <requiredEntity createDataKey="category"/> |
| 42 | + </createData> |
| 43 | + <createData entity="ApiSimpleProduct" stepKey="product7"> |
| 44 | + <requiredEntity createDataKey="category"/> |
| 45 | + </createData> |
| 46 | + <createData entity="ApiSimpleProduct" stepKey="product8"> |
| 47 | + <requiredEntity createDataKey="category"/> |
| 48 | + </createData> |
| 49 | + <createData entity="ApiSimpleProduct" stepKey="product9"> |
| 50 | + <requiredEntity createDataKey="category"/> |
| 51 | + </createData> |
| 52 | + <createData entity="ApiSimpleProduct" stepKey="product10"> |
| 53 | + <requiredEntity createDataKey="category"/> |
| 54 | + </createData> |
| 55 | + <createData entity="ApiSimpleProduct" stepKey="product11"> |
| 56 | + <requiredEntity createDataKey="category"/> |
| 57 | + </createData> |
| 58 | + <createData entity="ApiSimpleProduct" stepKey="product12"> |
| 59 | + <requiredEntity createDataKey="category"/> |
| 60 | + </createData> |
| 61 | + <createData entity="ApiSimpleProduct" stepKey="product13"> |
| 62 | + <requiredEntity createDataKey="category"/> |
| 63 | + </createData> |
| 64 | + <createData entity="ApiSimpleProduct" stepKey="product14"> |
| 65 | + <requiredEntity createDataKey="category"/> |
| 66 | + </createData> |
| 67 | + <createData entity="ApiSimpleProduct" stepKey="product15"> |
| 68 | + <requiredEntity createDataKey="category"/> |
| 69 | + </createData> |
| 70 | + <createData entity="ApiSimpleProduct" stepKey="product16"> |
| 71 | + <requiredEntity createDataKey="category"/> |
| 72 | + </createData> |
| 73 | + <createData entity="ApiSimpleProduct" stepKey="product17"> |
| 74 | + <requiredEntity createDataKey="category"/> |
| 75 | + </createData> |
| 76 | + <createData entity="ApiSimpleProduct" stepKey="product18"> |
| 77 | + <requiredEntity createDataKey="category"/> |
| 78 | + </createData> |
| 79 | + <createData entity="ApiSimpleProduct" stepKey="product19"> |
| 80 | + <requiredEntity createDataKey="category"/> |
| 81 | + </createData> |
| 82 | + <createData entity="ApiSimpleProduct" stepKey="product20"> |
| 83 | + <requiredEntity createDataKey="category"/> |
| 84 | + </createData> |
| 85 | + <createData entity="ApiSimpleProduct" stepKey="product21"> |
| 86 | + <requiredEntity createDataKey="category"/> |
| 87 | + </createData> |
| 88 | + <createData entity="ApiSimpleProduct" stepKey="product22"> |
| 89 | + <requiredEntity createDataKey="category"/> |
| 90 | + </createData> |
| 91 | + <createData entity="ApiSimpleProduct" stepKey="product23"> |
| 92 | + <requiredEntity createDataKey="category"/> |
| 93 | + </createData> |
| 94 | + </before> |
| 95 | + <after> |
| 96 | + <!--Delete created grouped product--> |
| 97 | + <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> |
| 98 | + <argument name="product" value="GroupedProduct"/> |
| 99 | + </actionGroup> |
| 100 | + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" |
| 101 | + dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> |
| 102 | + <deleteData createDataKey="product1" stepKey="deleteProduct1"/> |
| 103 | + <deleteData createDataKey="product2" stepKey="deleteProduct2"/> |
| 104 | + <deleteData createDataKey="product3" stepKey="deleteProduct3"/> |
| 105 | + <deleteData createDataKey="product4" stepKey="deleteProduct4"/> |
| 106 | + <deleteData createDataKey="product5" stepKey="deleteProduct5"/> |
| 107 | + <deleteData createDataKey="product6" stepKey="deleteProduct6"/> |
| 108 | + <deleteData createDataKey="product7" stepKey="deleteProduct7"/> |
| 109 | + <deleteData createDataKey="product8" stepKey="deleteProduct8"/> |
| 110 | + <deleteData createDataKey="product9" stepKey="deleteProduct9"/> |
| 111 | + <deleteData createDataKey="product10" stepKey="deleteProduct10"/> |
| 112 | + <deleteData createDataKey="product11" stepKey="deleteProduct11"/> |
| 113 | + <deleteData createDataKey="product12" stepKey="deleteProduct12"/> |
| 114 | + <deleteData createDataKey="product13" stepKey="deleteProduct13"/> |
| 115 | + <deleteData createDataKey="product14" stepKey="deleteProduct14"/> |
| 116 | + <deleteData createDataKey="product15" stepKey="deleteProduct15"/> |
| 117 | + <deleteData createDataKey="product16" stepKey="deleteProduct16"/> |
| 118 | + <deleteData createDataKey="product17" stepKey="deleteProduct17"/> |
| 119 | + <deleteData createDataKey="product18" stepKey="deleteProduct18"/> |
| 120 | + <deleteData createDataKey="product19" stepKey="deleteProduct19"/> |
| 121 | + <deleteData createDataKey="product20" stepKey="deleteProduct20"/> |
| 122 | + <deleteData createDataKey="product21" stepKey="deleteProduct21"/> |
| 123 | + <deleteData createDataKey="product22" stepKey="deleteProduct22"/> |
| 124 | + <deleteData createDataKey="product23" stepKey="deleteProduct23"/> |
| 125 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 126 | + <actionGroup ref="logout" stepKey="logout"/> |
| 127 | + </after> |
| 128 | + |
| 129 | + <!--Create grouped Product--> |
| 130 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
| 131 | + <waitForPageLoad stepKey="waitForProductIndexPage"/> |
| 132 | + <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> |
| 133 | + <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> |
| 134 | + <argument name="product" value="GroupedProduct"/> |
| 135 | + </actionGroup> |
| 136 | + <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> |
| 137 | + <argument name="product" value="GroupedProduct"/> |
| 138 | + </actionGroup> |
| 139 | + |
| 140 | + <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/> |
| 141 | + <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> |
| 142 | + <click selector="body" stepKey="clickBodyToCorrectFocusGrouped"/> |
| 143 | + <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> |
| 144 | + <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal"/> |
| 145 | + <actionGroup ref="filterProductGridBySku2" stepKey="filterGroupedProducts"> |
| 146 | + <argument name="sku" value="api-simple-product"/> |
| 147 | + </actionGroup> |
| 148 | + |
| 149 | + <!-- Select all, then start the bulk update attributes flow --> |
| 150 | + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> |
| 151 | + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> |
| 152 | + |
| 153 | + <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> |
| 154 | + <waitForPageLoad stepKey="waitForProductsAdded"/> |
| 155 | + |
| 156 | + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> |
| 157 | + |
| 158 | + <!--Open created Product group--> |
| 159 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> |
| 160 | + <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> |
| 161 | + <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/> |
| 162 | + <actionGroup ref="searchProductGridByKeyword" stepKey="searchProductGridForm"> |
| 163 | + <argument name="keyword" value="GroupedProduct.name"/> |
| 164 | + </actionGroup> |
| 165 | + <click selector="{{AdminProductGridSection.selectRowBasedOnName(GroupedProduct.name)}}" stepKey="openGroupedProduct"/> |
| 166 | + <waitForPageLoad stepKey="waitForProductEditPageLoad"/> |
| 167 | + |
| 168 | + <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection2"/> |
| 169 | + <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection2"/> |
| 170 | + |
| 171 | + <!--Change position value for the Product Position 0--> |
| 172 | + <grabTextFrom selector="{{AdminProductFormGroupedProductsSection.nameProductFromGrid('1')}}" stepKey="grabNameProductPosition0"/> |
| 173 | + <grabTextFrom selector="{{AdminProductFormGroupedProductsSection.nameProductFromGrid('2')}}" stepKey="grabNameProductPositionFirst"/> |
| 174 | + <fillField selector="{{AdminProductFormGroupedProductsSection.positionProduct('1')}}" userInput="21" stepKey="fillFieldProductPosition0"/> |
| 175 | + <doubleClick selector="{{AdminProductFormGroupedProductsSection.nextActionButton}}" stepKey="clickButton"/> |
| 176 | + <waitForAjaxLoad stepKey="waitForAjax1"/> |
| 177 | + |
| 178 | + <!--Go to next page and verify that Products in grid were recalculated--> |
| 179 | + <doubleClick selector="{{AdminProductFormGroupedProductsSection.nextActionButton}}" stepKey="clickNextActionButton"/> |
| 180 | + <waitForAjaxLoad stepKey="waitForAjax2"/> |
| 181 | + |
| 182 | + <grabTextFrom selector="{{AdminProductFormGroupedProductsSection.nameProductFromGrid('2')}}" stepKey="grabNameProductPosition21"/> |
| 183 | + <assertEquals stepKey="assertProductsRecalculated"> |
| 184 | + <actualResult type="string">$grabNameProductPosition0</actualResult> |
| 185 | + <expectedResult type="string">$grabNameProductPosition21</expectedResult> |
| 186 | + </assertEquals> |
| 187 | + |
| 188 | + <!--Change position value for the product to 1--> |
| 189 | + <fillField selector="{{AdminProductFormGroupedProductsSection.positionProduct('2')}}" userInput="1" stepKey="fillFieldProductPosition1"/> |
| 190 | + <doubleClick selector="{{AdminProductFormGroupedProductsSection.previousActionButton}}" stepKey="clickButton2"/> |
| 191 | + <waitForAjaxLoad stepKey="waitForAjax3"/> |
| 192 | + |
| 193 | + <!--Go to previous page and verify that Products in grid were recalculated--> |
| 194 | + <click selector="{{AdminProductFormGroupedProductsSection.previousActionButton}}" stepKey="clickPreviousActionButton"/> |
| 195 | + <waitForAjaxLoad stepKey="waitForAjax4"/> |
| 196 | + <grabTextFrom selector="{{AdminProductFormGroupedProductsSection.nameProductFromGrid('2')}}" stepKey="grabNameProductPosition2"/> |
| 197 | + <grabTextFrom selector="{{AdminProductFormGroupedProductsSection.nameProductFromGrid('1')}}" stepKey="grabNameProductPositionZero"/> |
| 198 | + <assertEquals stepKey="assertProductsRecalculated2"> |
| 199 | + <actualResult type="string">$grabNameProductPosition2</actualResult> |
| 200 | + <expectedResult type="string">$grabNameProductPosition0</expectedResult> |
| 201 | + </assertEquals> |
| 202 | + <assertEquals stepKey="assertProductsRecalculated3"> |
| 203 | + <actualResult type="string">$grabNameProductPositionFirst</actualResult> |
| 204 | + <expectedResult type="string">$grabNameProductPositionZero</expectedResult> |
| 205 | + </assertEquals> |
| 206 | + </test> |
| 207 | +</tests> |
0 commit comments