|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2024 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 9 | + <test name="AdminToVerifyDynamicRowsComponentWhenNewElementIsAddedTest"> |
| 10 | + <annotations> |
| 11 | + <features value="GroupedProduct"/> |
| 12 | + <stories value="Verify dynamic rows component"/> |
| 13 | + <title value="Admin to verify dynamic rows component behaviour when new element is added"/> |
| 14 | + <description value="Admin to verify dynamic rows component when new element is added in grouped product"/> |
| 15 | + <testCaseId value="AC-6478"/> |
| 16 | + <severity value="AVERAGE"/> |
| 17 | + <group value="GroupedProduct"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- creating category, simple products --> |
| 21 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 22 | + <createData entity="ApiSimpleProduct" stepKey="createProduct1"/> |
| 23 | + <createData entity="ApiSimpleProduct" stepKey="createProduct2"/> |
| 24 | + <createData entity="ApiSimpleProduct" stepKey="createProduct3"/> |
| 25 | + <createData entity="ApiSimpleProduct" stepKey="createProduct4"/> |
| 26 | + <createData entity="ApiSimpleProduct" stepKey="createProduct5"/> |
| 27 | + <createData entity="ApiSimpleProduct" stepKey="createProduct6"/> |
| 28 | + <createData entity="ApiSimpleProduct" stepKey="createProduct7"/> |
| 29 | + <createData entity="ApiSimpleProduct" stepKey="createProduct8"/> |
| 30 | + <createData entity="ApiSimpleProduct" stepKey="createProduct9"/> |
| 31 | + <createData entity="ApiSimpleProduct" stepKey="createProduct10"/> |
| 32 | + <createData entity="ApiSimpleProduct" stepKey="createProduct11"/> |
| 33 | + <createData entity="ApiSimpleProduct" stepKey="createProduct12"/> |
| 34 | + <createData entity="ApiSimpleProduct" stepKey="createProduct13"/> |
| 35 | + <createData entity="ApiSimpleProduct" stepKey="createProduct14"/> |
| 36 | + <createData entity="ApiSimpleProduct" stepKey="createProduct15"/> |
| 37 | + <createData entity="ApiSimpleProduct" stepKey="createProduct16"/> |
| 38 | + <createData entity="ApiSimpleProduct" stepKey="createProduct17"/> |
| 39 | + <createData entity="ApiSimpleProduct" stepKey="createProduct18"/> |
| 40 | + <createData entity="ApiSimpleProduct" stepKey="createProduct19"/> |
| 41 | + <createData entity="ApiSimpleProduct" stepKey="createProduct20"/> |
| 42 | + <createData entity="ApiSimpleProduct" stepKey="createProduct21"/> |
| 43 | + <createData entity="ApiSimpleProduct" stepKey="createProduct22"/> |
| 44 | + <createData entity="ApiSimpleProduct" stepKey="createProduct23"/> |
| 45 | + <createData entity="ApiSimpleProduct" stepKey="createProduct24"/> |
| 46 | + <createData entity="ApiSimpleProduct" stepKey="createProduct25"/> |
| 47 | + <createData entity="ApiSimpleProduct" stepKey="createProduct26"/> |
| 48 | + <createData entity="ApiSimpleProduct" stepKey="createProduct27"/> |
| 49 | + <createData entity="ApiSimpleProduct" stepKey="createProduct28"/> |
| 50 | + <createData entity="ApiSimpleProduct" stepKey="createProduct29"/> |
| 51 | + <createData entity="ApiSimpleProduct" stepKey="createProduct30"/> |
| 52 | + <createData entity="ApiSimpleProduct" stepKey="createProduct31"/> |
| 53 | + <createData entity="ApiSimpleProduct" stepKey="createProduct32"/> |
| 54 | + <createData entity="ApiSimpleProduct" stepKey="createProduct33"/> |
| 55 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 56 | + </before> |
| 57 | + <after> |
| 58 | + <!-- deleting category, simple products, grouped product --> |
| 59 | + <deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> |
| 60 | + <deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> |
| 61 | + <deleteData createDataKey="createProduct3" stepKey="deleteProduct3"/> |
| 62 | + <deleteData createDataKey="createProduct4" stepKey="deleteProductT4"/> |
| 63 | + <deleteData createDataKey="createProduct5" stepKey="deleteProduct5"/> |
| 64 | + <deleteData createDataKey="createProduct6" stepKey="deleteProduct6"/> |
| 65 | + <deleteData createDataKey="createProduct7" stepKey="deleteProduct7"/> |
| 66 | + <deleteData createDataKey="createProduct8" stepKey="deleteProduct8"/> |
| 67 | + <deleteData createDataKey="createProduct9" stepKey="deleteProduct9"/> |
| 68 | + <deleteData createDataKey="createProduct10" stepKey="deleteProduct10"/> |
| 69 | + <deleteData createDataKey="createProduct11" stepKey="deleteProduct11"/> |
| 70 | + <deleteData createDataKey="createProduct12" stepKey="deleteProduct12"/> |
| 71 | + <deleteData createDataKey="createProduct13" stepKey="deleteProduct13"/> |
| 72 | + <deleteData createDataKey="createProduct14" stepKey="deleteProduct14"/> |
| 73 | + <deleteData createDataKey="createProduct15" stepKey="deleteProduct15"/> |
| 74 | + <deleteData createDataKey="createProduct16" stepKey="deleteProduct16"/> |
| 75 | + <deleteData createDataKey="createProduct17" stepKey="deleteProduct17"/> |
| 76 | + <deleteData createDataKey="createProduct18" stepKey="deleteProduct18"/> |
| 77 | + <deleteData createDataKey="createProduct19" stepKey="deleteProduct19"/> |
| 78 | + <deleteData createDataKey="createProduct20" stepKey="deleteProduct20"/> |
| 79 | + <deleteData createDataKey="createProduct21" stepKey="deleteProduct21"/> |
| 80 | + <deleteData createDataKey="createProduct22" stepKey="deleteProduct22"/> |
| 81 | + <deleteData createDataKey="createProduct23" stepKey="deleteProduct23"/> |
| 82 | + <deleteData createDataKey="createProduct24" stepKey="deleteProduct24"/> |
| 83 | + <deleteData createDataKey="createProduct25" stepKey="deleteProduct25"/> |
| 84 | + <deleteData createDataKey="createProduct26" stepKey="deleteProduct26"/> |
| 85 | + <deleteData createDataKey="createProduct27" stepKey="deleteProduct27"/> |
| 86 | + <deleteData createDataKey="createProduct28" stepKey="deleteProduct28"/> |
| 87 | + <deleteData createDataKey="createProduct29" stepKey="deleteProduct29"/> |
| 88 | + <deleteData createDataKey="createProduct30" stepKey="deleteProduct30"/> |
| 89 | + <deleteData createDataKey="createProduct31" stepKey="deleteProduct31"/> |
| 90 | + <deleteData createDataKey="createProduct32" stepKey="deleteProduct32"/> |
| 91 | + <deleteData createDataKey="createProduct33" stepKey="deleteProduct33"/> |
| 92 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 93 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 94 | + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteGroupProduct"> |
| 95 | + <argument name="product" value="GroupedProduct"/> |
| 96 | + </actionGroup> |
| 97 | + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="clearFilters"/> |
| 98 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> |
| 99 | + </after> |
| 100 | + <!-- Create Grouped product via Admin --> |
| 101 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 102 | + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> |
| 103 | + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateGroupedProduct"> |
| 104 | + <argument name="product" value="GroupedProduct"/> |
| 105 | + </actionGroup> |
| 106 | + <!-- Create a Grouped Product --> |
| 107 | + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{GroupedProduct.name}}" stepKey="fillProductName"/> |
| 108 | + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> |
| 109 | + <!-- Admin adding the Associated Simple Product For GroupedProduct --> |
| 110 | + <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> |
| 111 | + <click selector="body" stepKey="clickBodyToCorrectFocusGroupedInAddPage"/> |
| 112 | + <waitForElementClickable selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="waitForAddProductsToGroupClickable"/> |
| 113 | + <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroupInAddPage"/> |
| 114 | + <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModalInAddPage"/> |
| 115 | + <click selector="{{AdminProductFormGroupedProductsSection.optionProductCheckbox}}" stepKey="selectAllOptionsInPage1"/> |
| 116 | + <click selector="{{AdminProductFormGroupedProductsSection.productNextPageInAdd}}" stepKey="navigateToNextPage"/> |
| 117 | + <click selector="{{AdminProductFormGroupedProductsSection.optionProductCheckbox}}" stepKey="selectAllOptionsInPage2"/> |
| 118 | + <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> |
| 119 | + <!-- Saving the grouped product--> |
| 120 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveGroupedProduct"/> |
| 121 | + <!-- Asserting the success message --> |
| 122 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertProductSavedMessage"> |
| 123 | + <argument name="message" value="You saved the product."/> |
| 124 | + </actionGroup> |
| 125 | + <!-- Create another simple product --> |
| 126 | + <createData entity="SimpleProduct2" stepKey="createProduct"/> |
| 127 | + <!--Open created Product group and add another simple product to group product--> |
| 128 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndex"/> |
| 129 | + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> |
| 130 | + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchProductGridForm"> |
| 131 | + <argument name="keyword" value="GroupedProduct.name"/> |
| 132 | + </actionGroup> |
| 133 | + <click selector="{{AdminProductGridSection.selectRowBasedOnName(GroupedProduct.name)}}" stepKey="openGroupedProduct"/> |
| 134 | + <waitForPageLoad stepKey="waitForProductEditPageLoad"/> |
| 135 | + <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSectionToAddSimpleProduct"/> |
| 136 | + <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSectionToAddSimpleProduct"/> |
| 137 | + <click selector="body" stepKey="clickBodyToCorrectFocusGrouped"/> |
| 138 | + <waitForElementClickable selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="waitForAddProductsClickable"/> |
| 139 | + <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickOnAddProductsToGroup"/> |
| 140 | + <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModalToAddSimpleProduct"/> |
| 141 | + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterGroupedProducts"> |
| 142 | + <argument name="sku" value="SimpleProduct2"/> |
| 143 | + </actionGroup> |
| 144 | + <click selector="{{AdminProductFormGroupedProductsSection.optionProductCheckbox}}" stepKey="selectProductOption"/> |
| 145 | + <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="AddSelectedSimpleProduct"/> |
| 146 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductToAddSimpleProduct"/> |
| 147 | + <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSectionInEditPage"/> |
| 148 | + <click selector="{{AdminProductFormGroupedProductsSection.productNextPageInEdit}}" stepKey="clickOnNextPagination"/> |
| 149 | + <!-- Verify in the Grouped Product the newly added product is in the last position --> |
| 150 | + <actionGroup ref="AdminVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedSimpleProduct"> |
| 151 | + <argument name="name" value="$$createProduct.name$$"/> |
| 152 | + <argument name="attributeSet" value="$$createProduct.attributeSetText$$"/> |
| 153 | + <argument name="status" value="$$createProduct.statusText$$"/> |
| 154 | + <argument name="sku" value="$$createProduct.sku$$"/> |
| 155 | + <argument name="price" value="$$createProduct.price$$"/> |
| 156 | + <argument name="position" value="33"/> |
| 157 | + <argument name="index" value="14"/> |
| 158 | + </actionGroup> |
| 159 | + <!-- change the position of another Simple Product--> |
| 160 | + <actionGroup ref="AdminVerifyAssociatedProductChangePositionForGroupedProductActionGroup" stepKey="editAssociatedProductAdminPosition"> |
| 161 | + <argument name="name" value="$$createProduct33.name$$"/> |
| 162 | + <argument name="attributeSet" value="$$createProduct33.attributeSetText$$"/> |
| 163 | + <argument name="status" value="$$createProduct33.statusText$$"/> |
| 164 | + <argument name="sku" value="$$createProduct33.sku$$"/> |
| 165 | + <argument name="price" value="$$createProduct33.price$$"/> |
| 166 | + <argument name="position" value="31"/> |
| 167 | + <argument name="index" value="13"/> |
| 168 | + </actionGroup> |
| 169 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForPositionUpdate"/> |
| 170 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndexPageForGroupedProduct"/> |
| 171 | + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExistInIndexPage"/> |
| 172 | + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchProductGridFormInIndexPage"> |
| 173 | + <argument name="keyword" value="GroupedProduct.name"/> |
| 174 | + </actionGroup> |
| 175 | + <click selector="{{AdminProductGridSection.selectRowBasedOnName(GroupedProduct.name)}}" stepKey="openGroupedProductInEditMode"/> |
| 176 | + <waitForPageLoad stepKey="waitForProductEditPageToLoad"/> |
| 177 | + <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSectionInEdit"/> |
| 178 | + <click selector="{{AdminProductFormGroupedProductsSection.productNextPageInEdit}}" stepKey="clickOnNextPageButton"/> |
| 179 | + <!-- verify changing the position of another Simple Product does not affect the position of the newly added Simple Product--> |
| 180 | + <actionGroup ref="AdminVerifyAssociatedProductForGroupedProductActionGroup" stepKey="verifyAssociatedSimpleProductPositionAfterOtherProductPositionUpdate"> |
| 181 | + <argument name="name" value="$$createProduct.name$$"/> |
| 182 | + <argument name="attributeSet" value="$$createProduct.attributeSetText$$"/> |
| 183 | + <argument name="status" value="$$createProduct.statusText$$"/> |
| 184 | + <argument name="sku" value="$$createProduct.sku$$"/> |
| 185 | + <argument name="price" value="$$createProduct.price$$"/> |
| 186 | + <argument name="position" value="33"/> |
| 187 | + <argument name="index" value="14"/> |
| 188 | + </actionGroup> |
| 189 | + </test> |
| 190 | +</tests> |
0 commit comments