Skip to content

Commit 5112f27

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop expedited
Accepted Community Pull Requests: - #26987: Remove unused requirejs alias defined (by @mrtuvn) - #26560: #26473: Improved logic for product image updating for configurable products (by @sergiy-v) - #27015: MC-26683: Removed get errors of cart allowing to add product to cart (by @AleksLi) - #27266: MFTF: Enable Persistent Shopping Cart. Assert Options (by @DmitryTsymbal) - #27165: [feature] Display category filter item in layered navigation based on the system configuration from admin area (by @vasilii-b) - #27255: MFTF: Replace fragile test `AdminLoginTest` with `AdminLoginSuccessfulTest` (by @lbajsarowicz) - #25297: Add 'schedule status' column to admin indexer grid (by @fredden) - #24479: 22251 admin order email is now required 1 (by @solwininfotech) Fixed GitHub Issues: - #26963: Missing JS file (critical-css-loader) in Magento 2.3.4 (reported by @Sathishkumar8731) has been fixed in #26987 by @mrtuvn in 2.4-develop branch Related commits: 1. e2c403f 2. eee0262 3. befbca4 4. e22c47c 5. a3218fe 6. f98537d 7. 339c099 8. 5843df4 9. abad8db 10. c40d35c 11. fb839e7 12. e45dd6e 13. 5c29e19 - #26473: BUG: Wrong selected product image when query url param configurable product (reported by @kylianleemkuil) has been fixed in #26560 by @sergiy-v in 2.4-develop branch Related commits: 1. 54f93e2 - #26856: Wrong gallery main image and active preview after updating for configurable products. (reported by @sergiy-v) has been fixed in #26560 by @sergiy-v in 2.4-develop branch Related commits: 1. 54f93e2 - #26858: Wrong gallery behavior when query url param configurable product (reported by @sergiy-v) has been fixed in #26560 by @sergiy-v in 2.4-develop branch Related commits: 1. 54f93e2 - #26683: Unable to execute addSimpleProduct mutation while other items out of stock (reported by @logaretm) has been fixed in #27015 by @AleksLi in 2.4-develop branch Related commits: 1. 77fee57 2. 0a79989 3. af251eb 4. c47a6a2 5. 39ade1f 6. 2d87219 7. 158f788 8. fff5ce9 - #22251: Admin Order - Email is Now Required - Magento 2.2.6 (reported by @trucatchtraps) has been fixed in #24479 by @solwininfotech in 2.4-develop branch Related commits: 1. 2ac0fe3 2. d78361e 3. 078bd69 4. 7e5bb80 5. b5265e8 6. 3c1d73e 7. 339c4c2 8. 49f9277 9. 0627db9 10. 1e9e940 11. 6dcdd8a 12. 0e392e7 13. d4bcc7f 14. 4e4e6a2 15. 7da3d53 16. 82ed876 17. 5851126 18. 7772d52 19. 6915dc8 20. 65ae5b0 21. 93fc0ee 22. 225ba00 23. d5997ce 24. 781684a 25. fbe87ab 26. 93d698a 27. f4692b2 28. 3e8369e 29. 183b315 30. 6d906ab 31. 6fe2ab2 32. dfe0392 33. ab86799 34. 74cfd18 35. 505549b 36. 168a006 37. b1b3e6c 38. ca32574 39. 531e1b5 40. 864f396
2 parents 55f3961 + d0265bf commit 5112f27

File tree

55 files changed

+1465
-63
lines changed

Some content is hidden

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

55 files changed

+1465
-63
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="AdminNavigateToPersistentShoppingCartSettingsActionGroup">
12+
<amOnPage url="{{AdminConfigurationPersistentShoppingCartPage.url}}" stepKey="navigateToPersistencePage"/>
13+
<conditionalClick selector="{{AdminPersistentShoppingCartSection.DefaultLayoutsTab}}" dependentSelector="{{AdminPersistentShoppingCartSection.CheckIfTabExpand}}" visible="true" stepKey="clickTab"/>
14+
</actionGroup>
15+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="AssertAdminPersistentShoppingCartOptionsAvailableActionGroup">
12+
<seeElement stepKey="seeLifetimeInput" selector="{{AdminPersistentShoppingCartSection.persistenceLifeTime}}"/>
13+
<seeElement stepKey="seeRememberMeEnableInput" selector="{{AdminPersistentShoppingCartSection.rememberMeEnable}}"/>
14+
<seeElement stepKey="seeRememberMeDefaultInput" selector="{{AdminPersistentShoppingCartSection.rememberMeDefault}}"/>
15+
<seeElement stepKey="seeClearPersistence" selector="{{AdminPersistentShoppingCartSection.clearPersistenceOnLogout}}"/>
16+
<seeElement stepKey="seePersistShoppingCart" selector="{{AdminPersistentShoppingCartSection.persistShoppingCart}}"/>
17+
</actionGroup>
18+
</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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminConfigurationPersistentShoppingCartPage" url="admin/system_config/edit/section/persistent/" module="Customers" area="admin">
12+
<section name="AdminPersistentShoppingCartSection"/>
13+
</page>
14+
</pages>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminLoginFailedTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Login on the Admin Login page"/>
15+
<title value="Admin should not be able to log into the backend with invalid credentials"/>
16+
<description value="Admin should not be able to log into the backend with invalid credentials"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-71572"/>
19+
<group value="example"/>
20+
<group value="login"/>
21+
</annotations>
22+
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin">
24+
<argument name="password" value="INVALID!{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/>
25+
</actionGroup>
26+
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="assertErrorMessage"/>
27+
</test>
28+
</tests>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminLoginSuccessfulTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Login on the Admin Login page"/>
15+
<title value="Admin should be able to log into the Magento Admin backend successfully"/>
16+
<description value="Admin should be able to log into the Magento Admin backend successfully"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-71572"/>
19+
<group value="example"/>
20+
<group value="login"/>
21+
</annotations>
22+
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="assertLoggedIn"/>
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
26+
</test>
27+
</tests>

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="AdminLoginTest">
11+
<test name="AdminLoginTest" deprecated="Replaced with AdminLoginSuccessfulTest">
1212
<annotations>
1313
<features value="Backend"/>
1414
<stories value="Login on the Admin Login page"/>
@@ -20,7 +20,7 @@
2020
<group value="login"/>
2121
</annotations>
2222

