Skip to content

Commit 935b45a

Browse files
author
Spandana Chittimala
committed
Merge branch '2.2-develop' of https://github.com/magento/magento2ce into PR-2019-05-07
2 parents 8d50ad5 + 0b2fcf1 commit 935b45a

File tree

13 files changed

+136
-25
lines changed

13 files changed

+136
-25
lines changed

app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
*/
66
namespace Magento\Catalog\Model\Product\Attribute\Backend\TierPrice;
77

8-
use Magento\Framework\EntityManager\Operation\ExtensionInterface;
98
use Magento\Catalog\Api\Data\ProductInterface;
9+
use Magento\Framework\App\ObjectManager;
10+
use Magento\Framework\Locale\FormatInterface;
1011
use Magento\Store\Model\StoreManagerInterface;
1112
use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
1213
use Magento\Customer\Api\GroupManagementInterface;
@@ -38,26 +39,34 @@ class UpdateHandler extends AbstractHandler
3839
*/
3940
private $tierPriceResource;
4041

42+
/**
43+
* @var FormatInterface
44+
*/
45+
private $localeFormat;
46+
4147
/**
4248
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
4349
* @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository
4450
* @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
4551
* @param \Magento\Framework\EntityManager\MetadataPool $metadataPool
4652
* @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice $tierPriceResource
53+
* @param FormatInterface|null $localeFormat
4754
*/
4855
public function __construct(
4956
StoreManagerInterface $storeManager,
5057
ProductAttributeRepositoryInterface $attributeRepository,
5158
GroupManagementInterface $groupManagement,
5259
MetadataPool $metadataPool,
53-
Tierprice $tierPriceResource
60+
Tierprice $tierPriceResource,
61+
FormatInterface $localeFormat = null
5462
) {
5563
parent::__construct($groupManagement);
5664

5765
$this->storeManager = $storeManager;
5866
$this->attributeRepository = $attributeRepository;
5967
$this->metadataPoll = $metadataPool;
6068
$this->tierPriceResource = $tierPriceResource;
69+
$this->localeFormat = $localeFormat ?: ObjectManager::getInstance()->get(FormatInterface::class);
6170
}
6271

