Skip to content

Commit 97e3946

Browse files
[Magento Community Engineering] Community Contributions - 2.4-develop
- merged latest code from mainline branch
2 parents ecfcbdf + 42311fa commit 97e3946

File tree

109 files changed

+3531
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+3531
-95
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminBundleProductSetAdvancedPricingActionGroup" extends="ProductSetAdvancedPricingActionGroup">
12+
<annotations>
13+
<description>Sets the provided Advanced Pricing on the Admin Bundle Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="priceView" type="string" defaultValue="Price Range"/>
17+
</arguments>
18+
<remove keyForRemoval="selectProductCustomGroupValue"/>
19+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.bundleAdvancedPriceView}}" userInput="{{priceView}}" stepKey="selectPriceView" before="clickDoneButton"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductFormAdvancedPricingSection">
12+
<element name="bundleAdvancedPriceView" type="select" selector="div[data-index='advanced-pricing'] select[name='product[price_view]']"/>
13+
</section>
14+
</sections>

app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<element name="bundleOptionXInputType" type="select" selector="[name='bundle_options[bundle_options][{{x}}][type]']" parameterized="true"/>
2121
<element name="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/>
2222
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
23+
<element name="bundleOptionXProductYPrice" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_price_value]']" parameterized="true"/>
2324
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
2425
<element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/>
2526
<element name="bundlePriceType" type="select" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]"/>

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<element name="priceTo" type="text" selector=".product-info-price .price-to"/>
1414
<element name="minPrice" type="text" selector="span[data-price-type='minPrice']"/>
1515
<element name="maxPrice" type="text" selector="span[data-price-type='minPrice']"/>
16+
<element name="asLowAsFinalPrice" type="text" selector="div.price-box.price-final_price p.minimal-price > span.price-final_price span.price"/>
17+
<element name="fixedFinalPrice" type="text" selector="div.price-box.price-final_price > span.price-final_price span.price"/>
1618
<element name="productBundleOptionsCheckbox" type="checkbox" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{childName}}')]/../input" parameterized="true" timeout="30"/>
1719
</section>
1820
</sections>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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="BundleProductWithDynamicTierPriceInCartTest" extends="BundleProductWithTierPriceWithFixedAndPercentOptionsInCartTest">
11+
<annotations>
12+
<stories value="Add bundle product to cart on storefront"/>
13+
<title value="Customer should get the right subtotal in cart when the bundle product with dynamic tier price added to the cart"/>
14+
<description value="Customer should be able to add bundle product with dynamic tier price to the cart and get the right price"/>
15+
<severity value="CRITICAL"/>
16+
</annotations>
17+
18+
<before>
19+
<createData entity="VirtualProduct" stepKey="createProductForBundleItem1">
20+
<field key="price">50.00</field>
21+
</createData>
22+
<createData entity="SimpleProduct2" stepKey="createProductForBundleItem2">
23+
<field key="price">100.00</field>
24+
</createData>
25+
</before>
26+
27+
<remove keyForRemoval="clickDynamicPriceSwitcher"/>
28+
<remove keyForRemoval="fillBundlePrice"/>
29+
<remove keyForRemoval="disableDynamicSku"/>
30+
<remove keyForRemoval="fillBundleOption1Price"/>
31+
<remove keyForRemoval="selectPercentPrice"/>
32+
<remove keyForRemoval="fillBundleOption2Price"/>
33+
<assertEquals message="ExpectedPrice" stepKey="assertBundleProductPrice">
34+
<actualResult type="variable">grabProductPrice</actualResult>
35+
<expectedResult type="string">$75.00</expectedResult>
36+
</assertEquals>
37+
<actionGroup ref="AssertSubTotalOnStorefrontMiniCartActionGroup" stepKey="assertSubTotalOnStorefrontMiniCart">
38+
<argument name="subTotal" value="$75.00"/>
39+
</actionGroup>
40+
</test>
41+
</tests>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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="BundleProductWithOptionTierPriceInCartTest" extends="BundleProductWithTierPriceWithFixedAndPercentOptionsInCartTest">
11+
<annotations>
12+
<stories value="Add bundle product to cart on storefront"/>
13+
<title value="Customer should get the right subtotal in cart when the bundle product with tier price for sub-item added to the cart"/>
14+
<description value="Customer should be able to add bundle product with tier price for sub-item price to the cart and get the right price"/>
15+
<severity value="CRITICAL"/>
16+
</annotations>
17+
18+
<before>
19+
<createData entity="VirtualProduct" stepKey="createProductForBundleItem1">
20+
<field key="price">50.00</field>
21+
</createData>
22+
<createData entity="SimpleProduct2" stepKey="createProductForBundleItem2">
23+
<field key="price">100.00</field>
24+
</createData>
25+
<createData entity="TierProductPrice50PercentDiscount" stepKey="addTierPrice">
26+
<requiredEntity createDataKey="createProductForBundleItem2"/>
27+
</createData>
28+
</before>
29+
30+
<remove keyForRemoval="clickDynamicPriceSwitcher"/>
31+
<remove keyForRemoval="fillBundlePrice"/>
32+
<remove keyForRemoval="disableDynamicSku"/>
33+
<remove keyForRemoval="fillBundleOption1Price"/>
34+
<remove keyForRemoval="selectPercentPrice"/>
35+
<remove keyForRemoval="fillBundleOption2Price"/>
36+
<remove keyForRemoval="addProductTierPrice"/>
37+
<actionGroup ref="SaveProductFormActionGroup" after="addBundleOption2" stepKey="saveBundleProduct"/>
38+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.fixedFinalPrice}}" stepKey="grabProductPrice"/>
39+
<assertEquals message="ExpectedPrice" stepKey="assertBundleProductPrice">
40+
<actualResult type="variable">grabProductPrice</actualResult>
41+
<expectedResult type="string">$100.00</expectedResult>
42+
</assertEquals>
43+
<actionGroup ref="AssertSubTotalOnStorefrontMiniCartActionGroup" stepKey="assertSubTotalOnStorefrontMiniCart">
44+
<argument name="subTotal" value="$100.00"/>
45+
</actionGroup>
46+
</test>
47+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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="BundleProductWithTierPriceWithFixedAndPercentOptionsInCartTest">
11+
<annotations>
12+
<features value="Bundle"/>
13+
<stories value="Add bundle product to cart on storefront"/>
14+
<title value="Customer should get the right subtotal in cart when the bundle product with tier price and bundle items with fixed and percent price added to the cart"/>
15+
<description value="Customer should be able to add bundle product with tier price and bundle items with fixed and percent price to the cart and get the right price"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-26543"/>
18+
<group value="bundle"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="SimpleProduct2" stepKey="createProductForBundleItem1">
24+
<field key="price">100.00</field>
25+
</createData>
26+
<createData entity="SimpleProduct2" stepKey="createProductForBundleItem2">
27+
<field key="price">100.00</field>
28+
</createData>
29+
<magentoCron groups="index" stepKey="runCronIndex"/>
30+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
31+
</before>
32+
33+
<after>
34+
<deleteData createDataKey="createProductForBundleItem1" stepKey="deleteProductForBundleItem1"/>
35+
<deleteData createDataKey="createProductForBundleItem2" stepKey="deleteProductForBundleItem2"/>
36+
<actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundle">
37+
<argument name="product" value="BundleProduct"/>
38+
</actionGroup>
39+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilters"/>
40+
<waitForPageLoad stepKey="waitForClearProductsGridFilters"/>
41+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
42+
</after>
43+
44+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/>
45+
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
46+
<click selector="{{AdminProductFormBundleSection.dynamicSkuToggle}}" stepKey="disableDynamicSku"/>
47+
<click selector="{{AdminProductFormBundleSection.dynamicPrice}}" stepKey="clickDynamicPriceSwitcher"/>
48+
<fillField selector="{{AdminProductFormBundleSection.priceField}}" userInput="100" stepKey="fillBundlePrice"/>
49+
<actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/>
50+
<actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption1">
51+
<argument name="x" value="0"/>
52+
<argument name="n" value="1"/>
53+
<argument name="prodOneSku" value="$createProductForBundleItem1.sku$"/>
54+
<argument name="prodTwoSku" value=""/>
55+
<argument name="optionTitle" value="Option1"/>
56+
<argument name="inputType" value="checkbox"/>
57+
</actionGroup>
58+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('0', '0')}}" userInput="100" stepKey="fillBundleOption1Price"/>
59+
<selectOption selector="{{AdminProductFormBundleSection.bundlePriceType}}" userInput="Percent" stepKey="selectPercentPrice"/>
60+
<actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption2">
61+
<argument name="x" value="1"/>
62+
<argument name="n" value="2"/>
63+
<argument name="prodOneSku" value="$createProductForBundleItem2.sku$"/>
64+
<argument name="prodTwoSku" value=""/>
65+
<argument name="optionTitle" value="Option2"/>
66+
<argument name="inputType" value="checkbox"/>
67+
</actionGroup>
68+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYPrice('1', '0')}}" userInput="100" stepKey="fillBundleOption2Price"/>
69+
<scrollToTopOfPage stepKey="scrollToTopOfTheProductPage"/>
70+
<actionGroup ref="AdminBundleProductSetAdvancedPricingActionGroup" stepKey="addProductTierPrice">
71+
<argument name="quantity" value="1"/>
72+
<argument name="price" value="Discount"/>
73+
<argument name="amount" value="50"/>
74+
<argument name="priceView" value="As Low as"/>
75+
</actionGroup>
76+
<amOnPage url="{{StorefrontProductPage.url(BundleProduct.urlKey)}}" stepKey="goToStorefront"/>
77+
<waitForPageLoad stepKey="waitForStorefront"/>
78+
<!--Assert Bundle Product Price-->
79+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.asLowAsFinalPrice}}" stepKey="grabProductPrice"/>
80+
<assertEquals message="ExpectedPrice" stepKey="assertBundleProductPrice">
81+
<actualResult type="variable">grabProductPrice</actualResult>
82+
<expectedResult type="string">$150.00</expectedResult>
83+
</assertEquals>
84+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickOnCustomizeAndAddToCartButton"/>
85+
<actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart">
86+
<argument name="quantity" value="1"/>
87+
</actionGroup>
88+
<actionGroup ref="AssertSubTotalOnStorefrontMiniCartActionGroup" stepKey="assertSubTotalOnStorefrontMiniCart">
89+
<argument name="subTotal" value="$150.00"/>
90+
</actionGroup>
91+
</test>
92+
</tests>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Setup\Patch\Data;
8+
9+
use Magento\Catalog\Setup\CategorySetup;
10+
use Magento\Catalog\Setup\CategorySetupFactory;
11+
use Magento\Framework\Setup\ModuleDataSetupInterface;
12+
use Magento\Framework\Setup\Patch\DataPatchInterface;
13+
14+
/**
15+
* Reorder Short Description/Description Product Attributes
16+
*/
17+
class UpdateProductDescriptionOrder implements DataPatchInterface
18+
{
19+
/**
20+
* @var ModuleDataSetupInterface
21+
*/
22+
private $moduleDataSetup;
23+
24+
/**
25+
* @var CategorySetupFactory
26+
*/
27+
private $categorySetupFactory;
28+
29+
/**
30+
* @param ModuleDataSetupInterface $moduleDataSetup
31+
* @param CategorySetupFactory $categorySetupFactory
32+
*/
33+
public function __construct(
34+
ModuleDataSetupInterface $moduleDataSetup,
35+
CategorySetupFactory $categorySetupFactory
36+
) {
37+
$this->moduleDataSetup = $moduleDataSetup;
38+
$this->categorySetupFactory = $categorySetupFactory;
39+
}
40+
41+
/**
42+
* @inheritdoc
43+
*/
44+
public function apply()
45+
{
46+
/** @var CategorySetup $categorySetup */
47+
$categorySetup = $this->categorySetupFactory->create(['setup' => $this->moduleDataSetup]);
48+
$entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
49+
50+
// Content
51+
$categorySetup->updateAttribute(
52+
$entityTypeId,
53+
'short_description',
54+
'frontend_label',
55+
'Short Description',
56+
100
57+
);
58+
$categorySetup->updateAttribute(
59+
$entityTypeId,
60+
'description',
61+
'frontend_label',
62+
'Description',
63+
110
64+
);
65+
66+
return $this;
67+
}
68+
69+
/**
70+
* @inheritdoc
71+
*/
72+
public static function getDependencies()
73+
{
74+
return [
75+
UpdateMediaAttributesBackendTypes::class,
76+
];
77+
}
78+
79+
/**
80+
* @inheritdoc
81+
*/
82+
public function getAliases()
83+
{
84+
return [];
85+
}
86+
}

