|
| 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 for a grouped product"/> |
| 13 | + <stories value="Storefront grouped product quantity validation when one child product has invalid quantity"/> |
| 14 | + <description value="On the storefront, validate that if a child product in a grouped product has an invalid quantity, the error is displayed only for that specific child product."/> |
| 15 | + <features value="GroupedProduct"/> |
| 16 | + <testCaseId value="AC-13508"/> |
| 17 | + <useCaseId value="ACP2E-3469"/> |
| 18 | + <severity value="MINOR"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <!--Create simple and grouped product--> |
| 22 | + <createData entity="ApiProductWithDescription" stepKey="simple1"/> |
| 23 | + <createData entity="ApiProductWithDescription" stepKey="simple2"/> |
| 24 | + <createData entity="ApiProductWithDescription" stepKey="simple3"/> |
| 25 | + <createData entity="ApiGroupedProduct" stepKey="groupedProduct"/> |
| 26 | + <createData entity="OneSimpleProductLink" stepKey="addProductOne"> |
| 27 | + <requiredEntity createDataKey="groupedProduct"/> |
| 28 | + <requiredEntity createDataKey="simple1"/> |
| 29 | + </createData> |
| 30 | + <updateData entity="OneMoreSimpleProductLink" createDataKey="addProductOne" stepKey="addProductTwo"> |
| 31 | + <requiredEntity createDataKey="groupedProduct"/> |
| 32 | + <requiredEntity createDataKey="simple2"/> |
| 33 | + </updateData> |
| 34 | + <updateData entity="OneMoreSimpleProductLink" createDataKey="addProductOne" stepKey="addProductThree"> |
| 35 | + <requiredEntity createDataKey="groupedProduct"/> |
| 36 | + <requiredEntity createDataKey="simple3"/> |
| 37 | + </updateData> |
| 38 | + </before> |
| 39 | + <after> |
| 40 | + <deleteData createDataKey="groupedProduct" stepKey="deleteGroupProduct"/> |
| 41 | + <deleteData createDataKey="simple1" stepKey="deleteSimple1"/> |
| 42 | + <deleteData createDataKey="simple2" stepKey="deleteSimple2"/> |
| 43 | + <deleteData createDataKey="simple3" stepKey="deleteSimple3"/> |
| 44 | + </after> |
| 45 | + <!-- Add grouped product to the cart --> |
| 46 | + <actionGroup ref="StorefrontAddThreeGroupedProductToTheCartActionGroup" stepKey="addGropedProductsToTheCart"> |
| 47 | + <argument name="urlKey" value="$$groupedProduct.custom_attributes[url_key]$$"/> |
| 48 | + <argument name="product1" value="$$simple1.name$$"/> |
| 49 | + <argument name="product2" value="$$simple2.name$$"/> |
| 50 | + <argument name="product3" value="$$simple3.name$$"/> |
| 51 | + <argument name="qty1" value="1"/> |
| 52 | + <argument name="qty2" value="1"/> |
| 53 | + <argument name="qty3" value="-1"/> |
| 54 | + </actionGroup> |
| 55 | + <!-- Asserting product options qty errors--> |
| 56 | + <waitForElementNotVisible selector="{{StorefrontProductInfoMainSection.groupedProductOptionQtyError($simple1.id$)}}" stepKey="firstProductQtyError"/> |
| 57 | + <waitForElementNotVisible selector="{{StorefrontProductInfoMainSection.groupedProductOptionQtyError($simple2.id$)}}" stepKey="secondProductQtyError"/> |
| 58 | + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.groupedProductOptionQtyError($simple3.id$)}}" stepKey="thirdProductQtyError"/> |
| 59 | + </test> |
| 60 | +</tests> |
0 commit comments