Skip to content

Commit ba96c2b

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/2.3-develop' into 2.3-develop-pr
2 parents 1c9d5fa + 8f737c0 commit ba96c2b

File tree

210 files changed

+6209
-272
lines changed

Some content is hidden

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

210 files changed

+6209
-272
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ protected function saveAndReplaceAdvancedPrices()
408408
} elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
409409
$this->processCountExistingPrices($tierPrices, self::TABLE_TIER_PRICE)
410410
->processCountNewPrices($tierPrices);
411+
411412
$this->saveProductPrices($tierPrices, self::TABLE_TIER_PRICE);
412413
if ($listSku) {
413414
$this->setUpdatedAt($listSku);
@@ -562,11 +563,14 @@ protected function processCountExistingPrices($prices, $table)
562563

563564
$tableName = $this->_resourceFactory->create()->getTable($table);
564565
$productEntityLinkField = $this->getProductEntityLinkField();
565-
$existingPrices = $this->_connection->fetchAssoc(
566+
$existingPrices = $this->_connection->fetchAll(
566567
$this->_connection->select()->from(
567568
$tableName,
568-
['value_id', $productEntityLinkField, 'all_groups', 'customer_group_id']
569-
)->where($productEntityLinkField . ' IN (?)', $existProductIds)
569+
[$productEntityLinkField, 'all_groups', 'customer_group_id', 'qty']
570+
)->where(
571+
$productEntityLinkField . ' IN (?)',
572+
$existProductIds
573+
)
570574
);
571575
foreach ($existingPrices as $existingPrice) {
572576
foreach ($prices as $sku => $skuPrices) {
@@ -591,8 +595,10 @@ protected function incrementCounterUpdated($prices, $existingPrice)
591595
foreach ($prices as $price) {
592596
if ($existingPrice['all_groups'] == $price['all_groups']
593597
&& $existingPrice['customer_group_id'] == $price['customer_group_id']
598+
&& (int) $existingPrice['qty'] === (int) $price['qty']
594599
) {
595600
$this->countItemsUpdated++;
601+
continue;
596602
}
597603
}
598604
}

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ public function testProcessCountExistingPrices(
921921
);
922922
$dbSelectMock = $this->createMock(\Magento\Framework\DB\Select::class);
923923
$this->connection->expects($this->once())
924-
->method('fetchAssoc')
924+
->method('fetchAll')
925925
->willReturn($existingPrices);
926926
$this->connection->expects($this->once())
927927
->method('select')
@@ -930,7 +930,7 @@ public function testProcessCountExistingPrices(
930930
->method('from')
931931
->with(
932932
self::TABLE_NAME,
933-
['value_id', self::LINK_FIELD, 'all_groups', 'customer_group_id']
933+
[self::LINK_FIELD, 'all_groups', 'customer_group_id', 'qty']
934934
)->willReturnSelf();
935935
$this->advancedPricing->expects($this->once())
936936
->method('retrieveOldSkus')
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
<section name="AdminAdvancedReportingSection">
10+
<element name="goToAdvancedReporting" type="text" selector="//div[@class='dashboard-advanced-reports-actions']/a[@title='Go to Advanced Reporting']" timeout="30"/>
11+
</section>
12+
</sections>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminAdvancedReportingButtonTest">
11+
<annotations>
12+
<stories value="AdvancedReporting"/>
13+
<title value="AdvancedReportingButtonTest"/>
14+
<description value="Test log in to AdvancedReporting and tests AdvancedReportingButtonTest"/>
15+
<testCaseId value="MC-14800"/>
16+
<severity value="CRITICAL"/>
17+
<group value="analytics"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="logout" stepKey="logout"/>
26+
</after>
27+
28+
<!--Navigate through Advanced Reporting button on dashboard to Sign Up page-->
29+
<amOnPage url="{{AdminDashboardPage.url}}" stepKey="amOnDashboardPage"/>
30+
<waitForPageLoad stepKey="waitForDashboardPageLoad"/>
31+
<click selector="{{AdminAdvancedReportingSection.goToAdvancedReporting}}" stepKey="clickGoToAdvancedReporting"/>
32+
<switchToNextTab stepKey="switchToNewTab"/>
33+
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/>
34+
</test>
35+
</tests>

app/code/Magento/Backup/Test/Mftf/ActionGroup/DeleteBackupActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<click selector="{{AdminGridTableSection.backupRowCheckbox(backup.name)}}" stepKey="selectBackupRow"/>
1818
<selectOption selector="{{AdminGridActionSection.actionSelect}}" userInput="Delete" stepKey="selectDeleteAction"/>
1919
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
20+
<waitForPageLoad stepKey="waitForConfirmWindowToAppear"/>
2021
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
2122
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
2223
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>

app/code/Magento/Backup/Test/Mftf/Data/BackupData.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@
2020
<data key="name" unique="suffix">databaseBackup</data>
2121
<data key="type">Database</data>
2222
</entity>
23-
</entities>
23+
<entity name="WebSetupWizardBackup" type="backup">
24+
<data key="name">WebSetupWizard</data>
25+
<data key="type">Database</data>
26+
</entity>
27+
</entities>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="VerifyProductTypeOrder">
12+
<seeElement stepKey="seeBundleInOrder" selector="{{AdminProductDropdownOrderSection.bundleProduct}}"/>
13+
</actionGroup>
14+
</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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductDropdownOrderSection">
12+
<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']"/>
13+
</section>
14+
</sections>

app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
3232
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
3333
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
34+
<!-- Delete the bundled product we created in the test body -->
35+
<actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct">
36+
<argument name="sku" value="{{BundleProduct.sku}}"/>
37+
</actionGroup>
3438
<actionGroup ref="logout" stepKey="logout"/>
3539
</after>
3640
<!--Go to bundle product creation page-->

app/code/Magento/Catalog/Api/ProductRenderListInterface.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
78
namespace Magento\Catalog\Api;
89

910
/**
10-
* Interface which provides product renders information for products
11+
* Interface which provides product renders information for products.
12+
*
1113
* @api
1214
* @since 101.1.0
1315
*/
1416
interface ProductRenderListInterface
1517
{
1618
/**
17-
* Collect and retrieve the list of product render info
18-
* This info contains raw prices and formated prices, product name, stock status, store_id, etc
19+
* Collect and retrieve the list of product render info.
20+
*
21+
* This info contains raw prices and formatted prices, product name, stock status, store_id, etc.
22+
*
1923
* @see \Magento\Catalog\Api\Data\ProductRenderInfoDtoInterface
2024
*
2125
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria

app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
*
1010
* @author Magento Core Team <core@magentocommerce.com>
1111
*/
12+
1213
namespace Magento\Catalog\Block\Product\View\Options;
1314

1415
use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface;
1516

1617
/**
18+
* Product aoptions section abstract block.
19+
*
1720
* @api
1821
* @since 100.0.2
1922
*/
@@ -46,7 +49,7 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template
4649
/**
4750
* @param \Magento\Framework\View\Element\Template\Context $context
4851
* @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
49-
* @param \Magento\Catalog\Helper\Data $catalogData,
52+
* @param \Magento\Catalog\Helper\Data $catalogData
5053
* @param array $data
5154
*/
5255
public function __construct(
@@ -123,6 +126,8 @@ public function getFormattedPrice()
123126
}
124127

125128
/**
129+
* Retrieve formatted price.
130+
*
126131
* @return string
127132
*
128133
* @deprecated
@@ -134,7 +139,7 @@ public function getFormatedPrice()
134139
}
135140

136141
/**
137-
* Return formated price
142+
* Return formatted price
138143
*
139144
* @param array $value
140145
* @param bool $flag

app/code/Magento/Catalog/Model/Category/Tree.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,40 @@ class Tree
3232
*/
3333
protected $treeFactory;
3434

35+
/**
36+
* @var \Magento\Catalog\Model\ResourceModel\Category\TreeFactory
37+
*/
38+
private $treeResourceFactory;
39+
3540
/**
3641
* @param \Magento\Catalog\Model\ResourceModel\Category\Tree $categoryTree
3742
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
3843
* @param \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection
3944
* @param \Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory
45+
* @param \Magento\Catalog\Model\ResourceModel\Category\TreeFactory|null $treeResourceFactory
4046
*/
4147
public function __construct(
4248
\Magento\Catalog\Model\ResourceModel\Category\Tree $categoryTree,
4349
\Magento\Store\Model\StoreManagerInterface $storeManager,
4450
\Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection,
45-
\Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory
51+
\Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory $treeFactory,
52+
\Magento\Catalog\Model\ResourceModel\Category\TreeFactory $treeResourceFactory = null
4653
) {
4754
$this->categoryTree = $categoryTree;
4855
$this->storeManager = $storeManager;
4956
$this->categoryCollection = $categoryCollection;
5057
$this->treeFactory = $treeFactory;
58+
$this->treeResourceFactory = $treeResourceFactory ?? \Magento\Framework\App\ObjectManager::getInstance()
59+
->get(\Magento\Catalog\Model\ResourceModel\Category\TreeFactory::class);
5160
}
5261

5362
/**
63+
* Get root node by category.
64+
*
5465
* @param \Magento\Catalog\Model\Category|null $category
5566
* @return Node|null
67+
* @throws \Magento\Framework\Exception\LocalizedException
68+
* @throws \Magento\Framework\Exception\NoSuchEntityException
5669
*/
5770
public function getRootNode($category = null)
5871
{
@@ -71,21 +84,30 @@ public function getRootNode($category = null)
7184
}
7285

7386
/**
87+
* Get node by category.
88+
*
7489
* @param \Magento\Catalog\Model\Category $category
7590
* @return Node
91+
* @throws \Magento\Framework\Exception\LocalizedException
92+
* @throws \Magento\Framework\Exception\NoSuchEntityException
7693
*/
7794
protected function getNode(\Magento\Catalog\Model\Category $category)
7895
{
7996
$nodeId = $category->getId();
80-
$node = $this->categoryTree->loadNode($nodeId);
97+
$categoryTree = $this->treeResourceFactory->create();
98+
$node = $categoryTree->loadNode($nodeId);
8199
$node->loadChildren();
82100
$this->prepareCollection();
83101
$this->categoryTree->addCollectionData($this->categoryCollection);
84102
return $node;
85103
}
86104

87105
/**
106+
* Prepare category collection.
107+
*
88108
* @return void
109+
* @throws \Magento\Framework\Exception\LocalizedException
110+
* @throws \Magento\Framework\Exception\NoSuchEntityException
89111
*/
90112
protected function prepareCollection()
91113
{
@@ -104,6 +126,8 @@ protected function prepareCollection()
104126
}
105127

106128
/**
129+
* Get tree by node.
130+
*
107131
* @param \Magento\Framework\Data\Tree\Node $node
108132
* @param int $depth
109133
* @param int $currentLevel
@@ -127,6 +151,8 @@ public function getTree($node, $depth = null, $currentLevel = 0)
127151
}
128152

129153
/**
154+
* Get node children.
155+
*
130156
* @param \Magento\Framework\Data\Tree\Node $node
131157
* @param int $depth
132158
* @param int $currentLevel

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,23 @@
231231
<waitForPageLoad stepKey="waitForStoreViewChangeLoad"/>
232232
</actionGroup>
233233

234+
<actionGroup name="switchCategoryToAllStoreView">
235+
<arguments>
236+
<argument name="CatName"/>
237+
</arguments>
238+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory" />
239+
<waitForPageLoad stepKey="waitForPageLoad1"/>
240+
<waitForLoadingMaskToDisappear stepKey="waitForSpinner1"/>
241+
<scrollToTopOfPage stepKey="scrollToToggle"/>
242+
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/>
243+
<click selector="{{AdminCategoryMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName"/>
244+
<see selector="{{AdminCategoryMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeAllStoreView"/>
245+
<waitForPageLoad stepKey="waitForPageLoad2"/>
246+
<waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/>
247+
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/>
248+
<waitForPageLoad stepKey="waitForStoreViewChangeLoad"/>
249+
</actionGroup>
250+
234251
<actionGroup name="navigateToCreatedCategory">
235252
<arguments>
236253
<argument name="Category"/>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,21 @@
7474
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
7575
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
7676
</actionGroup>
77+
78+
<!-- Delete attribute set -->
79+
<actionGroup name="deleteAttributeSetByLabel">
80+
<arguments>
81+
<argument name="label" type="string"/>
82+
</arguments>
83+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/>
84+
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
85+
<fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{label}}" stepKey="filterByName"/>
86+
<click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/>
87+
<click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/>
88+
<waitForPageLoad stepKey="waitForClick"/>
89+
<click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/>
90+
<click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/>
91+
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
92+
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="The attribute set has been removed." stepKey="seeDeleteMessage"/>
93+
</actionGroup>
7794
</actionGroups>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="AssertAttributeDeletionErrorMessageActionGroup">
12+
<waitForElementVisible selector="{{AdminProductMessagesSection.errorMessage}}" stepKey="waitForErrorMessage"/>
13+
<see selector="{{AdminProductMessagesSection.errorMessage}}" userInput="This attribute is used in configurable products." stepKey="deleteProductAttributeFailureMessage"/>
14+
</actionGroup>
15+
</actionGroups>
16+

0 commit comments

Comments
 (0)