Skip to content

Commit 162bfaa

Browse files
committed
ACP2E-3469: Validation Error Triggered for All Products in Group When One Has Invalid Quantity
1 parent 3f0118b commit 162bfaa

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

app/code/Magento/GroupedProduct/Test/Mftf/Test/AssertGroupedProductQtyOnProductPageTest.xml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="AssertGroupedProductQtyOnProductPageTest">
1111
<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"/>
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."/>
1515
<features value="GroupedProduct"/>
1616
<testCaseId value="AC-13508"/>
1717
<severity value="MINOR"/>
1818
</annotations>
1919
<before>
2020
<!--Create simple and grouped product-->
21-
<createData entity="ApiProductWithDescription" before="simple2" stepKey="simple1"/>
22-
<createData entity="ApiProductWithDescription" before="groupedProduct" stepKey="simple2"/>
21+
<createData entity="ApiProductWithDescription" stepKey="simple1"/>
22+
<createData entity="ApiProductWithDescription" stepKey="simple2"/>
23+
<createData entity="ApiProductWithDescription" stepKey="simple3"/>
2324
<createData entity="ApiGroupedProduct" stepKey="groupedProduct"/>
2425
<createData entity="OneSimpleProductLink" stepKey="addProductOne">
2526
<requiredEntity createDataKey="groupedProduct"/>
@@ -29,26 +30,30 @@
2930
<requiredEntity createDataKey="groupedProduct"/>
3031
<requiredEntity createDataKey="simple2"/>
3132
</updateData>
33+
<updateData entity="OneMoreSimpleProductLink" createDataKey="addProductOne" stepKey="addProductThree">
34+
<requiredEntity createDataKey="groupedProduct"/>
35+
<requiredEntity createDataKey="simple3"/>
36+
</updateData>
3237
</before>
3338
<after>
34-
<deleteData createDataKey="simple1" before="deleteSimple2" stepKey="deleteSimple1"/>
35-
<deleteData createDataKey="simple2" before="deleteGroupProduct" stepKey="deleteSimple2"/>
3639
<deleteData createDataKey="groupedProduct" stepKey="deleteGroupProduct"/>
40+
<deleteData createDataKey="simple1" stepKey="deleteSimple1"/>
41+
<deleteData createDataKey="simple2" stepKey="deleteSimple2"/>
42+
<deleteData createDataKey="simple3" stepKey="deleteSimple3"/>
3743
</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]$$"/>
44+
<!-- Add grouped product to the cart -->
45+
<actionGroup ref="StorefrontAddThreeGroupedProductToTheCartActionGroup" stepKey="addGropedProductsToTheCart">
46+
<argument name="urlKey" value="$$groupedProduct.custom_attributes[url_key]$$"/>
47+
<argument name="product1" value="$$simple1.name$$"/>
48+
<argument name="product2" value="$$simple2.name$$"/>
49+
<argument name="product3" value="$$simple3.name$$"/>
50+
<argument name="qty1" value="1"/>
51+
<argument name="qty2" value="1"/>
52+
<argument name="qty3" value="-1"/>
4353
</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"/>
5054
<!-- Asserting product options qty errors-->
5155
<waitForElementNotVisible selector="{{StorefrontProductInfoMainSection.groupedProductOptionQtyError($simple1.id$)}}" stepKey="firstProductQtyError"/>
52-
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.groupedProductOptionQtyError($simple2.id$)}}" stepKey="secondProductQtyError"/>
56+
<waitForElementNotVisible selector="{{StorefrontProductInfoMainSection.groupedProductOptionQtyError($simple2.id$)}}" stepKey="secondProductQtyError"/>
57+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.groupedProductOptionQtyError($simple3.id$)}}" stepKey="thirdProductQtyError"/>
5358
</test>
5459
</tests>

0 commit comments

Comments
 (0)