Skip to content

Fixed issue 29920 - "Item in Cart" not pluralized correctly #29923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="CheckoutCartSummarySection">
<element name="itemsInCartLabel" type="text" selector="//*[@id='opc-sidebar']/div[1]/div/div[1]/strong/span[2]"/>
<element name="orderTotal" type="input" selector=".grand.totals .amount .price"/>
<element name="subTotal" type="input" selector="span[data-th='Subtotal']"/>
<element name="expandShoppingCartSummary" type="button" selector="//*[contains(@class, 'items-in-cart')][not(contains(@class, 'active'))]"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
<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"/>
<element name="productImage" type="text" selector="//ol[@id='mini-cart']//img[@class='product-image-photo']"/>
<element name="productSubTotal" type="text" selector="//div[@class='subtotal']//span/span[@class='price']"/>
<element name="productCountLabel" type="text" selector="//*[@id='minicart-content-wrapper']/div[2]/div[1]/span[2]"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<!-- Assert Product Count in Mini Cart -->
<actionGroup ref="StorefrontAssertMiniCartItemCountActionGroup" stepKey="assertProductCountAndTextInMiniCart">
<argument name="productCount" value="2"/>
<argument name="productCountText" value="2 Item in Cart"/>
<argument name="productCountText" value="2 Items in Cart"/>
</actionGroup>

<!--Assert Product Items in Mini cart-->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontCheckoutSummaryItemsInCartLabelPluralizedTest">
<annotations>
<features value="Checkout"/>
<stories value="Checkout page order summary section 'Item in Cart' is pluralized correctly or not"/>
<title value="'Item in Cart' is pluralized correctly"/>
<description value="When adding more then 1 item and check checkout page order summary section text 'Items in Cart' is pluralized correctly or not"/>
<severity value="AVERAGE"/>
<group value="Checkout"/>
</annotations>
<before>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="ApiSimpleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
<field key="price">100.00</field>
</createData>
</before>
<after>
<deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
</after>
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
</actionGroup>
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
<argument name="quantity" value="1"/>
</actionGroup>
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/>
<see selector="{{StorefrontMinicartSection.productCountLabel}}" userInput="Item in Cart" stepKey="seeProductCountLabel"/>
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/>
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
<see selector="{{CheckoutCartSummarySection.itemsInCartLabel}}" userInput="Item in Cart" stepKey="seeFirstProductInList"/>
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPageAgain">
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/>
</actionGroup>
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCartAgain">
<argument name="quantity" value="4"/>
</actionGroup>
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCartAgain"/>
<see selector="{{StorefrontMinicartSection.productCountLabel}}" userInput="Items in Cart" stepKey="seeProductCountLabelAgain"/>
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPageAgain"/>
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoadAgain"/>
<see selector="{{CheckoutCartSummarySection.itemsInCartLabel}}" userInput="Items in Cart" stepKey="seeFirstProductInListAgain"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
<span class="count" if="maxItemsToDisplay < getCartLineItemsCount()" text="maxItemsToDisplay"/>
<translate args="'of'" if="maxItemsToDisplay < getCartLineItemsCount()"/>
<span class="count" text="getCartParam('summary_count')"/>
<!-- ko if: (getCartLineItemsCount() === 1) -->
<span translate="'Item in Cart'"/>
<!--/ko-->
<!-- ko if: (getCartLineItemsCount() > 1) -->
<!-- ko if: (getCartParam('summary_count') > 1) -->
<span translate="'Items in Cart'"/>
<!--/ko-->
<!-- ko if: (getCartParam('summary_count') === 1) -->
<span translate="'Item in Cart'"/>
<!--/ko-->
</div>

<each args="getRegion('subtotalContainer')" render=""/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<translate args="maxCartItemsToDisplay" if="maxCartItemsToDisplay < getCartLineItemsCount()"/>
<translate args="'of'" if="maxCartItemsToDisplay < getCartLineItemsCount()"/>
<span data-bind="text: getCartSummaryItemsCount()"></span>
<translate args="'Item in Cart'" if="getCartLineItemsCount() === 1"/>
<translate args="'Items in Cart'" if="getCartLineItemsCount() > 1"/>
<translate args="'Item in Cart'" if="getCartSummaryItemsCount() === 1"/>
<translate args="'Items in Cart'" if="getCartSummaryItemsCount() > 1"/>
</strong>
</div>
<div class="content minicart-items" data-role="content">
Expand Down