Skip to content

Commit 485081a

Browse files
authored
Merge branch '2.4-develop' into mftf/bundle-cache-tests
2 parents 820074d + ac3eb00 commit 485081a

File tree

97 files changed

+3292
-730
lines changed

Some content is hidden

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

97 files changed

+3292
-730
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/Indexer/Product/Flat/Action/Eraser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ public function removeDisabledProducts(array &$ids, $storeId)
9999
['status_global_attr' => $statusAttribute->getBackendTable()],
100100
' status_global_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId()
101101
. ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID
102-
. ' AND status_global_attr.' . $statusAttribute->getEntityIdField() . '='
102+
. ' AND status_global_attr.' . $metadata->getLinkField() . '='
103103
. 'product_table.' . $metadata->getLinkField(),
104104
[]
105105
);
106106
$select->joinLeft(
107107
['status_attr' => $statusAttribute->getBackendTable()],
108108
' status_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId()
109109
. ' AND status_attr.store_id = ' . $storeId
110-
. ' AND status_attr.' . $statusAttribute->getEntityIdField() . '='
110+
. ' AND status_attr.' . $metadata->getLinkField() . '='
111111
. 'product_table.' . $metadata->getLinkField(),
112112
[]
113113
);

app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Rows.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
*/
66
namespace Magento\Catalog\Model\Indexer\Product\Flat\Action;
77

8+
use Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction;
89
use Magento\Catalog\Model\Indexer\Product\Flat\FlatTableBuilder;
910
use Magento\Catalog\Model\Indexer\Product\Flat\TableBuilder;
1011

1112
/**
1213
* Class Rows reindex action for mass actions
13-
*
1414
*/
15-
class Rows extends \Magento\Catalog\Model\Indexer\Product\Flat\AbstractAction
15+
class Rows extends AbstractAction
1616
{
1717
/**
1818
* @var Eraser
@@ -67,6 +67,7 @@ public function execute($ids)
6767
foreach ($idsBatches as $changedIds) {
6868
if ($tableExists) {
6969
$this->flatItemEraser->removeDeletedProducts($changedIds, $store->getId());
70+
$this->flatItemEraser->removeDisabledProducts($changedIds, $store->getId());
7071
}
7172
if (!empty($changedIds)) {
7273
$this->_reindex($store->getId(), $changedIds);

0 commit comments

Comments
 (0)