Skip to content

Commit 33f2ecc

Browse files
committed
Merge branch 'AC-15165-updated' of github.com:magento-cia/magento2ce into AC-15165-updated
2 parents 365a006 + 05288d0 commit 33f2ecc

File tree

44 files changed

+1811
-416
lines changed

Some content is hidden

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

44 files changed

+1811
-416
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminCreateCustomConditionWithMultipleSelectInCartPriceRuleActionGroup" extends="AdminCreateCustomConditionInCartPriceRuleActionGroup">
11+
<annotations>
12+
<description>Create custom condition in action tab in cart price rule</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="productAttributeOption" type="string" defaultValue="{{productAttributeColour.black}}"/>
16+
</arguments>
17+
<remove keyForRemoval="fillCategoryId"/>
18+
<selectOption selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1--1')}}" userInput="{{productAttributeOption}}" stepKey="selectProductAttributeValue"/>
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/BackenedData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@
1414
<entity name="WebdriverKey">
1515
<data key="tabKey">[\Facebook\WebDriver\WebDriverKeys::TAB]</data>
1616
</entity>
17+
<entity name="productAttributeColour" type="productAttribute">
18+
<data key="gold">gold</data>
19+
<data key="black">black</data>
20+
</entity>
1721
</entities>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminProductAttributeAdminValuesUsedInsteadOfDefaultValueTest">
11+
<annotations>
12+
<features value="Backend"/>
13+
<stories value="Product attribute admin values should be used in backend"/>
14+
<title value="Product attribute admin values should be used instead of default store view values in backend"/>
15+
<description value="Verify that product attribute admin values should be used in cart price rule instead of default store view values in backend"/>
16+
<testCaseId value="AC-13048"/>
17+
<severity value="MINOR"/>
18+
<group value="backend"/>
19+
</annotations>
20+
<before>
21+
<createData entity="productAttributeMultiselectTwoOptions" stepKey="createColourProductAttribute"/>
22+
</before>
23+
<after>
24+
<!-- Delete cart price rule -->
25+
<actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule">
26+
<argument name="ruleName" value="{{CustomSalesRuleWithNoCouponCode.name}}"/>
27+
</actionGroup>
28+
<!-- Delete attribute -->
29+
<actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid">
30+
<argument name="ProductAttribute" value="$$createColourProductAttribute$$"/>
31+
</actionGroup>
32+
<actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"/>
33+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
34+
</after>
35+
<!-- Login as admin -->
36+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
37+
<!--Step-1 Set Admin value & Default store view value in product attribute & Save the product -->
38+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
39+
<actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="openAttributeFromGrid">
40+
<argument name="ProductAttribute" value="$$createColourProductAttribute$$"/>
41+
</actionGroup>
42+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="$$createColourProductAttribute.attribute_code$$" stepKey="fillDefaultLabel"/>
43+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createColourOptionWhichAsDifferentValuesInAdminAndDefaultStoreView">
44+
<argument name="adminName" value="{{productAttributeColour.black}}"/>
45+
<argument name="frontName" value="{{productAttributeColour.gold}}"/>
46+
<argument name="row" value="1"/>
47+
</actionGroup>
48+
<actionGroup ref="AdminSaveProductAttributeActionGroup" stepKey="saveMultiSelectAttribute"/>
49+
<!-- Product Attribute added to default Attribute set -->
50+
<actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/>
51+
<actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/>
52+
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup">
53+
<argument name="group" value="Product Details"/>
54+
<argument name="attribute" value="$$createColourProductAttribute.attribute_code$$"/>
55+
</actionGroup>
56+
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/>
57+
<!--Step 2: Create cart price rule with custom condition and verify admin value is displayed under product attribute combination -->
58+
<actionGroup ref="AdminCreateCartPriceRuleActionGroup" stepKey="createCartPriceRule">
59+
<argument name="ruleName" value="CustomSalesRuleWithNoCouponCode"/>
60+
</actionGroup>
61+
<actionGroup ref="AdminFilterCartPriceRuleActionGroup" stepKey="filterCreatedCartPriceRule">
62+
<argument name="ruleName" value="CustomSalesRuleWithNoCouponCode.name"/>
63+
</actionGroup>
64+
<actionGroup ref="AdminCreateCustomConditionWithMultipleSelectInCartPriceRuleActionGroup" stepKey="createProductAttributeCombinationCondition">
65+
<argument name="productAttribute" value="$$createColourProductAttribute.attribute_code$$"/>
66+
</actionGroup>
67+
<waitForText selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1--1')}}" userInput="{{productAttributeColour.black}}" stepKey="verifyAdminValueIsVisibleInTheConditionInsteadOfDefaultStoreViewValue"/>
68+
<dontSee selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1--1')}}" userInput="{{productAttributeColour.gold}}" stepKey="verifyDefaultStoreViewValueIsNotVisible"/>
69+
<actionGroup ref="AssertCartPriceRuleSuccessSaveMessageActionGroup" stepKey="saveAndAssertCartPriceRuleSuccessSaveMessage"/>
70+
</test>
71+
</tests>

