Skip to content

Commit

Permalink
Merge branch 2.3-develop into ENGCOM-3810-magento-magento2-20001
Browse files Browse the repository at this point in the history
  • Loading branch information
magento-engcom-team committed Mar 11, 2019
2 parents 1f9bf2b + 8f737c0 commit 8b66d61
Show file tree
Hide file tree
Showing 211 changed files with 6,212 additions and 277 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ protected function saveAndReplaceAdvancedPrices()
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
->processCountNewPrices($tierPrices);

$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
if ($listSku) {
$this->setUpdatedAt($listSku);
Expand Down Expand Up @@ -562,11 +563,14 @@ protected function processCountExistingPrices($prices, $table)

$tableName = $this->_resourceFactory->create()->getTable($table);
$productEntityLinkField = $this->getProductEntityLinkField();
$existingPrices = $this->_connection->fetchAssoc(
$existingPrices = $this->_connection->fetchAll(
$this->_connection->select()->from(
$tableName,
['value_id', $productEntityLinkField, 'all_groups', 'customer_group_id']
)->where($productEntityLinkField . ' IN (?)', $existProductIds)
[$productEntityLinkField, 'all_groups', 'customer_group_id', 'qty']
)->where(
$productEntityLinkField . ' IN (?)',
$existProductIds
)
);
foreach ($existingPrices as $existingPrice) {
foreach ($prices as $sku => $skuPrices) {
Expand All @@ -591,8 +595,10 @@ protected function incrementCounterUpdated($prices, $existingPrice)
foreach ($prices as $price) {
if ($existingPrice['all_groups'] == $price['all_groups']
&& $existingPrice['customer_group_id'] == $price['customer_group_id']
&& (int) $existingPrice['qty'] === (int) $price['qty']
) {
$this->countItemsUpdated++;
continue;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ public function testProcessCountExistingPrices(
);
$dbSelectMock = $this->createMock(\Magento\Framework\DB\Select::class);
$this->connection->expects($this->once())
->method('fetchAssoc')
->method('fetchAll')
->willReturn($existingPrices);
$this->connection->expects($this->once())
->method('select')
Expand All @@ -930,7 +930,7 @@ public function testProcessCountExistingPrices(
->method('from')
->with(
self::TABLE_NAME,
['value_id', self::LINK_FIELD, 'all_groups', 'customer_group_id']
[self::LINK_FIELD, 'all_groups', 'customer_group_id', 'qty']
)->willReturnSelf();
$this->advancedPricing->expects($this->once())
->method('retrieveOldSkus')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminAdvancedReportingSection">
<element name="goToAdvancedReporting" type="text" selector="//div[@class='dashboard-advanced-reports-actions']/a[@title='Go to Advanced Reporting']" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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="AdminAdvancedReportingButtonTest">
<annotations>
<stories value="AdvancedReporting"/>
<title value="AdvancedReportingButtonTest"/>
<description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/>
<testCaseId value="MC-14800"/>
<severity value="CRITICAL"/>
<group value="analytics"/>
<group value="mtf_migrated"/>
</annotations>

<before>
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Navigate through Advanced Reporting button on dashboard to Sign Up page-->
<amOnPage url="{{AdminDashboardPage.url}}" stepKey="amOnDashboardPage"/>
<waitForPageLoad stepKey="waitForDashboardPageLoad"/>
<click selector="{{AdminAdvancedReportingSection.goToAdvancedReporting}}" stepKey="clickGoToAdvancedReporting"/>
<switchToNextTab stepKey="switchToNewTab"/>
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<click selector="{{AdminGridTableSection.backupRowCheckbox(backup.name)}}" stepKey="selectBackupRow"/>
<selectOption selector="{{AdminGridActionSection.actionSelect}}" userInput="Delete" stepKey="selectDeleteAction"/>
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
<waitForPageLoad stepKey="waitForConfirmWindowToAppear"/>
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>
Expand Down
6 changes: 5 additions & 1 deletion app/code/Magento/Backup/Test/Mftf/Data/BackupData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
<data key="name" unique="suffix">databaseBackup</data>
<data key="type">Database</data>
</entity>
</entities>
<entity name="WebSetupWizardBackup" type="backup">
<data key="name">WebSetupWizard</data>
<data key="type">Database</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="VerifyProductTypeOrder">
<seeElement stepKey="seeBundleInOrder" selector="{{AdminProductDropdownOrderSection.bundleProduct}}"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductDropdownOrderSection">
<element name="bundleProduct" type="text" selector="//li[not(preceding-sibling::li[span[@title='Downloadable Product']]) and not(following-sibling::li[span[@title='Simple Product']]) and not(following-sibling::li[span[@title='Configurable Product']]) and not(following-sibling::li[span[@title='Grouped Product']]) and not(following-sibling::li[span[@title='Virtual Product']])]/span[@title='Bundle Product']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
<!-- Delete the bundled product we created in the test body -->
<actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct">
<argument name="sku" value="{{BundleProduct.sku}}"/>
</actionGroup>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!--Go to bundle product creation page-->
Expand Down
10 changes: 7 additions & 3 deletions app/code/Magento/Catalog/Api/ProductRenderListInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Catalog\Api;

/**
* Interface which provides product renders information for products
* Interface which provides product renders information for products.
*
* @api
* @since 101.1.0
*/
interface ProductRenderListInterface
{
/**
* Collect and retrieve the list of product render info
* This info contains raw prices and formated prices, product name, stock status, store_id, etc
* Collect and retrieve the list of product render info.
*
* This info contains raw prices and formatted prices, product name, stock status, store_id, etc.
*
* @see \Magento\Catalog\Api\Data\ProductRenderInfoDtoInterface
*
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
*
* @author Magento Core Team <[email protected]>
*/

namespace Magento\Catalog\Block\Product\View\Options;

use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface;

/**
* Product aoptions section abstract block.
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -46,7 +49,7 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
* @param \Magento\Catalog\Helper\Data $catalogData,
* @param \Magento\Catalog\Helper\Data $catalogData
* @param array $data
*/
public function __construct(
Expand Down Expand Up @@ -123,6 +126,8 @@ public function getFormattedPrice()
}

/**
* Retrieve formatted price.
*
* @return string
*
* @deprecated
Expand All @@ -134,7 +139,7 @@ public function getFormatedPrice()
}

/**
* Return formated price
* Return formatted price
*
* @param array $value
* @param bool $flag
Expand Down
30 changes: 28 additions & 2 deletions app/code/Magento/Catalog/Model/Category/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,40 @@ class Tree
*/
protected $treeFactory;

/**
* @var \Magento\Catalog\Model\ResourceModel\Category\TreeFactory
*/
private $treeResourceFactory;

/**
* @param \Magento\Catalog\Model\ResourceModel\Category\Tree $categoryTree
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection
* @param \Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory
* @param \Magento\Catalog\Model\ResourceModel\Category\TreeFactory|null $treeResourceFactory
*/
public function __construct(
\Magento\Catalog\Model\ResourceModel\Category\Tree $categoryTree,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection,
\Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory
\Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory,
\Magento\Catalog\Model\ResourceModel\Category\TreeFactory $treeResourceFactory = null
) {
$this->categoryTree = $categoryTree;
$this->storeManager = $storeManager;
$this->categoryCollection = $categoryCollection;
$this->treeFactory = $treeFactory;
$this->treeResourceFactory = $treeResourceFactory ?? \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Catalog\Model\ResourceModel\Category\TreeFactory::class);
}

/**
* Get root node by category.
*
* @param \Magento\Catalog\Model\Category|null $category
* @return Node|null
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function getRootNode($category = null)
{
Expand All @@ -71,21 +84,30 @@ public function getRootNode($category = null)
}

/**
* Get node by category.
*
* @param \Magento\Catalog\Model\Category $category
* @return Node
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function getNode(\Magento\Catalog\Model\Category $category)
{
$nodeId = $category->getId();
$node = $this->categoryTree->loadNode($nodeId);
$categoryTree = $this->treeResourceFactory->create();
$node = $categoryTree->loadNode($nodeId);
$node->loadChildren();
$this->prepareCollection();
$this->categoryTree->addCollectionData($this->categoryCollection);
return $node;
}

/**
* Prepare category collection.
*
* @return void
* @throws \Magento\Framework\Exception\LocalizedException
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
protected function prepareCollection()
{
Expand All @@ -104,6 +126,8 @@ protected function prepareCollection()
}

/**
* Get tree by node.
*
* @param \Magento\Framework\Data\Tree\Node $node
* @param int $depth
* @param int $currentLevel
Expand All @@ -127,6 +151,8 @@ public function getTree($node, $depth = null, $currentLevel = 0)
}

/**
* Get node children.
*
* @param \Magento\Framework\Data\Tree\Node $node
* @param int $depth
* @param int $currentLevel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,23 @@
<waitForPageLoad stepKey="waitForStoreViewChangeLoad"/>
</actionGroup>

<actionGroup name="switchCategoryToAllStoreView">
<arguments>
<argument name="CatName"/>
</arguments>
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory" />
<waitForPageLoad stepKey="waitForPageLoad1"/>
<waitForLoadingMaskToDisappear stepKey="waitForSpinner1"/>
<scrollToTopOfPage stepKey="scrollToToggle"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/>
<click selector="{{AdminCategoryMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName"/>
<see selector="{{AdminCategoryMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeAllStoreView"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/>
<waitForPageLoad stepKey="waitForStoreViewChangeLoad"/>
</actionGroup>

<actionGroup name="navigateToCreatedCategory">
<arguments>
<argument name="Category"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,21 @@
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
</actionGroup>

<!-- Delete attribute set -->
<actionGroup name="deleteAttributeSetByLabel">
<arguments>
<argument name="label" type="string"/>
</arguments>
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/>
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{label}}" stepKey="filterByName"/>
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
<waitForPageLoad stepKey="waitForClick"/>
<click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/>
<click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/>
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="The attribute set has been removed." stepKey="seeDeleteMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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="AssertAttributeDeletionErrorMessageActionGroup">
<waitForElementVisible selector="{{AdminProductMessagesSection.errorMessage}}" stepKey="waitForErrorMessage"/>
<see selector="{{AdminProductMessagesSection.errorMessage}}" userInput="This attribute is used in configurable products." stepKey="deleteProductAttributeFailureMessage"/>
</actionGroup>
</actionGroups>

Loading

0 comments on commit 8b66d61

Please sign in to comment.