-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5858 from magento-tsg-csl3/2.4-develop-pr33
[TSG-CSL3] For 2.4|2.4|1.2 (pr33)
- Loading branch information
Showing
16 changed files
with
552 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeGroupTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminChangeProductAttributeGroupTest"> | ||
<annotations> | ||
<title value="Preserving attribute value after attribute group is changed"/> | ||
<description value="Attribute value should be preserved after changing attribute group"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-35612"/> | ||
<useCaseId value="MC-31892"/> | ||
<group value="catalog"/> | ||
</annotations> | ||
<before> | ||
<createData entity="SimpleSubCategory" stepKey="createCategory"/> | ||
<createData entity="_defaultProduct" stepKey="createSimpleProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
|
||
<createData entity="productAttributeText" stepKey="createProductAttribute"/> | ||
<createData entity="CatalogAttributeSet" stepKey="createAttributeSet"/> | ||
<createData entity="CatalogAttributeSet" stepKey="createSecondAttributeSet"/> | ||
|
||
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/> | ||
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createAttributeSet.attribute_set_id$/" | ||
stepKey="onAttributeSetEdit"/> | ||
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> | ||
<argument name="group" value="Product Details"/> | ||
<argument name="attribute" value="$createProductAttribute.attribute_code$"/> | ||
</actionGroup> | ||
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> | ||
<amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$createSecondAttributeSet.attribute_set_id$/" | ||
stepKey="onSecondAttributeSetEdit"/> | ||
<actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToContentGroup"> | ||
<argument name="group" value="Content"/> | ||
<argument name="attribute" value="$createProductAttribute.attribute_code$"/> | ||
</actionGroup> | ||
<actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveSecondAttributeSet"/> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> | ||
<deleteData createDataKey="createAttributeSet" stepKey="deleteAttributeSet"/> | ||
<deleteData createDataKey="createSecondAttributeSet" stepKey="deleteSecondAttributeSet"/> | ||
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/> | ||
|
||
<!-- Reindex invalidated indices after product attribute has been created/deleted --> | ||
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
</after> | ||
|
||
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> | ||
<argument name="product" value="$createSimpleProduct$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1"> | ||
<argument name="product" value="$createSimpleProduct$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet"> | ||
<argument name="attributeSetName" value="$createAttributeSet.attribute_set_name$"/> | ||
</actionGroup> | ||
<waitForText userInput="$createProductAttribute.default_frontend_label$" stepKey="seeAttributeInForm"/> | ||
<fillField selector="{{AdminProductFormSection.attributeRequiredInput($createProductAttribute.attribute_code$)}}" | ||
userInput="test" | ||
stepKey="fillProductAttributeValue"/> | ||
<actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectSecondAttributeSet"> | ||
<argument name="attributeSetName" value="$createSecondAttributeSet.attribute_set_name$"/> | ||
</actionGroup> | ||
<actionGroup ref="ExpandAdminProductSectionActionGroup" stepKey="expandContentSection"/> | ||
<waitForText userInput="$createProductAttribute.default_frontend_label$" stepKey="seeAttributeInSection"/> | ||
<grabValueFrom selector="{{AdminProductContentSection.attributeInput($createProductAttribute.attribute_code$)}}" | ||
stepKey="attributeValue"/> | ||
<assertEquals stepKey="assertAttributeValue"> | ||
<expectedResult type="string">test</expectedResult> | ||
<actualResult type="variable">attributeValue</actualResult> | ||
</assertEquals> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Search\ViewModel; | ||
|
||
use Magento\Framework\App\Config\ScopeConfigInterface; | ||
use Magento\Framework\View\Element\Block\ArgumentInterface; | ||
use Magento\Store\Model\ScopeInterface; | ||
|
||
/** | ||
* View model for search | ||
*/ | ||
class ConfigProvider implements ArgumentInterface | ||
{ | ||
/** | ||
* Suggestions settings config paths | ||
*/ | ||
private const SEARCH_SUGGESTION_ENABLED = 'catalog/search/search_suggestion_enabled'; | ||
|
||
/** | ||
* @var ScopeConfigInterface | ||
*/ | ||
private $scopeConfig; | ||
|
||
/** | ||
* @param ScopeConfigInterface $scopeConfig | ||
*/ | ||
public function __construct( | ||
ScopeConfigInterface $scopeConfig | ||
) { | ||
$this->scopeConfig = $scopeConfig; | ||
} | ||
|
||
/** | ||
* Is Search Suggestions Allowed | ||
* | ||
* @return bool | ||
*/ | ||
public function isSuggestionsAllowed(): bool | ||
{ | ||
return $this->scopeConfig->isSetFlag( | ||
self::SEARCH_SUGGESTION_ENABLED, | ||
ScopeInterface::SCOPE_STORE | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.