Skip to content

Commit 49573eb

Browse files
author
saphaljha
committed
Fixed count label issue in minicart and covered MFTF
1 parent b034b4b commit 49573eb

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
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
@@ -44,5 +44,6 @@
4444
<element name="productQuantity" type="input" selector="//*[@id='mini-cart']//a[contains(text(),'{{productName}}')]/../..//div[@class='details-qty qty']//input[@data-item-qty='{{qty}}']" parameterized="true"/>
4545
<element name="productImage" type="text" selector="//ol[@id='mini-cart']//img[@class='product-image-photo']"/>
4646
<element name="productSubTotal" type="text" selector="//div[@class='subtotal']//span/span[@class='price']"/>
47+
<element name="productCountLabel" type="text" selector="//*[@id='minicart-content-wrapper']/div[2]/div[1]/span[2]"/>
4748
</section>
4849
</sections>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest/StorefrontCheckoutSummaryItemsInCartLabelPluralizedTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
3333
<argument name="quantity" value="1"/>
3434
</actionGroup>
35+
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/>
36+
<see selector="{{StorefrontMinicartSection.productCountLabel}}" userInput="Item in Cart" stepKey="seeProductCountLabel"/>
3537
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/>
3638
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
3739
<see selector="{{CheckoutCartSummarySection.itemsInCartLabel}}" userInput="Item in Cart" stepKey="seeFirstProductInList"/>
@@ -41,6 +43,8 @@
4143
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCartAgain">
4244
<argument name="quantity" value="4"/>
4345
</actionGroup>
46+
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCartAgain"/>
47+
<see selector="{{StorefrontMinicartSection.productCountLabel}}" userInput="Items in Cart" stepKey="seeProductCountLabelAgain"/>
4448
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPageAgain"/>
4549
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoadAgain"/>
4650
<see selector="{{CheckoutCartSummarySection.itemsInCartLabel}}" userInput="Items in Cart" stepKey="seeFirstProductInListAgain"/>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
<span class="count" if="maxItemsToDisplay < getCartLineItemsCount()" text="maxItemsToDisplay"/>
3636
<translate args="'of'" if="maxItemsToDisplay < getCartLineItemsCount()"/>
3737
<span class="count" text="getCartParam('summary_count')"/>
38-
<!-- ko if: (getCartLineItemsCount() === 1) -->
39-
<span translate="'Item in Cart'"/>
40-
<!--/ko-->
41-
<!-- ko if: (getCartLineItemsCount() > 1) -->
38+
<!-- ko if: (getCartParam('summary_count') > 1) -->
4239
<span translate="'Items in Cart'"/>
4340
<!--/ko-->
41+
<!-- ko if: (getCartParam('summary_count') === 1) -->
42+
<span translate="'Item in Cart'"/>
43+
<!--/ko-->
4444
</div>
4545

4646
<each args="getRegion('subtotalContainer')" render=""/>

0 commit comments

Comments
 (0)