6372
/**
@@ -116,8 +125,9 @@ private function updateValues(array $valuesToUpdate, array $oldValues): bool
116125
{
117126
$isChanged = false;
118127
foreach ($valuesToUpdate as $key => $value) {
119-
if ((!empty($value['value']) && (float)$oldValues[$key]['price'] !== (float)$value['value'])
120-
|| $this->getPercentage($oldValues[$key]) !== $this->getPercentage($value)
128+
if ((!empty($value['value'])
129+
&& (float)$oldValues[$key]['price'] !== $this->localeFormat->getNumber($value['value'])
130+
) || $this->getPercentage($oldValues[$key]) !== $this->getPercentage($value)
121131
) {
122132
$price = new \Magento\Framework\DataObject(
123133
[

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

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,14 @@
248248
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
249249
</actionGroup>
250250

251-
<actionGroup name="AdminAssignProductToCategory">
251+
<actionGroup name="AdminAssignProductToCategory" extends="AdminProductAssignCategory">
252252
<arguments>
253253
<argument name="productId" type="string"/>
254-
<argument name="categoryName" type="string"/>
255254
</arguments>
256-
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="amOnPage"/>
257-
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="selectCategory"/>
258-
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/>
259-
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveProductMessage"/>
255+
<amOnPage url="{{AdminProductEditPage.url(productId)}}" before="searchAndSelectCategory" stepKey="amOnPage"/>
256+
<click selector="{{AdminProductFormActionSection.saveButton}}" after="searchAndSelectCategory" stepKey="clickOnSaveButton"/>
257+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" after="clickOnSaveButton" stepKey="waitForSaveProductMessage"/>
258+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." after="waitForSaveProductMessage" stepKey="seeSaveProductMessage"/>
260259
</actionGroup>
261260

262261
<actionGroup name="AdminChangeProductAttributeSet">
@@ -269,4 +268,19 @@
269268
<waitForElementVisible selector="{{AdminProductFormSection.attributeSetFilterResultByName(attributeSet.attribute_set_name)}}" stepKey="waitForNewAttributeSetIsShown"/>
270269
<click selector="{{AdminProductFormSection.attributeSetFilterResultByName(attributeSet.attribute_set_name)}}" stepKey="selectAttributeSet"/>
271270
</actionGroup>
271+
272+
<actionGroup name="AdminProductAssignCategory">
273+
<arguments>
274+
<argument name="categoryName" type="string"/>
275+
</arguments>
276+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="searchAndSelectCategory"/>
277+
</actionGroup>
278+
279+
<!--Navigate to created product page directly via ID-->
280+
<actionGroup name="goToProductPageViaID">
281+
<arguments>
282+
<argument name="productId" type="string"/>
283+
</arguments>
284+
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProduct"/>
285+
</actionGroup>
272286
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryProductSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
<element name="productPriceOld" type="text" selector="//span[@data-price-type='oldPrice']//span[@class='price'][contains(., '{{var1}}')]" parameterized="true"/>
2525
<element name="productPriceLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]" parameterized="true"/>
2626
<element name="productPriceLinkAfterLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]/following::span[contains(text(), '{{var2}}')]" parameterized="true"/>
27+
<element name="productStockUnavailableByName" type="text" selector="//a[contains(@class, 'product-item-link') and normalize-space(text())='{{productName}}']/ancestor::div[contains(@class, 'product-item-details')]//span[contains(text(),'Out of stock')]" parameterized="true"/>
2728
</section>
2829
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-15740"/>
1919
<useCaseId value="MAGETWO-73157"/>
20+
<skip>
21+
<issueId value="MC-16313"/>
22+
</skip>
2023
<group value="catalog"/>
2124
</annotations>
2225
<before>
@@ -28,6 +31,8 @@
2831
<requiredEntity createDataKey="createCategory"/>
2932
</createData>
3033
<updateData createDataKey="createFirstProduct" entity="ProductWithFieldOptions" stepKey="updateProductCustomOptions" />
34+
<magentoCLI stepKey="reindex" command="indexer:reindex"/>
35+
<magentoCLI stepKey="flushCache" command="cache:flush"/>
3136
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
3237
</before>
3338
<after>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="StockOptionsDisplayOutOfStockProductsEnable">
12+
<data key="path">cataloginventory/options/show_out_of_stock</data>
13+
<data key="scope_id">0</data>
14+
<data key="label">Yes</data>
15+
<data key="value">1</data>
16+
</entity>
17+
<entity name="StockOptionsDisplayOutOfStockProductsDisable">
18+
<data key="path">cataloginventory/options/show_out_of_stock</data>
19+
<data key="scope_id">0</data>
20+
<data key="label">No</data>
21+
<data key="value">0</data>
22+
</entity>
23+
</entities>

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminCreateApiConfigurableProductActionGroup">
1212
<arguments>
13-
<argument name="productName" defaultValue="ApiConfigurableProductWithOutCategory" type="string"/>
13+
<argument name="productName" defaultValue="{{ApiConfigurableProductWithOutCategory.name}}" type="string"/>
1414
</arguments>
1515

1616
<!-- Create the configurable product based on the data in the /data folder -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<!-- Check for the product link. -->
12+
<!-- Assumes web client is on Grouped Product Page -->
13+
<actionGroup name="AssertLinkPresenceOnGroupedProductPage">
14+
<arguments>
15+
<argument name="productName" type="string"/>
16+
</arguments>
17+
<see selector="{{StorefrontProductInfoMainSection.groupedProductsTable}}" userInput="{{productName}}" stepKey="seeFirstStagedGroupedProduct"/>
18+
</actionGroup>
19+
</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="StorefrontProductInfoMainSection">
12+
<element name="groupedProductsTable" type="text" selector="#super-product-table .product-item-name"/>
13+
</section>
14+
</sections>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"ramsey/uuid": "~3.7.3"
7575
},
7676
"require-dev": {
77-
"magento/magento2-functional-testing-framework": "2.3.13",
77+
"magento/magento2-functional-testing-framework": "2.4.0",
7878
"phpunit/phpunit": "~6.2.0",
7979
"squizlabs/php_codesniffer": "3.2.2",
8080
"phpmd/phpmd": "@stable",

composer.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)