Skip to content

Commit

Permalink
Merge branch '2.4-develop' into assert-discount
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Idolov authored Dec 23, 2020
2 parents 57011bd + fadbf69 commit a231737
Show file tree
Hide file tree
Showing 392 changed files with 8,106 additions and 1,403 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ private function fetchTierPrices(array $productIds): array
)
->where(
'ap.' . $productEntityLinkField . ' IN (?)',
$productIds
$productIds,
\Zend_Db::INT_TYPE
);

if ($priceFromFilter !== null) {
Expand Down
8 changes: 7 additions & 1 deletion app/code/Magento/Backend/App/Area/FrontNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ public function isHostBackend()
if ($this->scopeConfig->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE)) {
$backendUrl = $this->scopeConfig->getValue(self::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE);
} else {
$backendUrl = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE);
$backendUrl = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_URL);
if ($backendUrl === null) {
$backendUrl = $this->scopeConfig->getValue(
Store::XML_PATH_UNSECURE_BASE_URL,
ScopeInterface::SCOPE_STORE
);
}
}
$host = $this->request->getServer('HTTP_HOST', '');
return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false;
Expand Down
5 changes: 4 additions & 1 deletion app/code/Magento/Backend/Block/Widget/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
namespace Magento\Backend\Block\Widget;

use Magento\Backend\Block\Template\Context;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Math\Random;
use Magento\Backend\Block\Template\Context;
use Magento\Framework\View\Helper\SecureHtmlRenderer;

/**
Expand Down Expand Up @@ -125,6 +125,9 @@ protected function _prepareAttributes($title, $classes, $disabled)
'value' => $this->getValue(),
'disabled' => $disabled,
];
if ($this->hasData('onclick_attribute')) {
$attributes['onclick'] = $this->getData('onclick_attribute');
}
if ($this->hasData('backend_button_widget_hook_id')) {
$attributes['backend-button-widget-hook-id'] = $this->getData('backend_button_widget_hook_id');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertLinkActionGroup">
<annotations>
<description>Assert text and url of the links.</description>
</annotations>
<arguments>
<argument name="text" type="string"/>
<argument name="url" type="string"/>
</arguments>

<seeLink userInput="{{text}}" url="{{url}}" stepKey="assertLinks"/>
</actionGroup>
</actionGroups>
59 changes: 40 additions & 19 deletions app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,70 +23,91 @@
<!-- Logging in Magento admin and checking for Privacy policy footer in dashboard -->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<closeAdminNotification stepKey="closeAdminNotification"/>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkDashboard"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkDashboard">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in salesOrderPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSalesOrder">
<argument name="menuUiId" value="magento-sales-sales"/>
<argument name="submenuUiId" value="magento-sales-sales-order"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSalesOrder"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSalesOrder">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in catalogProductsPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCatalogProducts">
<argument name="menuUiId" value="magento-catalog-catalog"/>
<argument name="submenuUiId" value="magento-catalog-catalog-products"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCatalogProducts"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCatalogProducts">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in customersAllCustomersPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCustomersAllCustomers">
<argument name="menuUiId" value="magento-customer-customer"/>
<argument name="submenuUiId" value="magento-customer-customer-manage"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCustomersAllCustomers"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCustomersAllCustomers">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in marketingCatalogPriceRulePage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToMarketingCatalogPriceRule">
<argument name="menuUiId" value="magento-backend-marketing"/>
<argument name="submenuUiId" value="magento-catalogrule-promo-catalog"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in contentBlocksPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentBlocks">
<argument name="menuUiId" value="magento-backend-content"/>
<argument name="submenuUiId" value="magento-cms-cms-block"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkContentBlocks"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkContentBlocks">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in reportSearcbTermsPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsSearchTerms">
<argument name="menuUiId" value="magento-reports-report"/>
<argument name="submenuUiId" value="magento-search-report-search-term"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkReportsSearchTerms"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkReportsSearchTerms">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in storesAllStoresPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToStoresAllStores">
<argument name="menuUiId" value="magento-backend-stores"/>
<argument name="submenuUiId" value="magento-backend-system-store"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkStoresAllStores"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkStoresAllStores">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in systemImportPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSystemImport">
<argument name="menuUiId" value="magento-backend-system"/>
<argument name="submenuUiId" value="magento-importexport-system-convert-import"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSystemImport"/>

<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSystemImport">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
<!-- Checking for Privacy policy footer in findPartnersAndExtensionsPage -->
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToFindPartnersAndExtensions">
<argument name="menuUiId" value="magento-marketplace-partners"/>
<argument name="submenuUiId" value="magento-marketplace-partners"/>
</actionGroup>
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions"/>
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions">
<argument name="text" value="Privacy Policy"/>
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
</actionGroup>
</test>
</tests>

Expand Down
12 changes: 12 additions & 0 deletions app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,16 @@ public function getAttributesHtmlDataProvider()
]
];
}

/**
* Verifies ability of adding button onclick attribute
*
* @return void
*/
public function testOnClickAttribute(): void
{
$this->_blockMock->setData(['onclick_attribute' => 'value']);
$attributes = $this->_blockMock->getAttributesHtml();
$this->assertStringContainsString('onclick', $attributes);
}
}
3 changes: 2 additions & 1 deletion app/code/Magento/Bundle/Model/ResourceModel/Selection.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ public function getParentIdsByChild($childId)
['e.entity_id as parent_product_id']
)->where(
$this->getMainTable() . '.product_id IN(?)',
$childId
$childId,
\Zend_Db::INT_TYPE
);

