Skip to content

Commit 72673e9

Browse files
committed
ACQE-8227: Product Attribute of multiselect type changes can be saved with mass update
- Added new test file and one element
1 parent 2a252ae commit 72673e9

File tree

3 files changed

+139
-0
lines changed

3 files changed

+139
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,5 +486,11 @@
486486
<data key="is_used_for_promo_rules">true</data>
487487
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
488488
</entity>
489+
<entity name="multiSelectAttributeWithThreeOptions" extends="productDropDownAttribute" type="ProductAttribute">
490+
<data key="frontend_input">multiselect</data>
491+
<data key="option1">1</data>
492+
<data key="option2">2</data>
493+
<data key="option3">3</data>
494+
</entity>
489495
</entities>
490496

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,6 @@
9292
<element name="customSelectAttribute" type="select" selector="//select[@name='product[{{attribute_code}}]']" parameterized="true"/>
9393
<element name="customSwitcherAttribute" type="checkbox" selector="//input[@name='product[{{attribute_code}}]' and @value='{{checked_value}}']/parent::div[@data-role='switcher']" parameterized="true"/>
9494
<element name="attributeOptionUncheckDefaultValue" type="checkbox" selector="input[name='use_default[{{attribute_code}}]']" parameterized="true"/>
95+
<element name="customAttributeUnderMassUpdate" type="select" selector="//select[@name='attributes[{{attribute_code}}][]']" parameterized="true"/>
9596
</section>
9697
</sections>
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* ADOBE CONFIDENTIAL
5+
*
6+
* Copyright 2025 Adobe
7+
* All Rights Reserved.
8+
*
9+
* NOTICE: All information contained herein is, and remains
10+
* the property of Adobe and its suppliers, if any. The intellectual
11+
* and technical concepts contained herein are proprietary to Adobe
12+
* and its suppliers and are protected by all applicable intellectual
13+
* property laws, including trade secret and copyright laws.
14+
* Dissemination of this information or reproduction of this material
15+
* is strictly forbidden unless prior written permission is obtained
16+
* from Adobe.
17+
*/
18+
-->
19+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
21+
<test name="AdminMassUpdateProductAttributeWithMultiSelectTest">
22+
<annotations>
23+
<features value="Catalog"/>
24+
<stories value="Mass Update Product Attribute multiselect"/>
25+
<title value="Product Attribute of multiselect type changes can be saved with mass update"/>
26+
<description value="Verify that a product attribute of multiselect type changes can be saved with mass update in the admin update attributes."/>
27+
<testCaseId value="AC-4829"/>
28+
<severity value="MAJOR"/>
29+
<group value="Catalog"/>
30+
</annotations>
31+
<before>
32+
<!-- Login as admin -->
33+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
34+
<!-- Pre-condition Step-1 Multiselect attribute is created with three options: 1, 2, 3 -->
35+
<createData entity="multiSelectAttributeWithThreeOptions" stepKey="createMultiSelectProductAttributeWith2Options"/>
36+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
37+
<actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid">
38+
<argument name="ProductAttribute" value="$$createMultiSelectProductAttributeWith2Options$$"/>
39+
</actionGroup>
40+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1">
41+
<argument name="adminName" value="{{multiSelectAttributeWithThreeOptions.option1}}"/>
42+
<argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option1}}"/>
43+
<argument name="row" value="{{multiSelectAttributeWithThreeOptions.option1}}"/>
44+
</actionGroup>
45+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2">
46+
<argument name="adminName" value="{{multiSelectAttributeWithThreeOptions.option2}}"/>
47+
<argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option2}}"/>
48+
<argument name="row" value="{{multiSelectAttributeWithThreeOptions.option2}}"/>
49+
</actionGroup>
50+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption3">
51+
<argument name="adminName" value="{{multiSelectAttributeWithThreeOptions.option3}}"/>
52+
<argument name="frontName" value="{{multiSelectAttributeWithThreeOptions.option3}}"/>
53+
<argument name="row" value="{{multiSelectAttributeWithThreeOptions.option3}}"/>
54+
</actionGroup>
55+
<actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveMultiSelectAttribute"/>
56+
<!-- Pre-condition Step-2 Multiselect Attribute added to default Attribute set -->
57+
<actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/>
58+
<actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/>
59+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup">
60+
<argument name="group" value="Product Details"/>
61+
<argument name="attribute" value="$$createMultiSelectProductAttributeWith2Options.attribute_code$$"/>
62+
</actionGroup>
63+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/>
64+
<!-- Pre-condition Step-3 Product is created based on default attribute set. Value of multiselect attribute set to 1 and 2 for this product -->
65+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
66+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
67+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct">
68+
<argument name="product" value="$$createSimpleProduct$$"/>
69+
</actionGroup>
70+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
71+
<argument name="product" value="$$createSimpleProduct$$"/>
72+
</actionGroup>
73+
<waitForElementVisible
74+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
75+
stepKey="waitForMultiSelectAttributeToSelect"/>
76+
<selectOption
77+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
78+
parameterArray="['1','2']" stepKey="selectFirstAndSecondOptions"/>
79+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
80+
</before>
81+
<after>
82+
<!-- Delete product -->
83+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
84+
<!-- Delete attribute -->
85+
<actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid">
86+
<argument name="ProductAttribute" value="$$createMultiSelectProductAttributeWith2Options$$"/>
87+
</actionGroup>
88+
<actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"/>
89+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
90+
</after>
91+
<!-- Step 2 & 3 - Navigate: Products > Catalog and Select Product checkbox in grid -->
92+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
93+
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetGrid"/>
94+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct">
95+
<argument name="product" value="$$createSimpleProduct$$"/>
96+
</actionGroup>
97+
<waitForElementClickable selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="waitForFirstCheckboxClickable" />
98+
<checkOption selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/>
99+
<!--Step 4 - Under ACTIONS select update attributes -->
100+
<actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickMassUpdateProductAttributes"/>
101+
<!--Step 5 - Check the "change"-checkbox and alter the values from 1 and 2 to 3 only -->
102+
<scrollTo selector="{{AdminEditProductAttributesSection.toggleAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" stepKey="scrollToAttributeTogglebtn" />
103+
<checkOption selector="{{AdminEditProductAttributesSection.toggleAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}" stepKey="toggleAttribute"/>
104+
<unselectOption
105+
selector="{{AdminProductFormSection.customAttributeUnderMassUpdate('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
106+
parameterArray="['1','2']" stepKey="uncheckFirstAndSecondOptions"/>
107+
<selectOption
108+
selector="{{AdminProductFormSection.customAttributeUnderMassUpdate('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
109+
parameterArray="['3']" stepKey="selectThridOption"/>
110+
<!--Step 6 - Click 'Save Attribute' button -->
111+
<actionGroup ref="AdminMassUpdateProductAttributeSaveActionGroup" stepKey="saveUpdatedProductAttribute"/>
112+
<!-- Start message queue for product attribute consumer -->
113+
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue">
114+
<argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/>
115+
<argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/>
116+
</actionGroup>
117+
<!--Step 7 - Open created product and verify only option 3 attribute is selected -->
118+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPageAgain">
119+
<argument name="productId" value="$createSimpleProduct.id$"/>
120+
</actionGroup>
121+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
122+
<dontSeeOptionIsSelected
123+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
124+
userInput="1" stepKey="assertOption1NotChecked"/>
125+
<dontSeeOptionIsSelected
126+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
127+
userInput="2" stepKey="assertOption2NotChecked"/>
128+
<seeOptionIsSelected
129+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
130+
userInput="3" stepKey="assertOption3NotChecked"/>
131+
</test>
132+
</tests>

0 commit comments

Comments
 (0)