Skip to content

Commit cf1b842

Browse files
committed
ACQE-8448: Verify sub total rounding for decimal quantity enabled product.
- Updated step keys and implemented customer login in test file.
1 parent 12f7cc5 commit cf1b842

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifySubTotalRoundingForDecimalQuantityEnabledTest.xml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
* All Rights Reserved.
66
*/
77
-->
8-
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
8+
<tests
9+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1011
<test name="AdminVerifySubTotalRoundingForDecimalQuantityEnabledTest">
1112
<annotations>
1213
<features value="Catalog"/>
@@ -18,10 +19,11 @@
1819
<group value="catalog"/>
1920
</annotations>
2021
<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>
22+
<!--Pre-condition 1: Create customer -->
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
25+
<argument name="Customer" value="$$createCustomer$$"/>
26+
</actionGroup>
2527
<!-- Admin login -->
2628
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2729
<!--Step1: Set notify for quantity below = 0.5 in config -->
@@ -30,13 +32,20 @@
3032
<argument name="quantityValue" value="0.5"/>
3133
</actionGroup>
3234
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/>
35+
<!-- Step 2: Create product with price 20.67 -->
36+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
37+
<field key="price">20.67</field>
38+
</createData>
3339
</before>
3440
<after>
35-
<!-- Delete product -->
41+
<!-- Logout from storefront -->
42+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutStorefront"/>
43+
<!-- Delete customer,product -->
44+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
3645
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
3746
<!-- Reset notify for quantity below -->
3847
<actionGroup ref="AdminNavigateToProductStockOptionsFeatureActionGroup" stepKey="navigateToProductStockOption"/>
39-
<actionGroup ref="AdminInProductStockOptionsFeatureResetNotifyForQuantityBelowActionGroup" stepKey="navigateToProductStockOptions"/>
48+
<actionGroup ref="AdminInProductStockOptionsFeatureResetNotifyForQuantityBelowActionGroup" stepKey="resetNotifyForQuantityBelow"/>
4049
<!-- Admin logout -->
4150
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAdmin"/>
4251
</after>
@@ -48,7 +57,7 @@
4857
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="1.5" stepKey="seeProductQuantity"/>
4958
<!--Step 2: Open advanced inventory Section -->
5059
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/>
51-
<!-- Step 2: Set decimal qantity to yes -->
60+
<!-- Step 2: Set decimal quantity to yes -->
5261
<actionGroup ref="AdminSetQtyUsesDecimalsConfigActionGroup" stepKey="setQtyUsesDecimalsConfig">
5362
<argument name="value" value="Yes"/>
5463
</actionGroup>
@@ -73,19 +82,25 @@
7382
<waitForPageLoad stepKey="waitForPriceLoad"/>
7483
<waitForText selector="{{StorefrontProductPageSection.subTotal}}" userInput="$10.34" stepKey="seeSubTotal"/>
7584
<waitForText selector="{{StorefrontProductPageSection.orderTotal}}" userInput="$12.84" stepKey="seeOrderTotal"/>
76-
<!-- Step 4: Proceed to checkout and place order -->
85+
<!-- Step 4: Proceed to checkout, place order and verify order placed successfully -->
7786
<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 -->
87+
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/>
88+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToPaymentPage"/>
89+
<waitForPageLoad stepKey="waitForPaymentPageToLoad"/>
90+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
91+
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder">
92+
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>
93+
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
94+
</actionGroup>
95+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
96+
<!-- Step 5: In admin check order details total in created order and verify no subtotal rounding issues for decimal enabled product -->
8297
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="addFilterToGridAndOpenOrder">
8398
<argument name="entityId" value="{$grabOrderNumber}"/>
8499
</actionGroup>
85-
<actionGroup ref="AdminAssertTotalsOnOrderViewPageActionGroup" stepKey="checkSubtotal1">
100+
<actionGroup ref="AdminAssertTotalsOnOrderViewPageActionGroup" stepKey="checkSubtotal">
86101
<argument name="subtotal" value="$10.34"/>
87102
<argument name="shippingAndHandling" value="$2.50"/>
88-
<argument name="grandTotal" value="12.84"/>
103+
<argument name="grandTotal" value="$12.84"/>
89104
</actionGroup>
90105
</test>
91106
</tests>

app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminInProductStockOptionsFeatureResetNotifyForQuantityBelowActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<arguments>
1616
<argument name="quantityValue" type="string" defaultValue="1"/>
1717
</arguments>
18-
<scrollTo selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" x="0" y="-80" stepKey="scrollToParticularElement"/>
18+
<scrollTo selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" x="0" y="-80" stepKey="scrollToNotifyQuantityField"/>
1919
<fillField selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" userInput="{{quantityValue}}" stepKey="resetNotifyForQtyBelow"/>
2020
<checkOption selector="{{AdminInventoryProductStockOptionsConfigSection.systemValue}}" stepKey="checkUseDefaultValue"/>
2121
</actionGroup>

app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminInProductStockOptionsFeatureSetNotifyForQuantityBelowActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<arguments>
1616
<argument name="quantityValue" type="string" defaultValue="1"/>
1717
</arguments>
18-
<scrollTo selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" x="0" y="-80" stepKey="scrollToElement"/>
18+
<scrollTo selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" x="0" y="-80" stepKey="scrollToNotifyQuantityFieldToSetValue"/>
1919
<uncheckOption selector="{{AdminInventoryProductStockOptionsConfigSection.systemValue}}" stepKey="uncheckUseDefaultValue"/>
2020
<fillField selector="{{AdminInventoryProductStockOptionsConfigSection.notifyQty}}" userInput="{{quantityValue}}" stepKey="setNotifyForQtyBelow"/>
2121
</actionGroup>

0 commit comments

Comments
 (0)