Skip to content

Commit 367548b

Browse files
committed
ACP2E-3469: Validation Error Triggered for All Products in Group When One Has Invalid Quantity
1 parent 227ac30 commit 367548b

File tree

3 files changed

+59
-122
lines changed

3 files changed

+59
-122
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright 2019 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -15,5 +15,6 @@
1515
<element name="groupedProductsAssociatedProductPrice" type="text" parameterized="true" selector="#super-product-table tbody tr:nth-of-type({{index}}) .price"/>
1616
<element name="groupedProductsAssociatedProductQuantity" type="input" parameterized="true" selector="#super-product-table tbody tr:nth-of-type({{index}}) input.qty"/>
1717
<element name="groupedProductOptions" type="input" selector="//td//strong[text()='{{productName}}']" parameterized="true"/>
18+
<element name="groupedProductOptionQtyError" type="text" selector="//*[@id='super_group[{{productId}}]-error']" parameterized="true"/>
1819
</section>
1920
</sections>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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>

dev/tests/js/jasmine/tests/lib/mage/validation/validation.test.js

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)