app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,12 @@
7272
<data key="quantity">3</data>
7373
<var key="sku" entityType="product" entityKey="sku" />
7474
</entity>
75+
<entity name="TierProductPrice50PercentDiscount" type="catalogTierPrice">
76+
<data key="price">50</data>
77+
<data key="price_type">discount</data>
78+
<data key="website_id">0</data>
79+
<data key="customer_group">ALL GROUPS</data>
80+
<data key="quantity">1</data>
81+
<var key="sku" entityType="product" entityKey="sku" />
82+
</entity>
7583
</entities>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductActionSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<section name="StorefrontProductActionSection">
1111
<element name="quantity" type="input" selector="#qty"/>
1212
<element name="addToCart" type="button" selector="#product-addtocart-button" timeout="60"/>
13+
<element name="addToCartEnabledWithTranslation" type="button" selector="button#product-addtocart-button[data-translate]:enabled" timeout="60"/>
1314
<element name="addToCartButtonTitleIsAdding" type="text" selector="//button/span[text()='Adding...']"/>
1415
<element name="addToCartButtonTitleIsAdded" type="text" selector="//button/span[text()='Added']"/>
1516
<element name="addToCartButtonTitleIsAddToCart" type="text" selector="//button/span[text()='Add to Cart']"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<actionGroup ref="FillMainProductFormActionGroup" stepKey="fillBasicProductInfo" />
3333

