Skip to content

Commit f2aa4bc

Browse files
Merge branch '2.4-develop' into spartans_pr_11122024
2 parents 1818ccd + f3e6674 commit f2aa4bc

File tree

98 files changed

+646
-333
lines changed

Some content is hidden

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

98 files changed

+646
-333
lines changed

app/code/Magento/AwsS3/Test/Mftf/Helper/DummyMetadataCache.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -13,72 +13,72 @@
1313
class DummyMetadataCache implements \Magento\RemoteStorage\Driver\Adapter\Cache\CacheInterface
1414
{
1515
/**
16-
* @inheirtDoc
16+
* @inheritDoc
1717
*/
1818
public function exists(string $path): ?bool
1919
{
2020
return null;
2121
}
2222

2323
/**
24-
* @inheirtDoc
24+
* @inheritDoc
2525
*/
2626
public function getMetadata(string $path): ?array
2727
{
2828
return null;
2929
}
3030

3131
/**
32-
* @inheirtDoc
32+
* @inheritDoc
3333
*/
3434
public function flushCache(): void
3535
{
3636
}
3737

3838
/**
39-
* @inheirtDoc
39+
* @inheritDoc
4040
*/
4141
public function purgeQueue(): void
4242
{
4343
}
4444

4545
/**
46-
* @inheirtDoc
46+
* @inheritDoc
4747
*/
4848
public function moveFile(string $path, string $newpath): void
4949
{
5050
}
5151

5252
/**
53-
* @inheirtDoc
53+
* @inheritDoc
5454
*/
5555
public function copyFile(string $path, string $newpath): void
5656
{
5757
}
5858

5959
/**
60-
* @inheirtDoc
60+
* @inheritDoc
6161
*/
6262
public function deleteFile(string $path): void
6363
{
6464
}
6565

6666
/**
67-
* @inheirtDoc
67+
* @inheritDoc
6868
*/
6969
public function deleteDir(string $dirname): void
7070
{
7171
}
7272

7373
/**
74-
* @inheirtDoc
74+
* @inheritDoc
7575
*/
7676
public function updateMetadata(string $path, array $objectMetadata, bool $persist = false): void
7777
{
7878
}
7979

8080
/**
81-
* @inheirtDoc
81+
* @inheritDoc
8282
*/
8383
public function storeFileNotExists(string $path): void
8484
{

app/code/Magento/Catalog/Model/Product/Type/AbstractType.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2011 Adobe
4+
* All Rights Reserved.
55
*/
66

77
namespace Magento\Catalog\Model\Product\Type;
@@ -241,12 +241,13 @@ public function getRelationInfo()
241241
* group => array(ids)
242242
* )
243243
*
244-
* @deplacated TODO: refactor to child relation manager
244+
* @deprecated TODO: refactor to child relation manager
245245
*
246246
* @param int $parentId
247247
* @param bool $required
248248
* @return array
249249
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
250+
* @see Nothing
250251
*/
251252
public function getChildrenIds($parentId, $required = true)
252253
{

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddProductCustomOptionActionGroup.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

9-
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!-- Add custom option, title and type -->
1212
<actionGroup name="AdminAddProductCustomOptionActionGroup">
@@ -17,9 +17,10 @@
1717
<argument name="customOptionTitle" type="string"/>
1818
<argument name="customOptionType" type="string"/>
1919
</arguments>
20-
20+
2121
<scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToCustomizableOptionsSection"/>
2222
<waitForPageLoad stepKey="waitForScrolling"/>
23+
<conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/>
2324
<click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/>
2425
<waitForPageLoad stepKey="waitForAddProductPageLoad"/>
2526
<fillField stepKey="fillInOptionTitle" selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{customOptionTitle}}"/>

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -475,5 +475,16 @@
475475
<data key="is_filterable_in_grid">true</data>
476476
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
477477
</entity>
478+
<entity name="productAttributeAgeGroupDropdown" type="ProductAttribute">
479+
<data key="default_frontend_label" unique="suffix">Age Group</data>
480+
<data key="attribute_code" unique="suffix">agegroup</data>
481+
<data key="frontend_input">select</data>
482+
<data key="scope">website</data>
483+
<data key="is_required">false</data>
484+
<data key="is_unique">false</data>
485+
<data key="is_searchable">false</data>
486+
<data key="is_used_for_promo_rules">true</data>
487+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
488+
</entity>
478489
</entities>
479490

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -125,4 +125,16 @@
125125
<data key="sort_order">3</data>
126126
<requiredEntity type="StoreLabel">Option14Store1</requiredEntity>
127127
</entity>
128+
<entity name="productAttributeOptionAdult" type="ProductAttributeOption">
129+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
130+
<data key="label">Adult</data>
131+
<data key="is_default">false</data>
132+
<data key="sort_order">0</data>
133+
</entity>
134+
<entity name="productAttributeOptionChildren" type="ProductAttributeOption">
135+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
136+
<data key="label">children</data>
137+
<data key="is_default">false</data>
138+
<data key="sort_order">0</data>
139+
</entity>
128140
</entities>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -91,6 +91,6 @@
9191
<element name="customTextAttribute" type="input" selector="//input[@name='product[{{attribute_code}}]']" parameterized="true"/>
9292
<element name="customSelectAttribute" type="select" selector="//select[@name='product[{{attribute_code}}]']" parameterized="true"/>
9393
<element name="customSwitcherAttribute" type="checkbox" selector="//input[@name='product[{{attribute_code}}]' and @value='{{checked_value}}']/parent::div[@data-role='switcher']" parameterized="true"/>
94-
94+
<element name="attributeOptionUncheckDefaultValue" type="checkbox" selector="input[name='use_default[{{attribute_code}}]']" parameterized="true"/>
9595
</section>
9696
</sections>

app/code/Magento/Catalog/Test/Unit/Model/CategoryRepositoryTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -70,7 +70,7 @@ class CategoryRepositoryTest extends TestCase
7070
private $populateWithValuesMock;
7171

7272
/**
73-
* @inheridoc
73+
* @inheritDoc
7474
*/
7575
protected function setUp(): void
7676
{

app/code/Magento/Catalog/Test/Unit/Model/Product/Option/SaveHandlerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2016 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -46,7 +46,7 @@ class SaveHandlerTest extends TestCase
4646
private $relationMock;
4747

4848
/**
49-
* @inheridoc
49+
* @inheritDoc
5050
*/
5151
protected function setUp(): void
5252
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontVerifySingleProductCatalogPriceRuleAcrossWebsitesTest">
11+
<annotations>
12+
<features value="CatalogRule"/>
13+
<stories value="Apply catalog price rule"/>
14+
<title value="Catalog rule should apply for product on multiple websites"/>
15+
<description value="Testcase verifies On storefront catalog price rule applied for product on multiple websites"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-7409"/>
18+
</annotations>
19+
<before>
20+
<!--Create dropdown product attribute-->
21+
<createData entity="productAttributeAgeGroupDropdown" stepKey="createDropdownAttribute"/>
22+
<!--Create attribute options-->
23+
<createData entity="productAttributeOptionAdult" stepKey="createFirstAttributeOption">
24+
<requiredEntity createDataKey="createDropdownAttribute"/>
25+
</createData>
26+
<createData entity="productAttributeOptionChildren" stepKey="createSecondAttributeOption">
27+
<requiredEntity createDataKey="createDropdownAttribute"/>
28+
</createData>
29+
<!--Add attribute to default attribute set-->
30+
<createData entity="AddToDefaultSet" stepKey="addAttributeToDefaultSet">
31+
<requiredEntity createDataKey="createDropdownAttribute"/>
32+
</createData>
33+
<!-- Create Simple Product -->
34+
<createData entity="SimpleProduct" stepKey="createProduct">
35+
<field key="price">100.00</field>
36+
</createData>
37+
<!-- Login as Admin -->
38+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
39+
<!--Create custom website -->
40+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createCustomWebsite">
41+
<argument name="newWebsiteName" value="{{NewWebSiteData.name}}"/>
42+
<argument name="websiteCode" value="{{NewWebSiteData.code}}"/>
43+
</actionGroup>
44+
<!-- Create custom store-->
45+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createCustomStore">
46+
<argument name="website" value="{{NewWebSiteData.name}}"/>
47+
<argument name="storeGroupName" value="{{NewWebSiteData.name}}"/>
48+
<argument name="storeGroupCode" value="{{NewWebSiteData.code}}"/>
49+
</actionGroup>
50+
<!-- Create custom store view-->
51+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
52+
<argument name="StoreGroup" value="NewWebSiteData"/>
53+
<argument name="customStore" value="NewWebSiteData"/>
54+
</actionGroup>
55+
</before>
56+
<after>
57+
<!--set main website as default-->
58+
<actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="setMainWebsiteAsDefault">
59+
<argument name="websiteName" value="Main Website"/>
60+
</actionGroup>
61+
<!-- Delete product -->
62+
<deleteData createDataKey="createProduct" stepKey="deleteFirstProduct"/>
63+
<deleteData createDataKey="createDropdownAttribute" stepKey="deleteDropdownAttribute"/>
64+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteCustomWebsite">
65+
<argument name="websiteName" value="{{NewWebSiteData.name}}"/>
66+
</actionGroup>
67+
<!-- Delete created price rules -->
68+
<actionGroup ref="RemoveCatalogPriceRuleActionGroup" stepKey="deleteCatalogPriceRule">
69+
<argument name="ruleName" value="{{_defaultCatalogRule.name}}"/>
70+
</actionGroup>
71+
<!-- Logout -->
72+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
73+
</after>
74+
<!--Assign product to custom website-->
75+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
76+
<argument name="productId" value="$$createProduct.id$$"/>
77+
</actionGroup>
78+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
79+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct">
80+
<argument name="website" value="{{NewWebSiteData.name}}"/>
81+
</actionGroup>
82+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
83+
<!--Switch scope to Default store view-->
84+
<actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchDefaultStoreView">
85+
<argument name="storeViewName" value="'Default Store View'"/>
86+
</actionGroup>
87+
<uncheckOption selector="{{AdminProductFormSection.attributeOptionUncheckDefaultValue('$$createDropdownAttribute.attribute_code$$')}}" stepKey="unCheckDefaultValueInDefaultStoreview"/>
88+
<selectOption selector="{{AdminProductFormSection.customSelectAttribute('$$createDropdownAttribute.attribute_code$$')}}" userInput="Adult" stepKey="selectValueForAttributeInDefaultStoreview"/>
89+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductInDefaultStoreView"/>
90+
<!--Switch scope to custom store view-->
91+
<actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchScopeToCustomStoreView">
92+
<argument name="storeViewName" value="{{NewWebSiteData.name}}"/>
93+
</actionGroup>
94+
<uncheckOption selector="{{AdminProductFormSection.attributeOptionUncheckDefaultValue('$$createDropdownAttribute.attribute_code$$')}}" stepKey="unCheckDefaultValueInCustomStoreview"/>
95+
<selectOption selector="{{AdminProductFormSection.customSelectAttribute('$$createDropdownAttribute.attribute_code$$')}}" userInput="children" stepKey="selectValueForAttributeInCustomStoreview"/>
96+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductInCustomStoreView"/>
97+
<!-- create catalog price with 50% discount and condition -->
98+
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="openNewCatalogPriceRulePage"/>
99+
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForSecondCatalogPriceRule">
100+
<argument name="websites" value="'Main Website',{{NewWebSiteData.name}}"/>
101+
</actionGroup>
102+
<actionGroup ref="AdminFillCatalogRuleConditionWithSelectAttributeActionGroup" stepKey="fillConditionsForCatalogPriceRule">
103+
<argument name="condition" value="$$createDropdownAttribute.default_frontend_label$$"/>
104+
<argument name="conditionValue" value="Adult"/>
105+
</actionGroup>
106+
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForCatalogPriceRule">
107+
<argument name="discountAmount" value="50"/>
108+
</actionGroup>
109+
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyCatalogPriceRule"/>
110+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
111+
<argument name="indices" value=""/>
112+
</actionGroup>
113+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
114+
<argument name="tags" value="config full_page"/>
115+
</actionGroup>
116+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront">
117+
<argument name="product" value="$$createProduct$$"/>
118+
</actionGroup>
119+
<waitForText selector="{{StorefrontProductInfoMainSection.updatedPrice}}" userInput="$50.00" stepKey="assertProductPriceAmountOnMainWebsite"/>
120+
<actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="setSecondaryWebsiteAsDefault">
121+
<argument name="websiteName" value="{{NewWebSiteData.name}}"/>
122+
</actionGroup>
123+
<!-- Clean config and full page cache-->
124+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache">
125+
<argument name="tags" value="config full_page"/>
126+
</actionGroup>
127+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductOnStorefront">
128+
<argument name="product" value="$$createProduct$$"/>
129+
</actionGroup>
130+
<waitForText selector="{{StorefrontProductInfoMainSection.updatedPrice}}" userInput="$100.00" stepKey="assertProductPriceAmountOnCustomWebsite"/>
131+
</test>
132+
</tests>

0 commit comments

Comments
 (0)