Skip to content

Commit 7153359

Browse files
authored
Merge branch '2.4-develop' into fix-26976
2 parents cae2258 + ac1ea0b commit 7153359

File tree

137 files changed

+2970
-483
lines changed

Some content is hidden

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

137 files changed

+2970
-483
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
namespace Magento\Catalog\Model;
99

1010
/**
11-
* Filter custom attributes for product using the blacklist
11+
* Filter custom attributes for product using the excluded list
1212
*/
1313
class FilterProductCustomAttribute
1414
{
1515
/**
1616
* @var array
1717
*/
18-
private $blackList;
18+
private $excludedList;
1919

2020
/**
21-
* @param array $blackList
21+
* @param array $excludedList
2222
*/
23-
public function __construct(array $blackList = [])
23+
public function __construct(array $excludedList = [])
2424
{
25-
$this->blackList = $blackList;
25+
$this->excludedList = $excludedList;
2626
}
2727

2828
/**
@@ -33,6 +33,6 @@ public function __construct(array $blackList = [])
3333
*/
3434
public function execute(array $attributes): array
3535
{
36-
return array_diff_key($attributes, array_flip($this->blackList));
36+
return array_diff_key($attributes, array_flip($this->excludedList));
3737
}
3838
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminSetManageStockConfigActionGroup">
12+
<annotations>
13+
<description>Set "Manage Stock" config in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="value" type="string"/>
17+
</arguments>
18+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="uncheckConfigSetting"/>
19+
<selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="{{value}}"
20+
stepKey="setManageStockConfig"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminSetMaxAllowedQtyForProductActionGroup">
12+
<annotations>
13+
<description>Fills in the "Maximum Qty Allowed in Shopping Cart" option in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="qty" type="string"/>
17+
</arguments>
18+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="uncheckMaxQtyCheckBox"/>
19+
<fillField selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCart}}" userInput="{{qty}}"
20+
stepKey="fillMaxAllowedQty"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminSetMinAllowedQtyForProductActionGroup">
12+
<annotations>
13+
<description>Fills in the "Minimum Qty Allowed in Shopping Cart" option in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="qty" type="string"/>
17+
</arguments>
18+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.miniQtyConfigSetting}}" stepKey="uncheckMiniQtyCheckBox"/>
19+
<fillField selector="{{AdminProductFormAdvancedInventorySection.miniQtyAllowedInCart}}" userInput="{{qty}}"
20+
stepKey="fillMinAllowedQty"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminSetNotifyBelowQtyValueActionGroup">
12+
<annotations>
13+
<description>Fills in the "Notify for Quantity Below" option in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="qty" type="string"/>
17+
</arguments>
18+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQtyConfigSetting}}"
19+
stepKey="uncheckNotifyBelowQtyCheckBox"/>
20+
<fillField selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQty}}" userInput="{{qty}}"
21+
stepKey="fillNotifyBelowQty"/>
22+
</actionGroup>
23+
</actionGroups>
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="AdminSetQtyUsesDecimalsConfigActionGroup">
12+
<annotations>
13+
<description>Set "Qty Uses Decimals" config in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="value" type="string"/>
17+
</arguments>
18+
<selectOption selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" userInput="{{value}}"
19+
stepKey="setQtyUsesDecimalsConfig"/>
20+
</actionGroup>
21+
</actionGroups>
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="AdminSetStockStatusConfigActionGroup">
12+
<annotations>
13+
<description>Set "Stock status" config in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="stockStatus" type="string"/>
17+
</arguments>
18+
<selectOption selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryStockStatus}}"
19+
userInput="{{stockStatus}}" stepKey="selectStockStatus"/>
20+
</actionGroup>
21+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAssertProductPageAddToWishlistButtonIsNotPresentActionGroup">
12+
<dontSee userInput="Add to Wish List" selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="dontSeeElement"/>
13+
</actionGroup>
14+
</actionGroups>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@
3030
<data key="label">No</data>
3131
<data key="value">0</data>
3232
</entity>
33+
<entity name="CatalogInventoryOptionsOnlyXleftThreshold">
34+
<!-- Magento default value -->
35+
<data key="path">cataloginventory/options/stock_threshold_qty</data>
36+
<data key="value">0</data>
37+
</entity>
3338
</entities>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
<element name="customOptionDropDown" type="select" selector="//*[@id='product-options-wrapper']//select[contains(@class, 'product-custom-option admin__control-select')]"/>
2626
<element name="qtyInputWithProduct" type="input" selector="//tr//strong[contains(.,'{{productName}}')]/../../td[@class='col qty']//input" parameterized="true"/>
2727
<element name="customOptionRadio" type="input" selector="//span[contains(text(),'{{customOption}}')]/../../input" parameterized="true"/>
28+
<element name="onlyProductsLeft" type="block" selector="//div[@class='product-info-price']//div[@class='product-info-stock-sku']//div[@class='availability only']"/>
2829
</section>
29-
</sections>
30+
</sections>

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

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,42 +34,46 @@
3434
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3535
</after>
3636
<!--Open Product Index Page and filter the product-->
37-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
38-
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
37+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/>
3938
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct">
4039
<argument name="product" value="SimpleProduct"/>
4140
</actionGroup>
4241
<!-- Update product Advanced Inventory Setting -->
43-
<click stepKey="openSelectedProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/>
44-
<waitForPageLoad stepKey="waitForProductToLoad"/>
45-
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
46-
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
47-
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="uncheckConfigSetting"/>
48-
<selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="Yes" stepKey="clickOnManageStock"/>
49-
<fillField selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryQty}}" userInput="5" stepKey="fillProductQty"/>
50-
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.miniQtyConfigSetting}}" stepKey="uncheckMiniQtyCheckBox"/>
51-
<fillField selector="{{AdminProductFormAdvancedInventorySection.miniQtyAllowedInCart}}" userInput="1" stepKey="fillMiniAllowedQty"/>
52-
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="uncheckMaxQtyCheckBox"/>
53-
<fillField selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCart}}" userInput="10000" stepKey="fillMaxAllowedQty"/>
54-
<selectOption selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" userInput="Yes" stepKey="selectQuatityUsesDecimal"/>
55-
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQtyConfigSetting}}" stepKey="uncheckNotifyBelowQtyheckBox"/>
56-
<fillField selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQty}}" userInput="1" stepKey="fillNotifyBelowQty"/>
57-
<selectOption selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryStockStatus}}" userInput="Out of Stock" stepKey="selectOutOfStock"/>
58-
<click selector="{{AdminProductFormAdvancedInventorySection.doneButton}}" stepKey="clickOnDoneButton"/>
59-
<waitForPageLoad stepKey="waitForProductPageToSave"/>
60-
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/>
61-
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
62-
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/>
42+
<actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct"/>
43+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/>
44+
<actionGroup ref="AdminSetManageStockConfigActionGroup" stepKey="setManageStockConfig">
45+
<argument name="value" value="Yes"/>
46+
</actionGroup>
47+
<actionGroup ref="AdminFillAdvancedInventoryQtyActionGroup" stepKey="fillProductQty">
48+
<argument name="qty" value="5"/>
49+
</actionGroup>
50+
<actionGroup ref="AdminSetMinAllowedQtyForProductActionGroup" stepKey="fillMiniAllowedQty">
51+
<argument name="qty" value="1"/>
52+
</actionGroup>
53+
<actionGroup ref="AdminSetMaxAllowedQtyForProductActionGroup" stepKey="fillMaxAllowedQty">
54+
<argument name="qty" value="1000"/>
55+
</actionGroup>
56+
<actionGroup ref="AdminSetQtyUsesDecimalsConfigActionGroup" stepKey="setQtyUsesDecimalsConfig">
57+
<argument name="value" value="Yes"/>
58+
</actionGroup>
59+
<actionGroup ref="AdminSetNotifyBelowQtyValueActionGroup" stepKey="fillNotifyBelowQty">
60+
<argument name="qty" value="1"/>
61+
</actionGroup>
62+
<actionGroup ref="AdminSetStockStatusConfigActionGroup" stepKey="selectOutOfStock">
63+
<argument name="stockStatus" value="Out of Stock"/>
64+
</actionGroup>
65+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButton"/>
66+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
6367
<!--Verify product is not visible in category store front page -->
64-
<amOnPage url="$$createCategory.name$$.html" stepKey="openCategoryStoreFrontPage"/>
65-
<waitForPageLoad stepKey="waitForCategoryPageToLoad"/>
66-
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="seeCategoryInFrontPage"/>
67-
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="clickOnCategory"/>
68-
<dontSee selector="{{StorefrontCategoryMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="dontSeeProductInCategoryPage"/>
68+
<actionGroup ref="AssertStorefrontProductAbsentOnCategoryPageActionGroup" stepKey="doNotSeeProductInCategoryPage">
69+
<argument name="categoryUrlKey" value="$$createCategory.name$$"/>
70+
<argument name="productName" value="{{SimpleProduct.name}}"/>
71+
</actionGroup>
6972
<!--Verify Product In Store Front-->
70-
<amOnPage url="$$createSimpleProduct.name$$.html" stepKey="goToProductStorefrontPage"/>
71-
<waitForPageLoad stepKey="waitForProductPageTobeLoaded"/>
72-
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInStoreFront"/>
73-
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out of stock" stepKey="seeProductStatusIsOutOfStock"/>
73+
<actionGroup ref="StorefrontCheckProductStockStatus" stepKey="seeProductOnStorefront">
74+
<argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/>
75+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
76+
<argument name="stockStatus" value="Out of stock"/>
77+
</actionGroup>
7478
</test>
7579
</tests>

0 commit comments

Comments
 (0)