23-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2424
<seeInCurrentUrl url="{{AdminLoginPage.url}}" stepKey="seeAdminLoginUrl"/>
2525
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
2626
</test>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminPersistentShoppingCartSettingsTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Enable Persistent Shopping cart"/>
15+
<title value="Admin should be able to manage persistent shopping cart settings"/>
16+
<description value="Admin should be able to enable persistent shopping cart in Magento Admin backend and see additional options"/>
17+
<group value="backend"/>
18+
</annotations>
19+
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
<magentoCLI stepKey="enablePersistentShoppingCart" command="config:set persistent/options/enabled 1"/>
23+
<magentoCLI stepKey="cacheClean" command="cache:clean config"/>
24+
</before>
25+
<after>
26+
<magentoCLI stepKey="disablePersistentShoppingCart" command="config:set persistent/options/enabled 0"/>
27+
<magentoCLI stepKey="cacheClean" command="cache:clean config"/>
28+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
29+
</after>
30+
31+
<actionGroup ref="AdminNavigateToPersistentShoppingCartSettingsActionGroup" stepKey="navigateToPersistenceSettings"/>
32+
<actionGroup ref="AssertAdminPersistentShoppingCartOptionsAvailableActionGroup" stepKey="assertOptions"/>
33+
</test>
34+
</tests>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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\Model\Config;
9+
10+
use Magento\Framework\App\Config\ScopeConfigInterface;
11+
use Magento\Framework\Exception\NoSuchEntityException;
12+
use Magento\Store\Model\ScopeInterface;
13+
use Magento\Store\Model\StoreManagerInterface;
14+
15+
/**
16+
* Config for category in the layered navigation
17+
*/
18+
class LayerCategoryConfig
19+
{
20+
private const XML_PATH_CATALOG_LAYERED_NAVIGATION_DISPLAY_CATEGORY = 'catalog/layered_navigation/display_category';
21+
22+
/**
23+
* @var ScopeConfigInterface
24+
*/
25+
private $scopeConfig;
26+
27+
/**
28+
* @var StoreManagerInterface
29+
*/
30+
private $storeManager;
31+
32+
/**
33+
* LayerCategoryConfig constructor
34+
*
35+
* @param ScopeConfigInterface $scopeConfig
36+
* @param StoreManagerInterface $storeManager
37+
*/
38+
public function __construct(
39+
ScopeConfigInterface $scopeConfig,
40+
StoreManagerInterface $storeManager
41+
) {
42+
$this->scopeConfig = $scopeConfig;
43+
$this->storeManager = $storeManager;
44+
}
45+
46+
/**
47+
* Check if category filter item should be added in the layered navigation
48+
*
49+
* @param string $scopeType
50+
* @param null|int|string $scopeCode
51+
*
52+
* @return bool
53+
*/
54+
public function isCategoryFilterVisibleInLayerNavigation(
55+
$scopeType = ScopeInterface::SCOPE_STORES,
56+
$scopeCode = null
57+
): bool {
58+
if (!$scopeCode) {
59+
$scopeCode = $this->getStoreId();
60+
}
61+
62+
return $this->scopeConfig->isSetFlag(
63+
static::XML_PATH_CATALOG_LAYERED_NAVIGATION_DISPLAY_CATEGORY,
64+
$scopeType,
65+
$scopeCode
66+
);
67+
}
68+
69+
/**
70+
* Get the current store ID
71+
*
72+
* @return int
73+
*
74+
* @throws NoSuchEntityException
75+
*/
76+
private function getStoreId(): int
77+
{
78+
return (int) $this->storeManager->getStore()->getId();
79+
}
80+
}

