Skip to content

Commit 5fcfe89

Browse files
committed
Merge branch '2.4.6-develop' of github.com:magento-gl/magento2ce into AC-7422_v1
2 parents fcd1929 + 19844aa commit 5fcfe89

File tree

8 files changed

+86
-16
lines changed

8 files changed

+86
-16
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>

app/code/Magento/Elasticsearch8/Test/Mftf/Test/StorefrontQuickSearchUsingElasticSearch8ByProductSkuTest.xml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,22 @@
2121
<group value="pr_exclude"/>
2222
</annotations>
2323
<before>
24-
<magentoCLI command="config:set catalog/search/engine elasticsearch8" stepKey="setSearchEngine"/>
24+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="setSearchEngine"/>
2525
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2626
<actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/>
27-
28-
<createData entity="VirtualProduct" stepKey="createFirtsSimpleProduct"/>
27+
<createData entity="VirtualProduct" stepKey="createVirtualProduct"/>
28+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createFirtsSimpleProduct"/>
2929
<createData entity="SimpleProductWithCustomSku24MB06" stepKey="createSecondSimpleProduct"/>
3030
<createData entity="SimpleProductWithCustomSku24MB04" stepKey="createThirdSimpleProduct"/>
3131
<createData entity="SimpleProductWithCustomSku24MB02" stepKey="createFourthSimpleProduct"/>
3232
<createData entity="SimpleProductWithCustomSku24MB01" stepKey="createFifthSimpleProduct"/>
33-
3433
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
35-
<argument name="tags" value=""/>
34+
<argument name="tags" value="config full_page"/>
3635
</actionGroup>
3736
<magentoCron groups="index" stepKey="reindex"/>
3837
</before>
3938
<after>
40-
<deleteData createDataKey="createFirtsSimpleProduct" stepKey="deleteProductOne"/>
41-
39+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="deleteProductOne"/>
4240
<actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProductsAfterTest"/>
4341
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminPanel"/>
4442
</after>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"magento/zend-pdf": "^1.16",
8484
"monolog/monolog": "^2.7",
8585
"opensearch-project/opensearch-php": "^1.0 || ^2.0, <2.0.1",
86-
"pelago/emogrifier": "^7",
86+
"pelago/emogrifier": "^7.0",
8787
"php-amqplib/php-amqplib": "^3.2",
8888
"phpseclib/mcrypt_compat": "^2.0",
8989
"phpseclib/phpseclib": "^3.0",

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductPriceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ public function testConfigurableProductWithVariantsHavingSpecialAndTierPrices()
772772
"value" => round((float) $configurableProductVariants[$key]->getSpecialPrice(), 2)
773773
],
774774
"discount" => [
775-
"amount_off" => ($regularPrice[$key] - $finalPrice[$key]),
775+
"amount_off" => round($regularPrice[$key] - $finalPrice[$key], 2),
776776
"percent_off" => round(($regularPrice[$key] - $finalPrice[$key])*100/$regularPrice[$key], 2)
777777
]
778778
],
@@ -784,7 +784,7 @@ public function testConfigurableProductWithVariantsHavingSpecialAndTierPrices()
784784
"value" => round((float) $configurableProductVariants[$key]->getSpecialPrice(), 2)
785785
],
786786
"discount" => [
787-
"amount_off" => $regularPrice[$key] - $finalPrice[$key],
787+
"amount_off" => round($regularPrice[$key] - $finalPrice[$key], 2),
788788
"percent_off" => round(($regularPrice[$key] - $finalPrice[$key])*100/$regularPrice[$key], 2)
789789
]
790790
]

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CartPromotionsTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ class CartPromotionsTest extends GraphQlAbstract
2929
* @magentoApiDataFixture Magento/Catalog/_files/multiple_products.php
3030
* @magentoApiDataFixture Magento/SalesRule/_files/rules_category.php
3131
*/
32+
33+
/**
34+
* @var float
35+
*/
36+
private const EPSILON = 0.0000000001;
37+
3238
public function testCartPromotionSingleCartRule()
3339
{
3440
$skus =['simple1', 'simple2'];
@@ -151,16 +157,18 @@ public function testCartPromotionsMultipleCartRules()
151157
$lineItemDiscount = $productsInResponse[$itemIndex][0]['prices']['discounts'];
152158
$expectedTotalDiscountValue = ($productsInCart[$itemIndex]->getSpecialPrice()*$qty*0.5) +
153159
($productsInCart[$itemIndex]->getSpecialPrice()*$qty*0.5*0.1);
154-
$this->assertEquals(
160+
$this->assertEqualsWithDelta(
155161
$productsInCart[$itemIndex]->getSpecialPrice()*$qty*0.5,
156-
current($lineItemDiscount)['amount']['value']
162+
current($lineItemDiscount)['amount']['value'],
163+
self::EPSILON
157164
);
158165
$this->assertEquals('TestRule_Label', current($lineItemDiscount)['label']);
159166

160167
$lineItemDiscountValue = next($lineItemDiscount)['amount']['value'];
161-
$this->assertEquals(
168+
$this->assertEqualsWithDelta(
162169
round($productsInCart[$itemIndex]->getSpecialPrice()*$qty*0.5)*0.1,
163-
$lineItemDiscountValue
170+
$lineItemDiscountValue,
171+
self::EPSILON
164172
);
165173
$this->assertEquals('10% off with two items_Label', end($lineItemDiscount)['label']);
166174
$actualTotalDiscountValue = $lineItemDiscount[0]['amount']['value']+$lineItemDiscount[1]['amount']['value'];

0 commit comments

Comments
 (0)