Skip to content

Commit 7820cd5

Browse files
committed
ACQE-8448: Verify sub total rounding for decimal quantity enabled product.
- New test case added.
1 parent 247ea35 commit 7820cd5

4 files changed

+152
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminVerifySubTotalRoundingForDecimalQuantityEnabledTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Decimal quantity product subtotal and order total validation"/>
14+
<title value="Verify subtotal and order total for decimal enabled product"/>
15+
<description value="Checks that subtotal and order total are correct for a product with decimal quantity and no rounding issues."/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="AC-10575"/>
18+
<group value="catalog"/>
19+
</annotations>
20+
<before>
21+
<!-- Step 2: Create product with price 20.67 -->
22+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
23+
<field key="price">20.67</field>
24+
</createData>
25+
<!-- Admin login -->
26+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
27+
<!--Step1: Set notify for quantity below = 0.5 in config -->
28+
<actionGroup ref="AdminNavigateToProductStockOptionsFeatureActionGroup" stepKey="navigateToProductStockOptions"/>
29+
<actionGroup ref="AdminInProductStockOptionsFeatureSetNotifyForQuantityBelowActionGroup" stepKey="setNotifyQtyBelow">
30+
<argument name="quantityValue" value="0.5"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>
33+
</before>
34+
<after>
35+
<!-- Delete product -->
36+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
37+
<!-- Reset notify for quantity below -->
38+
<actionGroup ref="AdminNavigateToProductStockOptionsFeatureActionGroup" stepKey="navigateToProductStockOption"/>
39+
<actionGroup ref="AdminInProductStockOptionsFeatureResetNotifyForQuantityBelowActionGroup" stepKey="navigateToProductStockOptions"/>
40+
<!-- Admin logout -->
41+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/>
42+
</after>
43+
<!-- Open Product page by id -->
44+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
45+
<argument name="productId" value="$$createSimpleProduct.id$$"/>
46+
</actionGroup>
47+
<!-- Step 2: Add quantity of product with 1.5 -->
48+
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="1.5" stepKey="seeProductQuantity"/>
49+
<!--Step 2: Open advanced inventory Section -->
50+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/>
51+
<!-- Step 2: Set decimal qantity to yes -->
52+
<actionGroup ref="AdminSetQtyUsesDecimalsConfigActionGroup" stepKey="setQtyUsesDecimalsConfig">
53+
<argument name="value" value="Yes"/>
54+
</actionGroup>
55+
<!-- Step 2: Set minimum allowed quantity as 0.5 -->
56+
<actionGroup ref="AdminSetMinAllowedQtyForProductActionGroup" stepKey="fillMiniAllowedQty">
57+
<argument name="qty" value="0.5"/>
58+
</actionGroup>
59+
<!-- Step 2: Click on done button -->
60+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/>
61+
<!-- Step 2: Click on save button -->
62+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/>
63+
<!-- Step 3: Navigate to product page on storefront -->
64+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
65+
<argument name="productUrl" value="$$createSimpleProduct.custom_attributes[url_key]$$"/>
66+
</actionGroup>
67+
<!-- Step 3: Add product to cart -->
68+
<actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToCart">
69+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
70+
</actionGroup>
71+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="amOnPageShoppingCart"/>
72+
<!-- Step 3: Assert subtotal and grand total -->
73+
<waitForPageLoad stepKey="waitForPriceLoad"/>
74+
<waitForText selector="{{StorefrontProductPageSection.subTotal}}" userInput="$10.34" stepKey="seeSubTotal"/>
75+
<waitForText selector="{{StorefrontProductPageSection.orderTotal}}" userInput="$12.84" stepKey="seeOrderTotal"/>
76+
<!-- Step 4: Proceed to checkout and place order -->
77+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/>
78+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"/>
79+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
80+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
81+
<!-- Step 5,6: In admin check order details total in created order and no verify subtotal rounding issues for decimal enabled product -->
82+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="addFilterToGridAndOpenOrder">
83+
<argument name="entityId" value="{$grabOrderNumber}"/>
84+
</actionGroup>
85+
<actionGroup ref="AdminAssertTotalsOnOrderViewPageActionGroup" stepKey="checkSubtotal1">
86+
<argument name="subtotal" value="$10.34"/>
87+
<argument name="shippingAndHandling" value="$2.50"/>
88+
<argument name="grandTotal" value="12.84"/>
89+
</actionGroup>
90+
</test>
91+
</tests>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminInProductStockOptionsFeatureResetNotifyForQuantityBelowActionGroup">
12+
<annotations>
13+
<description>In product stock options feature reset notify for quantity below</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="quantityValue" type="string" defaultValue="1"/>
17+
</arguments>
18+
<scrollTo selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" x="0" y="-80" stepKey="scrollToParticularElement"/>
19+
<fillField selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" userInput="{{quantityValue}}" stepKey="resetNotifyForQtyBelow"/>
20+
<checkOption selector="{{AdminInventoryProductStockOptionsConfigSection.systemValue}}" stepKey="checkUseDefaultValue"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminInProductStockOptionsFeatureSetNotifyForQuantityBelowActionGroup">
12+
<annotations>
13+
<description>In product stock options feature set notify for quantity below</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="quantityValue" type="string" defaultValue="1"/>
17+
</arguments>
18+
<scrollTo selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" x="0" y="-80" stepKey="scrollToElement"/>
19+
<uncheckOption selector="{{AdminInventoryProductStockOptionsConfigSection.systemValue}}" stepKey="uncheckUseDefaultValue"/>
20+
<fillField selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" userInput="{{quantityValue}}" stepKey="setNotifyForQtyBelow"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToProductStockOptionsFeatureActionGroup">
12+
<annotations>
13+
<description>In admin navigate to product stock options feature</description>
14+
</annotations>
15+
<amOnPage url="{{AdminInventoryProductStockOptionsConfigPage.url}}" stepKey="openProductStockOptions"/>
16+
</actionGroup>
17+
</actionGroups>

0 commit comments

Comments
 (0)