Skip to content

Commit a37f787

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into AC-9030
2 parents 5f194c6 + 1711d57 commit a37f787

File tree

196 files changed

+28475
-23401
lines changed

Some content is hidden

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

196 files changed

+28475
-23401
lines changed

app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function _isApplicableAttribute($object, $attribute)
8787
{
8888
$applyTo = $attribute->getApplyTo() ?: [];
8989
return (count($applyTo) == 0 || in_array($object->getTypeId(), $applyTo))
90-
&& $attribute->isInSet($object->getAttributeSetId());
90+
&& $attribute->isInSet($object->getAttributeSetId() ?? $this->getEntityType()->getDefaultAttributeSetId());
9191
}
9292

9393
/**
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Catalog\Test\Fixture;
9+
10+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
11+
use Magento\Eav\Model\Config;
12+
use Magento\Framework\DataObject;
13+
use Magento\TestFramework\Fixture\Api\ServiceFactory;
14+
use Magento\TestFramework\Fixture\Data\ProcessorInterface;
15+
16+
class AttributeSet extends \Magento\Eav\Test\Fixture\AttributeSet
17+
{
18+
private const ENTITY_TYPE = ProductAttributeInterface::ENTITY_TYPE_CODE;
19+
20+
public function __construct(
21+
ServiceFactory $serviceFactory,
22+
ProcessorInterface $dataProcessor,
23+
private readonly Config $eavConfig
24+
) {
25+
parent::__construct($serviceFactory, $dataProcessor);
26+
}
27+
28+
/**
29+
* {@inheritdoc}
30+
*/
31+
public function apply(array $data = []): ?DataObject
32+
{
33+
return parent::apply(
34+
array_merge(
35+
[
36+
'entity_type_code' => self::ENTITY_TYPE,
37+
'skeleton_id' => $this->eavConfig->getEntityType(self::ENTITY_TYPE)->getDefaultAttributeSetId(),
38+
],
39+
$data
40+
)
41+
);
42+
}
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontProductDetailPageTierPriceWithCurrencyActionGroup">
11+
<arguments>
12+
<argument name="tierProductPriceDiscountQuantity" type="string"/>
13+
<argument name="productPriceWithAppliedTierPriceDiscount" type="string"/>
14+
<argument name="productSavedPricePercent" type="string"/>
15+
<argument name="index" type="string"/>
16+
17+
</arguments>
18+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.tierPriceWithIndex(index)}}" stepKey="tierPriceText"/>
19+
<assertEquals stepKey="assertTierPriceTextOnProductPage">
20+
<expectedResult type="string">Buy {{tierProductPriceDiscountQuantity}} for €{{productPriceWithAppliedTierPriceDiscount}} each and save {{productSavedPricePercent}}%</expectedResult>
21+
<actualResult type="variable">tierPriceText</actualResult>
22+
</assertEquals>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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="ProductSetAdvancedPricingWithIndexActionGroup">
12+
<annotations>
13+
<description>Sets the provided Advanced Pricing on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="website" type="string" defaultValue=""/>
17+
<!--<argument name="group" type="string" defaultValue="Retailer"/>-->
18+
<argument name="quantity" type="string" defaultValue="1"/>
19+
<argument name="price" type="string" defaultValue="Discount"/>
20+
<argument name="amount" type="string" defaultValue="45"/>
21+
<argument name="index" type="string" defaultValue="0"/>
22+
</arguments>
23+
24+
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
25+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/>
26+
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAnd10percent"/>
27+
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(index)}}" stepKey="waitForSelectCustomerGroupNameAttribute2"/>
28+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect(index)}}" userInput="{{website}}" stepKey="selectProductWebsiteValue"/>
29+
<!--<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(index)}}" userInput="{{group}}" stepKey="selectProductCustomGroupValue"/>-->
30+
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(index)}}" userInput="{{quantity}}" stepKey="fillProductTierPriceQtyInput"/>
31+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect(index)}}" userInput="{{price}}" stepKey="selectProductTierPriceValueType"/>
32+
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput(index)}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput"/>
33+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
34+
<waitForPageLoad stepKey="WaitForProductSave"/>
35+
<click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct1"/>
36+
<waitForPageLoad time="60" stepKey="WaitForProductSave1"/>
37+
<see userInput="You saved the product." stepKey="seeSaveConfirmation"/>
38+
</actionGroup>
39+
</actionGroups>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,13 @@
186186
<entity name="ProductOptionFileSecond" extends="ProductOptionFile">
187187
<data key="title" unique="suffix">fourth option</data>
188188
</entity>
189+
<entity name="FieldProductOption" type="product_option">
190+
<var key="product_sku" entityType="product" entityKey="sku" />
191+
<data key="title">Optiontitle1</data>
192+
<data key="sku">Optiontitle1</data>
193+
<data key="type">field</data>
194+
<data key="is_require">true</data>
195+
<data key="price">250</data>
196+
<data key="price_type">fixed</data>
197+
</entity>
189198
</entities>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
<element name="allowGiftsWrapCheckbox" type="checkbox" selector="//input[@type='checkbox' and @name='product[use_config_gift_wrapping_available]']" />
4545
<element name="allowGiftsWrapToggle" type="button" selector="//input[@type='checkbox' and @name='product[use_config_gift_wrapping_available]' and @value='{{var1}}']/../../../..//label[@class='admin__actions-switch-label']" parameterized="true"/>
4646
<element name="priceForGiftsWrapping" type="input" selector="//input[@name='product[gift_wrapping_price]']"/>
47+
<element name="productCollapsibleColumnsScheduleUpdate" type="button" selector="//div[@class='modal-component']//div[@class='entry-edit form-inline']//div[@data-state-collapsible='{{state}}']//strong[@class='admin__collapsible-title']//span[text()='{{expandTitle}}']" parameterized="true"/>
48+
<element name="allowGiftMessageToggleVerify" type="button" selector="//input[@type='checkbox' and @name='product[gift_message_available]' and @value='{{var1}}']" parameterized="true"/>
4749
</section>
4850
</sections>
4951

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<element name="productTierPriceByForTextLabel" type="text" selector="//ul[contains(@class, 'prices-tier')]//li[{{var1}}][contains(text(),'Buy {{var2}} for')]" parameterized="true"/>
8383
<element name="productTierPriceAmount" type="text" selector="//ul[contains(@class, 'prices-tier')]//li[{{var1}}]//span[contains(text(), '{{var2}}')]" parameterized="true"/>
8484
<element name="productTierPriceSavePercentageAmount" type="text" selector="//ul[contains(@class, 'prices-tier')]//li[{{var1}}]//span[contains(@class, 'percent')][contains(text(), '{{var2}}')]" parameterized="true"/>
85+
<element name="tierPriceWithIndex" type="text" selector=".//*[@class='prices-tier items']/li[{{var}}]" parameterized="true"/>
8586

8687
<!-- Special price selectors -->
8788
<element name="productSpecialPrice" type="text" selector="//span[@data-price-type='finalPrice']/span"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<click selector="{{StorefrontHeaderSection.mobileMenuToggle}}" stepKey="openSideMenu"/>
4343
<waitForElementClickable selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createParentCategory.name$$)}}" stepKey="waitForCategoryMenuClickable" />
4444
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createParentCategory.name$$)}}" stepKey="expandCategoryMenu"/>
45+
<waitForPageLoad stepKey="waitForSearchResult"/>
4546

4647
<!-- Assert the category expanded successfully -->
4748
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="verifySubCatMenuItemIsVisibleInTheSidebar">

0 commit comments

Comments
 (0)