Skip to content

Commit 872ef01

Browse files
committed
Merge remote-tracking branch 'origin/AC-7554-2.4.6-d' into Hammer_Regression_issues_04Jan22
2 parents 88999b5 + 07b27f6 commit 872ef01

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMinicartSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@
4848
<element name="productCountLabel" type="text" selector="//*[@id='minicart-content-wrapper']/div[2]/div[1]/span[2]"/>
4949
<element name="productCartName" type="text" selector="//tbody[@class='cart item']//strong[@class='product-item-name']//a[contains(text(),'{{var}}')]" parameterized="true"/>
5050
<element name="minicartclose" type="button" selector="//button[@id='btn-minicart-close']"/>
51+
<element name="productCountNew" type="text" selector=".minicart-wrapper .action.showcart .counter-number"/>
5152
</section>
5253
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
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="StorefrontCartItemsCountDisplayItemsDecimalQuantitiesTest">
11+
<annotations>
12+
<stories value="Validate mini cart decimal quantities items in cart"/>
13+
<title value="Checking by adding decimal quantities in mini cart"/>
14+
<description value="Checking by adding decimal quantities in mini cart"/>
15+
<testCaseId value="AC-7554"/>
16+
<severity value="AVERAGE"/>
17+
<group value="checkout"/>
18+
</annotations>
19+
20+
<before>
21+
<!--Set Display Cart Summary to display items quantities-->
22+
<magentoCLI command="config:set {{DisplayItemsQuantities.path}} {{DisplayItemsQuantities.value}}" stepKey="setDisplayCartSummary"/>
23+
<!--Create simple product-->
24+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
25+
<createData entity="SimpleProduct" stepKey="createPreReqSimpleProduct">
26+
<requiredEntity createDataKey="createPreReqCategory"/>
27+
</createData>
28+
</before>
29+
<after>
30+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
31+
<deleteData createDataKey="createPreReqSimpleProduct" stepKey="deletePreReqSimpleProduct"/>
32+
<magentoCLI command="config:set {{DisplayItemsQuantities.path}} {{DisplayItemsQuantities.value}}" stepKey="resetDisplayCartSummary"/>
33+
</after>
34+
<!--Step1. Login as admin. Go to Catalog > Products page. Filtering *prod1*. Open *prod1* to edit-->
35+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin" />
36+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="filterGroupedProductOptions">
37+
<argument name="product" value="SimpleProduct"/>
38+
</actionGroup>
39+
<click selector="{{AdminProductGridSection.productGridNameProduct('$$createPreReqSimpleProduct.name$$')}}" stepKey="clickOpenProductForEdit"/>
40+
<waitForPageLoad time="30" stepKey="waitForProductEditOpen"/>
41+
<!--Step2. Open *Advanced Inventory* pop-up (Click on *Advanced Inventory* link). Set *Qty Uses Decimals* to *Yes*. Click on button *Done* -->
42+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/>
43+
<scrollTo selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" stepKey="scrollToQtyUsesDecimalsDropBox"/>
44+
<click selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" stepKey="clickOnQtyUsesDecimalsDropBox"/>
45+
<click selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimalsOptions('1')}}" stepKey="chooseYesOnQtyUsesDecimalsDropBox"/>
46+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.miniQtyConfigSetting}}" stepKey="uncheckMiniQtyCheckBox"/>
47+
<fillField selector="{{AdminProductFormAdvancedInventorySection.miniQtyAllowedInCart}}" userInput="0.5" stepKey="fillMinAllowedQty"/>
48+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/>
49+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/>
50+
<!-- Add simpleProduct to cart -->
51+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
52+
<argument name="productUrl" value="$createPreReqSimpleProduct.custom_attributes[url_key]$"/>
53+
</actionGroup>
54+
<actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToCart">
55+
<argument name="productName" value="$$createPreReqSimpleProduct.name$$"/>
56+
<argument name="productQty" value="0.5"/>
57+
</actionGroup>
58+
<!-- Open Mini Cart -->
59+
<actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCart"/>
60+
<!-- Assert Products Count in Mini Cart -->
61+
<see selector="{{StorefrontMinicartSection.productCountNew}}" userInput="0.5" stepKey="seeProductCountInCart"/>
62+
</test>
63+
</tests>

app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<!-- ko if: (getCartParam('summary_count') > 1) -->
3939
<span translate="'Items in Cart'"></span>
4040
<!--/ko-->
41-
<!-- ko if: (getCartParam('summary_count') === 1) -->
41+
<!-- ko if: (getCartParam('summary_count') <= 1) -->
4242
<span translate="'Item in Cart'"></span>
4343
<!--/ko-->
4444
</div>

0 commit comments

Comments
 (0)