Skip to content

Commit

Permalink
Merge branch '2.4-develop' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
marcostrama authored Sep 21, 2020
2 parents c336ccc + 390505a commit 2f94846
Show file tree
Hide file tree
Showing 154 changed files with 2,697 additions and 460 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<!-- Reset admin order filter -->
<comment userInput="Reset admin order filter" stepKey="resetAdminOrderFilter"/>
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingOrderGrid"/>
<magentoCLI command="config:set admin/dashboard/enable_charts 0" stepKey="setDisableChartsAsDefault"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
Expand Down Expand Up @@ -84,8 +83,7 @@
<comment userInput="Create invoice" stepKey="createInvoice"/>

<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/>
<waitForPageLoad stepKey="waitForInvoicePageToLoad"/>
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="$150.00" stepKey="seeCorrectGrandTotal"/>
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
<argument name="tags" value="config"/>
</actionGroup>
<magentoCLI command="setup:static-content:deploy -f" stepKey="deployStaticContent"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<magentoCLI command="config:set {{MinifyJavaScriptFilesDisableConfigData.path}} {{MinifyJavaScriptFilesDisableConfigData.value}}" stepKey="disableJsMinification"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
<waitForPageLoad stepKey="waitForPageLoadOnDashboard"/>
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,52 @@
* See COPYING.txt for license details.
*/

/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
use Magento\Framework\Escaper;
use Magento\Framework\View\Helper\SecureHtmlRenderer;

