Skip to content

Commit 1670d3a

Browse files
committed
Merge branch '2.4-develop' of https://github.com/mage-os/mirror-magento2 into 2.4-develop
2 parents 5293fb8 + 76e2a92 commit 1670d3a

8 files changed

+570
-0
lines changed

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@
5252
<element name="radioButtonQuantityValidation" type="input" selector="//label//span[contains(text(), '{{productName}}')]/../..//div[@class='control']//div[@class='field qty qty-holder']//input/following-sibling::div[@class='mage-error']" parameterized="true"/>
5353
<element name="dropDrownOptionQuantity" type="input" selector="//span[contains(text(), '{{productName}}')]/../..//input/following-sibling::div//div//div//input" parameterized="true"/>
5454
<element name="selectOptionError" type="text" selector="//div[contains(@class, 'field')]//div[contains(@class, 'mage-error')]"/>
55+
<element name="radioButton" type="select" selector="//label//span[contains(text(), '{{productName}}')]/ancestor::div//div[@class='control']//div[@class='field choice'][{{productNumber}}]/input" parameterized="true"/>
56+
<element name="radioOptionQty" type="input" selector="//div[@class='control']//div[@class='field qty qty-holder']//input"/>
5557
</section>
5658
</sections>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="StorefrontEditBundleProductUserDefinedQtyFromCartTest">
10+
<annotations>
11+
<features value="Bundle Product"/>
12+
<stories value="Editing bundle product from cart with user-defined quantities"/>
13+
<title value="Edit bundle product from cart with user-defined quantities"/>
14+
<description value="Test verifies that user-defined are retained when editing a bundle product from the shopping cart"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="AC-4271"/>
17+
<group value="catalog"/>
18+
</annotations>
19+
<before>
20+
<!-- Precondition1: Create two simple product with category -->
21+
<createData entity="SimpleSubCategory" stepKey="createSubCategory"/>
22+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct1"/>
23+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct2"/>
24+
<!-- Precondition2: Create bundle product with radio option -->
25+
<createData entity="ApiBundleProduct" stepKey="createBundleProduct">
26+
<requiredEntity createDataKey="createSubCategory"/>
27+
</createData>
28+
<createData entity="RadioButtonsOption" stepKey="bundleOption">
29+
<requiredEntity createDataKey="createBundleProduct"/>
30+
<field key="required">true</field>
31+
</createData>
32+
<createData entity="ApiBundleLink" stepKey="LinkOptionToFirstProduct">
33+
<requiredEntity createDataKey="createBundleProduct"/>
34+
<requiredEntity createDataKey="bundleOption"/>
35+
<requiredEntity createDataKey="createSimpleProduct1"/>
36+
<field key="qty">3</field>
37+
</createData>
38+
<createData entity="ApiBundleLink" stepKey="LinkOptionToSecondProduct">
39+
<requiredEntity createDataKey="createBundleProduct"/>
40+
<requiredEntity createDataKey="bundleOption"/>
41+
<requiredEntity createDataKey="createSimpleProduct2"/>
42+
<field key="qty">3</field>
43+
</createData>
44+
<!-- Login as admin -->
45+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
46+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openBundleEditPage">
47+
<argument name="productId" value="$$createBundleProduct.id$$"/>
48+
</actionGroup>
49+
<checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '0')}}" stepKey="userDefinedQuantityOption0Product0"/>
50+
<checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '1')}}" stepKey="userDefinedQuantityOption0Product1"/>
51+
<!-- Save product -->
52+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
53+
</before>
54+
<after>
55+
<deleteData createDataKey="createSimpleProduct1" stepKey="deleteSimpleProduct1"/>
56+
<deleteData createDataKey="createSimpleProduct2" stepKey="deleteSimpleProduct2"/>
57+
<deleteData createDataKey="createSubCategory" stepKey="deleteSubCategory"/>
58+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
59+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
60+
</after>
61+
<!-- Step1: Open Bundled product on storefront -->
62+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="navigateToBundleProductDetailsPage">
63+
<argument name="product" value="$createBundleProduct$"/>
64+
</actionGroup>
65+
<!-- Step2: Click on Customize and Add to cart-->
66+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickButtonToCustomize"/>
67+
<checkOption selector="{{StorefrontBundledSection.radioButton('$$createSimpleProduct1.name$$', '1')}}" stepKey="selectOption1"/>
68+
<waitForElementVisible selector="{{StorefrontBundledSection.radioOptionQty}}" stepKey="waitForUpdateQty"/>
69+
<!-- Step3: Update qty and add product to cart -->
70+
<fillField selector="{{StorefrontBundledSection.radioOptionQty}}" userInput="10" stepKey="updateQty"/>
71+
<actionGroup ref="StorefrontAddToTheCartButtonActionGroup" stepKey="addToTheCartBundleProduct"/>
72+
<!-- Step4: Open Mini Cart and click on edit item icon and verify qty -->
73+
<actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCart"/>
74+
<click selector="{{StorefrontMinicartSection.editMiniCartItem}}" stepKey="clickEditCartItem"/>
75+
<waitForPageLoad stepKey="waitForPageToLoad"/>
76+
<seeInField selector="{{StorefrontBundledSection.radioOptionQty}}" userInput="010" stepKey="VerifyQty"/>
77+
</test>
78+
</tests>
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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="AdminProductMultiselectAttributeUncheckAllOptionsTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Save Product Multiselect attribute without selecting any options"/>
14+
<title value="Product Attribute of multiselect type can be saved with all options unchecked"/>
15+
<description
16+
value="Verify that a product attribute of multiselect type can be saved with all options unchecked in the admin product edit page."/>
17+
<testCaseId value="AC-4856"/>
18+
<severity value="MAJOR"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<!-- Login as admin -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<!-- Pre-condition Step-1 Multiselect attribute is created with three options: 1, 2, 3 -->
25+
<createData entity="multiSelectAttributeWithThreeOptions" stepKey="createMultiSelectProductAttributeWith2Options"/>
26+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
27+
<actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid">
28+
<argument name="ProductAttribute" value="$$createMultiSelectProductAttributeWith2Options$$"/>
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+
<waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/>
46+
<actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveMultiSelectAttribute"/>
47+
<!-- Pre-condition Step-2 Multiselect Attribute added to default Attribute set -->
48+
<actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/>
49+
<actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/>
50+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup">
51+
<argument name="group" value="Product Details"/>
52+
<argument name="attribute" value="$$createMultiSelectProductAttributeWith2Options.attribute_code$$"/>
53+
</actionGroup>
54+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/>
55+
<!-- Pre-condition Step-3 Product is created based on default attribute set. Value of multiselect attribute set to 1 and 2 for this product -->
56+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
57+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
58+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct">
59+
<argument name="product" value="$$createSimpleProduct$$"/>
60+
</actionGroup>
61+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
62+
<argument name="product" value="$$createSimpleProduct$$"/>
63+
</actionGroup>
64+
<waitForElementVisible
65+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
66+
stepKey="waitForMultiSelectAttributeToSelect"/>
67+
<selectOption
68+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
69+
parameterArray="['1','2']" stepKey="selectFirstAndSecondOptions"/>
70+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
71+
</before>
72+
<after>
73+
<!-- Delete product -->
74+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
75+
<!-- Delete attribute -->
76+
<actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid">
77+
<argument name="ProductAttribute" value="$$createMultiSelectProductAttributeWith2Options$$"/>
78+
</actionGroup>
79+
<actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"/>
80+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
81+
</after>
82+
<!-- Step 2 & 3 - Navigate: Products > Catalog and Open created product -->
83+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
84+
<argument name="productId" value="$createSimpleProduct.id$"/>
85+
</actionGroup>
86+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
87+
<!-- Step 4 - Uncheck all options of multiselect attribute -->
88+
<waitForElement
89+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
90+
stepKey="waitForMultiSelectAttributeToUnSelect"/>
91+
<unselectOption
92+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
93+
parameterArray="['1','2']" stepKey="uncheckAllOptions"/>
94+
<!-- Step 5 - Save product -->
95+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterUncheck"/>
96+
<!-- Assert multiselect attribute has all options unchecked -->
97+
<dontSeeOptionIsSelected
98+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
99+
userInput="1" stepKey="assertOption1NotChecked"/>
100+
<dontSeeOptionIsSelected
101+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
102+
userInput="2" stepKey="assertOption2NotChecked"/>
103+
<dontSeeOptionIsSelected
104+
selector="{{AdminProductFormSection.customSelectAttribute('$$createMultiSelectProductAttributeWith2Options.attribute_code$$')}}"
105+
userInput="3" stepKey="assertOption3NotChecked"/>
106+
</test>
107+
</tests>
108+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminSelectAllValueOfTwoAttributesPageActionGroup">
11+
<annotations>
12+
<description>Select values of each attribute to include in the product.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="attributeLabel1" type="string" defaultValue="{{colorProductAttribute.default_label}}"/>
16+
<argument name="attributeLabel2" type="string" defaultValue="{{sizeAttribute.default_label}}"/>
17+
<argument name="quantity" type="string" defaultValue="100"/>
18+
</arguments>
19+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNext" />
20+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToSelectOptions"/>
21+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attributeLabel1)}}" stepKey="waitForSelectAllColor" />
22+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attributeLabel1)}}" stepKey="selectAllSwatchAttributeOptions"/>
23+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attributeLabel2)}}" stepKey="waitForSelectAllSize" />
24+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attributeLabel2)}}" stepKey="selectAllSwatchAttributeOptions1"/>
25+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextAgain" />
26+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToApplyQuantity"/>
27+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="waitForQtyField" />
28+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
29+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/>
30+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextAgain2" />
31+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/>
32+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextAgain3" />
33+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/>
34+
</actionGroup>
35+
</actionGroups>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="FillProductAttributeFieldsActionGroup">
11+
<annotations>
12+
<description>Fill custom attribute form fields.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="attributeLabel" type="string" defaultValue="Test Attribute"/>
16+
<argument name="attributeCode" type="string" defaultValue="test_attribute"/>
17+
<argument name="inputType" type="string" defaultValue="Dropdown"/>
18+
<argument name="scope" type="string" defaultValue="Store View"/>
19+
</arguments>
20+
<waitForElementVisible selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}" stepKey="waitForAddNewButton"/>
21+
<click selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}" stepKey="clickAddNewAttributeButton"/>
22+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeLabel}}" stepKey="fillAttributeLabel"/>
23+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{inputType}}" stepKey="selectDropdown"/>
24+
<scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/>
25+
<conditionalClick selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" dependentSelector="{{AdvancedAttributePropertiesSection.AttributeCode}}" visible="false" stepKey="openSection"/>
26+
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutSection"/>
27+
<fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCode"/>
28+
<selectOption selector="{{AdvancedAttributePropertiesSection.Scope}}" userInput="{{scope}}" stepKey="selectScope"/>
29+
</actionGroup>
30+
</actionGroups>

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ProductConfigurableAttributeData.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,18 @@
8080
<data key="input_type">Dropdown</data>
8181
<data key="attribute_code" unique="suffix">size</data>
8282
</entity>
83+
<entity name="colorProductAttributeWithOptions" extends="colorProductAttribute" type="ProductAttribute">
84+
<data key="input_type">Text Swatch</data>
85+
<data key="scope">Global</data>
86+
<data key="option1">Black</data>
87+
<data key="option2">Blue</data>
88+
<data key="option3">White</data>
89+
</entity>
90+
<entity name="sizeProductAttributeWithOptions" extends="sizeAttribute" type="ProductAttribute">
91+
<data key="input_type">Text Swatch</data>
92+
<data key="scope">Global</data>
93+
<data key="option1">Small</data>
94+
<data key="option2">Medium</data>
95+
<data key="option3">Large</data>
96+
</entity>
8397
</entities>

0 commit comments

Comments
 (0)