Skip to content

Commit 2b176ac

Browse files
Merge branch 'ACQE-8227' into ACQE-functional-deployment-v7-1
2 parents ba44d1e + f733ebb commit 2b176ac

File tree

3 files changed

+128
-0
lines changed

3 files changed

+128
-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: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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

Comments
 (0)