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