Skip to content

Commit 17b053b

Browse files
Merge branch 'ACQE-8323' into ACQE-functional-deployment-v1-1
2 parents fab20b0 + 5d1da84 commit 17b053b

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-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>

0 commit comments

Comments
 (0)