|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 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="AdminMassUpdateProductAttributeWithMultiSelectTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Catalog"/> |
| 13 | + <stories value="Mass Update Product Attribute multiselect"/> |
| 14 | + <title value="Product Attribute of multiselect type changes can be saved with mass update"/> |
| 15 | + <description value="Verify that a product attribute of multiselect type changes can be saved with mass update in the admin update attributes."/> |
| 16 | + <testCaseId value="AC-4829"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <group value="Catalog"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> |
| 22 | + <!-- Pre-condition Step-1 Multiselect attribute is created with three options: 1, 2, 3 --> |
| 23 | + <createData entity="multiSelectAttributeWithThreeOptions" stepKey="createMultiSelectProductAttributeWithThreeOptions"/> |
| 24 | + <!-- Login as admin --> |
| 25 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 26 | + <actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/> |
| 27 | + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid"> |
| 28 | + <argument name="ProductAttribute" value="$$createMultiSelectProductAttributeWithThreeOptions$$"/> |
| 29 | + </actionGroup> |
| 30 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1"> |
| 31 | + <argument name="adminName" value="{{multiSelectAttributeWithThreeOptions.option1}}"/> |
| 32 | + <argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option1}}"/> |
| 33 | + <argument name="row" value="{{multiSelectAttributeWithThreeOptions.option1}}"/> |
| 34 | + </actionGroup> |
| 35 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2"> |
| 36 | + <argument name="adminName" value="{{multiSelectAttributeWithThreeOptions.option2}}"/> |
| 37 | + <argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option2}}"/> |
| 38 | + <argument name="row" value="{{multiSelectAttributeWithThreeOptions.option2}}"/> |
| 39 | + </actionGroup> |
| 40 | + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption3"> |
| 41 | + <argument name="adminName" value="{{multiSelectAttributeWithThreeOptions.option3}}"/> |
| 42 | + <argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option3}}"/> |
| 43 | + <argument name="row" value="{{multiSelectAttributeWithThreeOptions.option3}}"/> |
| 44 | + </actionGroup> |
| 45 | + <actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveMultiSelectAttribute"/> |
| 46 | + <!-- Pre-condition Step-2 Multiselect Attribute added to default Attribute set --> |
| 47 | + <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> |
| 48 | + <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> |
| 49 | + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> |
| 50 | + <argument name="group" value="Product Details"/> |
| 51 | + <argument name="attribute" value="$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$"/> |
| 52 | + </actionGroup> |
| 53 | + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> |
| 54 | + <!-- Pre-condition Step-3 Product is created based on default attribute set. Value of multiselect attribute set to 1 and 2 for this product --> |
| 55 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 56 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> |
| 57 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 58 | + </actionGroup> |
| 59 | + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct"> |
| 60 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 61 | + </actionGroup> |
| 62 | + <waitForElementVisible |
| 63 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$')}}" |
| 64 | + stepKey="waitForMultiSelectAttributeToSelect"/> |
| 65 | + <selectOption |
| 66 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$')}}" |
| 67 | + parameterArray="['1','2']" stepKey="selectFirstAndSecondOptions"/> |
| 68 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> |
| 69 | + </before> |
| 70 | + <after> |
| 71 | + <!-- Delete product --> |
| 72 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 73 | + <!-- Delete attribute --> |
| 74 | + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid"> |
| 75 | + <argument name="ProductAttribute" value="$$createMultiSelectProductAttributeWithThreeOptions$$"/> |
| 76 | + </actionGroup> |
| 77 | + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"/> |
| 78 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 79 | + </after> |
| 80 | + <!-- Step 2 & 3 - Navigate: Products > Catalog and Select Product checkbox in grid --> |
| 81 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 82 | + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetGrid"/> |
| 83 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> |
| 84 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 85 | + </actionGroup> |
| 86 | + <waitForElementClickable selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="waitForFirstCheckboxClickable" /> |
| 87 | + <checkOption selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> |
| 88 | + <!--Step 4 - Under ACTIONS select update attributes --> |
| 89 | + <actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickMassUpdateProductAttributes"/> |
| 90 | + <!--Step 5 - Check the "change"-checkbox and alter the values from 1 and 2 to 3 only --> |
| 91 | + <scrollTo selector="{{AdminEditProductAttributesSection.toggleAttribute('$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$')}}" stepKey="scrollToAttributeTogglebtn" /> |
| 92 | + <checkOption selector="{{AdminEditProductAttributesSection.toggleAttribute('$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$')}}" stepKey="toggleAttribute"/> |
| 93 | + <unselectOption |
| 94 | + selector="{{AdminProductFormSection.customAttributeUnderMassUpdate('$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$')}}" |
| 95 | + parameterArray="['1','2']" stepKey="uncheckFirstAndSecondOptions"/> |
| 96 | + <selectOption |
| 97 | + selector="{{AdminProductFormSection.customAttributeUnderMassUpdate('$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$')}}" |
| 98 | + parameterArray="['3']" stepKey="selectThridOption"/> |
| 99 | + <!--Step 6 - Click 'Save Attribute' button --> |
| 100 | + <actionGroup ref="AdminMassUpdateProductAttributeSaveActionGroup" stepKey="saveUpdatedProductAttribute"/> |
| 101 | + <!-- Start message queue for product attribute consumer --> |
| 102 | + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> |
| 103 | + <argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/> |
| 104 | + <argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/> |
| 105 | + </actionGroup> |
| 106 | + <!--Step 7 - Open created product and verify only option 3 attribute is selected --> |
| 107 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPageAgain"> |
| 108 | + <argument name="productId" value="$createSimpleProduct.id$"/> |
| 109 | + </actionGroup> |
| 110 | + <waitForPageLoad stepKey="waitForProductPageLoad"/> |
| 111 | + <dontSeeOptionIsSelected |
| 112 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$')}}" |
| 113 | + userInput="1" stepKey="assertOption1NotChecked"/> |
| 114 | + <dontSeeOptionIsSelected |
| 115 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$')}}" |
| 116 | + userInput="2" stepKey="assertOption2NotChecked"/> |
| 117 | + <seeOptionIsSelected |
| 118 | + selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWithThreeOptions.attribute_code$$')}}" |
| 119 | + userInput="3" stepKey="assertOption3IsChecked"/> |
| 120 | + </test> |
| 121 | +</tests> |
0 commit comments