app/code/Magento/Catalog/Model/Layer/FilterList.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
namespace Magento\Catalog\Model\Layer;
99

10+
use Magento\Catalog\Model\Config\LayerCategoryConfig;
11+
use Magento\Framework\App\ObjectManager;
12+
1013
/**
1114
* Layer navigation filters
1215
*/
@@ -44,18 +47,26 @@ class FilterList
4447
*/
4548
protected $filters = [];
4649

50+
/**
51+
* @var LayerCategoryConfig
52+
*/
53+
private $layerCategoryConfig;
54+
4755
/**
4856
* @param \Magento\Framework\ObjectManagerInterface $objectManager
4957
* @param FilterableAttributeListInterface $filterableAttributes
58+
* @param LayerCategoryConfig $layerCategoryConfig
5059
* @param array $filters
5160
*/
5261
public function __construct(
5362
\Magento\Framework\ObjectManagerInterface $objectManager,
5463
FilterableAttributeListInterface $filterableAttributes,
64+
LayerCategoryConfig $layerCategoryConfig,
5565
array $filters = []
5666
) {
5767
$this->objectManager = $objectManager;
5868
$this->filterableAttributes = $filterableAttributes;
69+
$this->layerCategoryConfig = $layerCategoryConfig;
5970

6071
/** Override default filter type models */
6172
$this->filterTypes = array_merge($this->filterTypes, $filters);
@@ -70,9 +81,11 @@ public function __construct(
7081
public function getFilters(\Magento\Catalog\Model\Layer $layer)
7182
{
7283
if (!count($this->filters)) {
73-
$this->filters = [
74-
$this->objectManager->create($this->filterTypes[self::CATEGORY_FILTER], ['layer' => $layer]),
75-
];
84+
if ($this->layerCategoryConfig->isCategoryFilterVisibleInLayerNavigation()) {
85+
$this->filters = [
86+
$this->objectManager->create($this->filterTypes[self::CATEGORY_FILTER], ['layer' => $layer]),
87+
];
88+
}
7689
foreach ($this->filterableAttributes->getList() as $attribute) {
7790
$this->filters[] = $this->createAttributeFilter($attribute, $layer);
7891
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AdminAssignImageBaseRoleActionGroup">
12+
<annotations>
13+
<description>Requires the navigation to the Product Creation page. Checks the Base Role area for image.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="image"/>
17+
</arguments>
18+
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageFile(image.fileName)}}" visible="false" stepKey="expandImages"/>
19+
<waitForElementVisible selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="seeProductImageName"/>
20+
<click selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="clickProductImage"/>
21+
<waitForElementVisible selector="{{AdminProductImagesSection.altText}}" stepKey="seeAltTextSection"/>
22+
<checkOption selector="{{AdminProductImagesSection.roleBase}}" stepKey="checkRoles"/>
23+
<click selector="{{AdminSlideOutDialogSection.closeButton}}" stepKey="clickCloseButton"/>
24+
</actionGroup>
25+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<!-- On a category page with layered navigation, verify if the category filter item is NOT present -->
10+
<actionGroup name="AssertStorefrontLayeredNavigationCategoryFilterNotVisibleActionGroup">
11+
<!-- Verify category filter item is NOT present -->
12+
<dontSee selector="{{StorefrontCategorySidebarSection.layeredFilterBlock}}" userInput="Category" stepKey="seeCategoryFilterInLayeredNav"/>
13+
</actionGroup>
14+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<!-- On a category page with layered navigation, verify if the category filter item is present -->
10+
<actionGroup name="AssertStorefrontLayeredNavigationCategoryFilterVisibleActionGroup">
11+
<!-- Verify category filter item is present -->
12+
<see selector="{{StorefrontCategorySidebarSection.layeredFilterBlock}}" userInput="Category" stepKey="seeCategoryFilterInLayeredNav"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="EnableCategoryFilterOnCategoryPageConfigData">
12+
<data key="path">catalog/layered_navigation/display_category</data>
13+
<data key="value">1</data>
14+
</entity>
15+
<entity name="DisableCategoryFilterOnCategoryPageConfigData">
16+
<data key="path">catalog/layered_navigation/display_category</data>
17+
<data key="value">0</data>
18+
</entity>
19+
</entities>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,14 @@
880880
<data key="weight">5</data>
881881
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
882882
</entity>
883+
<entity name="Magento2" type="image">
884+
<data key="title" unique="suffix">Magento2</data>
885+
<data key="file_type">Upload File</data>
886+
<data key="shareable">Yes</data>
887+
<data key="file">magento2.jpg</data>
888+
<data key="filename">magento2</data>
889+
<data key="file_extension">jpg</data>
890+
</entity>
883891
<entity name="Magento3" type="image">
884892
<data key="title" unique="suffix">Magento3</data>
885893
<data key="price">1.00</data>

0 commit comments

Comments
 (0)