/**
* @var SecureHtmlRenderer $secureRenderer
* @var Escaper $escaper
*/
?>
<!-- <?php if ($block->getTitle()): ?>
<h3><?= $block->escapeHtml($block->getTitle()) ?></h3>
<?php endif ?> -->
<?php if (!empty($tabs)): ?>
<div id="<?= $block->escapeHtmlAttr($block->getId()) ?>">
<?php $blockId = $block->getId() ?>
<div id="<?= $escaper->escapeHtmlAttr($blockId) ?>" class="hidden">
<ul class="tabs-horiz">
<?php foreach ($tabs as $_tab): ?>
<?php $tabId = $block->getTabId($_tab) ?>
<?php $_tabClass = 'tab-item-link ' . $block->getTabClass($_tab) . ' ' .
(preg_match('/\s?ajax\s?/', $_tab->getClass()) ? 'notloaded' : '') ?>
<?php $_tabType = (!preg_match('/\s?ajax\s?/', $_tabClass) && $block->getTabUrl($_tab) != '#') ? 'link' : '' ?>
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ?
'#' . $block->getTabId($_tab) . '_content' :
'#' . $tabId . '_content' :
$block->getTabUrl($_tab) ?>
<li>
<a href="<?= $block->escapeUrl($_tabHref) ?>"
id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>"
title="<?= $block->escapeHtmlAttr($block->getTabTitle($_tab)) ?>"
class="<?= $block->escapeHtmlAttr($_tabClass) ?>"
data-tab-type="<?= $block->escapeHtmlAttr($_tabType) ?>">
<a href="<?= $escaper->escapeUrl($_tabHref) ?>"
id="<?= $escaper->escapeHtmlAttr($tabId) ?>"
title="<?= $escaper->escapeHtmlAttr($block->getTabTitle($_tab)) ?>"
class="<?= $escaper->escapeHtmlAttr($_tabClass) ?>"
data-tab-type="<?= $escaper->escapeHtmlAttr($_tabType) ?>">
<span>
<span class="changed"
title="<?= $block->escapeHtmlAttr(__('The information in this tab has been changed.')) ?>"></span>
title="<?= $escaper->escapeHtmlAttr(__(
'The information in this tab has been changed.'
)) ?>"></span>
<span class="error"
title="<?= $block->escapeHtmlAttr(__(
title="<?= $escaper->escapeHtmlAttr(__(
'This tab contains invalid data. Please resolve this before saving.'
)) ?>"></span>
<span class="loader"
title="<?= $block->escapeHtmlAttr(__('Loading...')) ?>"></span>
<?= $block->escapeHtml($block->getTabLabel($_tab)) ?>
title="<?= $escaper->escapeHtmlAttr(__('Loading...')) ?>"></span>
<?= $escaper->escapeHtml($block->getTabLabel($_tab)) ?>
</span>
</a>
<div id="<?= $block->escapeHtmlAttr($block->getTabId($_tab)) ?>_content">
<div id="<?= $escaper->escapeHtmlAttr($tabId) ?>_content">
<?= /* @noEscape */ $block->getTabContent($_tab) ?>
</div>
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
'display:none',
'#' . $block->escapeJs($block->getTabId($_tab)) . '_content'
'#' . $escaper->escapeJs($tabId) . '_content'
); ?>
</li>
<?php endforeach; ?>
Expand All @@ -51,11 +58,12 @@
<?php $scriptString = <<<script
require(["jquery","mage/backend/tabs"], function($){
$(function() {
$('#{$block->getId()}').tabs({
active: '{$block->getActiveTabId()}',
destination: '#{$block->getDestElementId()}',
$('#{$escaper->escapeJs($blockId)}').tabs({
active: '{$escaper->escapeJs($block->getActiveTabId())}',
destination: '#{$escaper->escapeJs($block->getDestElementId())}',
shadowTabs: {$block->getAllShadowTabs()}
});
$('#{$escaper->escapeJs($blockId)}').removeClass('hidden');
});
});
script;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@

<!--Add another bundle option with 2 items-->
<!--Go to bundle product creation page-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
<waitForPageLoad stepKey="WaitForClear"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@

<!--Testing that price appears correctly in admin catalog-->
<!--Set filter to product name-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand All @@ -75,8 +74,7 @@

<!--Testing that price appears correctly in admin catalog-->
<!--Set filter to product name-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage2"/>
<waitForPageLoad stepKey="WaitForPageToLoad2"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage2"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName2">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@
</actionGroup>

<!--Filter catalog-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>

<!--Go to catalog deletion page-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogPage"/>
<waitForPageLoad stepKey="Loading"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogPage"/>

<!--Apply Name Filter-->
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?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="AdminDeleteBundleDynamicPriceProductTest">
<annotations>
<features value="Bundle"/>
<stories value="Delete products"/>
<title value="Delete Bundle Dynamic Product"/>
<description value="Admin should be able to delete a bundle dynamic product"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-26056"/>
<group value="mtf_migrated"/>
<group value="bundle"/>
</annotations>
<before>
<!-- Create category and simple product -->
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>

<!-- Create bundle product -->
<createData entity="ApiBundleProductPriceViewRange" stepKey="createDynamicBundleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="DropDownBundleOption" stepKey="bundleOption">
<requiredEntity createDataKey="createDynamicBundleProduct"/>
</createData>
<createData entity="ApiBundleLink" stepKey="createNewBundleLink">
<requiredEntity createDataKey="createDynamicBundleProduct"/>
<requiredEntity createDataKey="bundleOption"/>
<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>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProductBySku">
<argument name="sku" value="$createDynamicBundleProduct.sku$"/>
</actionGroup>
<!-- Verify product on Product Page -->
<amOnPage url="{{StorefrontProductPage.url($createDynamicBundleProduct.custom_attributes[url_key]$)}}" stepKey="openBundleProductPage"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoopsMessage"/>
<!-- Search for the product by sku -->
<actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchBySku">
<argument name="query" value="$createDynamicBundleProduct.sku$"/>
</actionGroup>
<!-- Should not see bundle product -->
<dontSee userInput="$createDynamicBundleProduct.sku$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/>
<amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="openCategoryPage"/>
<!-- Should not see any products in category -->
<dontSee userInput="$createDynamicBundleProduct.name$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/>
<see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminDeleteBundleDynamicProductTest">
<test name="AdminDeleteBundleDynamicProductTest" deprecated="Use AdminDeleteBundleDynamicPriceProductTest instead">
<annotations>
<features value="Bundle"/>
<stories value="Delete products"/>
<title value="Delete Bundle Dynamic Product"/>
<description value="Admin should be able to delete a bundle dynamic product"/>
<title value="Deprecated. Delete Bundle Dynamic Product"/>
<description value="Deprecated. Admin should be able to delete a bundle dynamic product"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-11016"/>
<group value="mtf_migrated"/>
<skip>
<issueId value="MC-16393"/>
<issueId value="DEPRECATED">Use AdminDeleteBundleDynamicPriceProductTest instead</issueId>
</skip>
</annotations>
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@

<!--Testing that price appears correctly in admin catalog-->
<!--Set filter to product name-->
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
<waitForPageLoad stepKey="WaitForClear"/>
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
</after>
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
<!--Selecting new bundle product-->
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
Expand Down
8 changes: 6 additions & 2 deletions app/code/Magento/Catalog/Model/ProductRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
use Magento\Framework\Exception\ValidatorException;

/**
* Product Repository.
* @inheritdoc
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.TooManyFields)
*/
Expand Down Expand Up @@ -543,7 +544,9 @@ public function save(ProductInterface $product, $saveOptions = false)
if (!$ignoreLinksFlag && $ignoreLinksFlag !== null) {
$productLinks = $product->getProductLinks();
}
$productDataArray['store_id'] = (int)$this->storeManager->getStore()->getId();
if (!isset($productDataArray['store_id'])) {
$productDataArray['store_id'] = (int) $this->storeManager->getStore()->getId();
}
$product = $this->initializeProductData($productDataArray, empty($existingProduct));

$this->processLinks($product, $productLinks);
Expand Down Expand Up @@ -735,6 +738,7 @@ private function getCollectionProcessor()
{
if (!$this->collectionProcessor) {
$this->collectionProcessor = \Magento\Framework\App\ObjectManager::getInstance()->get(
// phpstan:ignore "Class Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor not found."
\Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor::class
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenAttributeSetGridPageActionGroup">
<annotations>
<description>Open the Attribute Sets grid page.</description>
</annotations>

<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="AdminOpenCatalogProductPageActionGroup">
<annotations>
<description>Open page with product grid.</description>
</annotations>

<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="openCatalogProductPage"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="GoToAttributeGridPageActionGroup">
<actionGroup name="GoToAttributeGridPageActionGroup" deprecated="Use AdminOpenAttributeSetGridPageActionGroup instead.">
<annotations>
<description>Goes to the Attribute Sets grid page.</description>
</annotations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="GoToProductCatalogPageActionGroup">
<actionGroup name="GoToProductCatalogPageActionGroup" deprecated="Use AdminOpenCatalogProductPageActionGroup instead.">
<annotations>
<description>Goes to the Admin Products grid page.</description>
</annotations>
Expand Down
Loading

0 comments on commit 2f94846

Please sign in to comment.