|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2024 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="AssertGroupedProductQtyOnProductPageTest"> |
| 11 | + <annotations> |
| 12 | + <title value="Validate quantity in Storefront with group product"/> |
| 13 | + <stories value="ACP2E-3469: Validation Error Triggered for All Products in Group When One Has Invalid Quantity"/> |
| 14 | + <description value="Products in group should not show error for all Products when one Has invalid quantity"/> |
| 15 | + <features value="GroupedProduct"/> |
| 16 | + <testCaseId value="AC-13508"/> |
| 17 | + <severity value="MINOR"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!--Create simple and grouped product--> |
| 21 | + <createData entity="ApiProductWithDescription" before="simple2" stepKey="simple1"/> |
| 22 | + <createData entity="ApiProductWithDescription" before="groupedProduct" stepKey="simple2"/> |
| 23 | + <createData entity="ApiGroupedProduct" stepKey="groupedProduct"/> |
| 24 | + <createData entity="OneSimpleProductLink" stepKey="addProductOne"> |
| 25 | + <requiredEntity createDataKey="groupedProduct"/> |
| 26 | + <requiredEntity createDataKey="simple1"/> |
| 27 | + </createData> |
| 28 | + <updateData entity="OneMoreSimpleProductLink" createDataKey="addProductOne" stepKey="addProductTwo"> |
| 29 | + <requiredEntity createDataKey="groupedProduct"/> |
| 30 | + <requiredEntity createDataKey="simple2"/> |
| 31 | + </updateData> |
| 32 | + </before> |
| 33 | + <after> |
| 34 | + <deleteData createDataKey="simple1" before="deleteSimple2" stepKey="deleteSimple1"/> |
| 35 | + <deleteData createDataKey="simple2" before="deleteGroupProduct" stepKey="deleteSimple2"/> |
| 36 | + <deleteData createDataKey="groupedProduct" stepKey="deleteGroupProduct"/> |
| 37 | + </after> |
| 38 | + <!-- Go to storefront home page --> |
| 39 | + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> |
| 40 | + <!-- Check Grouped product is visible on the storefront--> |
| 41 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> |
| 42 | + <argument name="productUrl" value="$$groupedProduct.custom_attributes[url_key]$$"/> |
| 43 | + </actionGroup> |
| 44 | + <!-- Fill qty for product options--> |
| 45 | + <fillField selector="{{StorefrontProductPageSection.qtyInputWithProduct($simple1.name$)}}" userInput="1" before="addToCart" stepKey="fillQuantityForFirsProduct"/> |
| 46 | + <fillField selector="{{StorefrontProductPageSection.qtyInputWithProduct($simple2.name$)}}" userInput="-1" after="fillQuantityForFirsProduct" stepKey="fillQuantityForSecondProduct"/> |
| 47 | + <!--Add grouped product to cart --> |
| 48 | + <waitForElementClickable selector="{{StorefrontProductPageSection.addToCart}}" stepKey="waitForAddToCart"/> |
| 49 | + <click selector="{{StorefrontProductPageSection.addToCart}}" stepKey="addToCart"/> |
| 50 | + <!-- Asserting product options qty errors--> |
| 51 | + <waitForElementNotVisible selector="{{StorefrontProductInfoMainSection.groupedProductOptionQtyError($simple1.id$)}}" stepKey="firstProductQtyError"/> |
| 52 | + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.groupedProductOptionQtyError($simple2.id$)}}" stepKey="secondProductQtyError"/> |
| 53 | + </test> |
| 54 | +</tests> |
0 commit comments