return $connection->fetchCol($select);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>

<!-- Reindex -->
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
<argument name="indices" value=""/>
</actionGroup>
<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/>

<!-- Login as admin -->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@
<!-- Switch from default attribute set to new attribute set -->
<amOnPage url="{{AdminProductCreatePage.url('4', 'bundle')}}" stepKey="goToNewProductPage"/>
<waitForPageLoad stepKey="wait2"/>
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="searchForAttrSet"/>
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/>

<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
<argument name="attributeSet" value="{{ProductAttributeFrontendLabel.label}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>

<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/>

Expand All @@ -64,9 +68,11 @@
<click selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="clickAttributeSet2"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>

<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet2"/>
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{BundleProduct.defaultAttribute}}" stepKey="searchForAttrSet2"/>
<click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet2"/>
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet2">
<argument name="attributeSet" value="{{BundleProduct.defaultAttribute}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet2"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet2"/>

<!--save the product/published by default-->
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@
<checkOption selector="{{AdminProductFormBundleSection.enableDisableToggle}}" stepKey="clickOnEnableDisableToggleAgain"/>

<!--Apply Attribute Set-->
<click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/>
<fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{ProductAttributeFrontendLabelTwo.label}}" stepKey="searchForAttrSet"/>
<click selector="{{AdminProductFormSection.attributeSetFilterResultByName(ProductAttributeFrontendLabelTwo.label)}}" stepKey="selectAttrSet"/>
<actionGroup ref="AdminSelectAttributeSetOnEditProductPageActionGroup" stepKey="startEditAttrSet">
<argument name="attributeSet" value="{{ProductAttributeFrontendLabelTwo.label}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="searchForAttrSet"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectAttrSet"/>

<!--Product name and SKU-->
<fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name2}}" stepKey="fillProductName"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>
<!-- TODO: Remove this action when MC-37719 will be fixed -->
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices">
<argument name="indices" value="cataloginventory_stock"/>
</actionGroup>
<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexInvalidatedIndices"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@
<click selector="{{AdminProductFiltersSection.enable}}" stepKey="ClickOnEnable"/>

<!--Clear Cache - reindex - resets products according to enabled/disabled view-->
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
<argument name="indices" value=""/>
</actionGroup>
<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/>
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<requiredEntity createDataKey="apiSimple"/>
</createData>
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
<argument name="indices" value=""/>
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
</actionGroup>
</before>
<after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
<argument name="productId" value="$createFixedBundleProduct.id$"/>
</actionGroup>
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
<!--Perform reindex and flush cache-->
<actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/>
<comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/>
</before>
<after>
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProductForBundleItem"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
<requiredEntity createDataKey="fixedBundleOption"/>
<requiredEntity createDataKey="createSimpleProductTwo"/>
</createData>

<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
<argument name="indices" value=""/>
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
</actionGroup>
</before>
<after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

<!-- Perform CLI reindex -->
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
<argument name="indices" value=""/>
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
</actionGroup>
</before>
<after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<see userInput="You saved the configuration." selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccess"/>

<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
<argument name="indices" value=""/>
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
</actionGroup>
</before>
<after>
Expand Down
Loading

0 comments on commit a231737

Please sign in to comment.