3434
<click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab" />
35+
<scrollTo selector="{{ProductDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToDescription" />
3536
<waitForElementVisible selector="{{ProductDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="waitForDescription" />
3637
<click selector="{{ProductDescriptionWYSIWYGToolbarSection.InsertImageIcon}}" stepKey="clickInsertImageIcon1" />
3738
<click selector="{{ProductDescriptionWYSIWYGToolbarSection.Browse}}" stepKey="clickBrowse1" />
@@ -67,7 +68,7 @@
6768
<fillField selector="{{ProductDescriptionWYSIWYGToolbarSection.ImageDescription}}" userInput="{{ImageUpload1.content}}" stepKey="fillImageDescription1" />
6869
<fillField selector="{{ProductDescriptionWYSIWYGToolbarSection.Height}}" userInput="{{ImageUpload1.height}}" stepKey="fillImageHeight1" />
6970
<click selector="{{ProductDescriptionWYSIWYGToolbarSection.OkBtn}}" stepKey="clickOkBtn1" />
70-
<scrollTo selector="{{ProductDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="scrollToTinyMCE4" />
71+
<scrollTo selector="{{ProductShortDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToTinyMCE4" />
7172
<click selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertImageIcon}}" stepKey="clickInsertImageIcon2" />
7273
<click selector="{{ProductShortDescriptionWYSIWYGToolbarSection.Browse}}" stepKey="clickBrowse2" />
7374
<waitForLoadingMaskToDisappear stepKey="waitForLoading13"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<see selector="{{ProductDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" userInput="Insert Image..." stepKey="seeInsertImage1"/>
4545
<dontSee selector="{{TinyMCESection.InsertWidgetBtn}}" stepKey="insertWidget1" />
4646
<dontSee selector="{{TinyMCESection.InsertVariableBtn}}" stepKey="insertVariable1" />
47-
<scrollTo selector="{{ProductDescriptionWYSIWYGToolbarSection.showHideBtn}}" stepKey="scrollToDesShowHideBtn2" />
47+
<scrollTo selector="{{ProductShortDescriptionWYSIWYGToolbarSection.showHideBtn}}" y="-150" x="0" stepKey="scrollToDesShowHideBtn2" />
4848
<click selector="{{ProductShortDescriptionWYSIWYGToolbarSection.showHideBtn}}" stepKey="clickShowHideBtn2" />
4949
<waitForElementVisible selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" stepKey="waitForInsertImage2" />
5050
<see selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertImageBtn}}" userInput="Insert Image..." stepKey="seeInsertImage2"/>

0 commit comments

Comments
 (0)