app/code/Magento/Catalog/Model/FrontendStorageConfigurationPool.php

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2017 Adobe
44
* All Rights Reserved.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Catalog\Model;
89

@@ -17,18 +18,12 @@
1718
*/
1819
class FrontendStorageConfigurationPool
1920
{
20-
/**
21-
* @var array
22-
*/
23-
private $storageConfigurations;
24-
2521
/**
2622
* StorageConfigurationPool constructor.
2723
* @param array $storageConfigurations
2824
*/
29-
public function __construct(array $storageConfigurations = [])
25+
public function __construct(private array $storageConfigurations = [])
3026
{
31-
$this->storageConfigurations = $storageConfigurations;
3227
}
3328

3429
/**
@@ -40,16 +35,16 @@ public function __construct(array $storageConfigurations = [])
4035
*/
4136
public function get($namespace)
4237
{
43-
if (isset($this->storageConfigurations[$namespace])) {
44-
if (!$this->storageConfigurations[$namespace] instanceof FrontendStorageConfigurationInterface) {
45-
throw new LocalizedException(
46-
__(sprintf("Invalid pool type with namespace: %s", $namespace))
47-
);
48-
}
49-
} else {
38+
$storageConfiguration = $this->storageConfigurations[$namespace] ?? null;
39+
if ($storageConfiguration === null) {
5040
return false;
5141
}
42+
if (!$storageConfiguration instanceof FrontendStorageConfigurationInterface) {
43+
throw new LocalizedException(
44+
__("Invalid pool type with namespace: %1", $namespace)
45+
);
46+
}
5247

53-
return $this->storageConfigurations[$namespace];
48+
return $storageConfiguration;
5449
}
5550
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminDisableCategoryPathForProductUrlActionGroup">
12+
<annotations>
13+
<description>Disable the category path for product url through CLI</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{DisableCategoriesPathForProductUrls.path}} {{DisableCategoriesPathForProductUrls.value}}" stepKey="disableCategoriesPathForProductUrls"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminDisableRememberCategoryPaginationActionGroup">
12+
<annotations>
13+
<description>Disable the remember category pagination through CLI</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{DisableRememberCategoryPagination.path}} {{DisableRememberCategoryPagination.value}}" stepKey="disableCategoryPagination"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminEnableCategoryPathForProductUrlActionGroup">
12+
<annotations>
13+
<description>Enable the category path for product url through CLI</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{EnableCategoriesPathForProductUrls.path}} {{EnableCategoriesPathForProductUrls.value}}" stepKey="enableCategoriesPathForProductUrls"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminEnableRememberCategoryPaginationActionGroup">
12+
<annotations>
13+
<description>Enable the remember category pagination through CLI</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{EnableRememberCategoryPagination.path}} {{EnableRememberCategoryPagination.value}}" stepKey="enableCategoryPagination"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminUpdateCategoryDisplaySettingsWithCustomValuesActionGroup"
12+
extends="AdminUpdateCategoryDisplaySettingsActionGroup">
13+
<annotations>
14+
<description>Update Category Display settings with custom values (unchecks Use Config first)</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="availableSortOptions" type="string" defaultValue="Product Name"/>
18+
<argument name="defaultSortingOption" type="string" defaultValue="name"/>
19+
<argument name="priceRange" type="string" defaultValue="5.5"/>
20+
</arguments>
21+
<!-- Override the checkbox behavior to uncheck instead of check -->
22+
<remove keyForRemoval="enableTheAvailableProductList" />
23+
<uncheckOption selector="{{CategoryDisplaySettingsSection.productListCheckBox}}" after="selectDisplaySetting"
24+
stepKey="uncheckUseConfigForAvailableSort"/>
25+
<remove keyForRemoval="enableTheDefaultProductList" />
26+
<uncheckOption selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}"
27+
after="scrollToDefaultProductList" stepKey="uncheckUseConfigForDefaultSort"/>
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="StorefrontVerifyCategoryContentActionGroup">
12+
<annotations>
13+
<description>Verify category content on storefront including image, description, meta title, and product count</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="description" type="string" defaultValue="categoryDescription"/>
17+
<argument name="metaTitle" type="string" defaultValue="metaTitle"/>
18+
<argument name="productCount" type="string" defaultValue="1"/>
19+
</arguments>
20+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.categoryImage}}"
21+
stepKey="verifyImageVisible"/>
22+
<waitForText userInput="{{description}}"
23+
selector="{{StorefrontCategoryMainSection.CatalogDescriptionWithoutPTag}}"
24+
stepKey="verifyDescription"/>
25+
<waitForElement selector="{{StorefrontCategoryHeadSection.pageTitle(metaTitle)}}"
26+
stepKey="verifyMetaTitle"/>
27+
<waitForText userInput="{{productCount}}" selector="{{StorefrontCategoryMainSection.productCount}}"
28+
stepKey="verifyProductCount"/>
29+
</actionGroup>
30+
</actionGroups>

0 commit comments

Comments
 (0)