Skip to content

Commit a1da06d

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-62076' into NORD-PR-INTERNAL
2 parents c052e22 + 318f747 commit a1da06d

File tree

8 files changed

+94
-2
lines changed

8 files changed

+94
-2
lines changed

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/TierPriceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testModifyMeta()
6969
'data' => [
7070
'config' => [
7171
'visible' => true,
72-
'validation' => ['validate-number' => true],
72+
'validation' => ['validate-zero-or-greater' => true],
7373
],
7474
],
7575
],

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/TierPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private function getUpdatedTierPriceStructure(array $priceMeta)
9797
$priceMeta['arguments']['data']['config']['visible'] = $firstOption
9898
&& $firstOption['value'] == ProductPriceOptionsInterface::VALUE_FIXED;
9999
$priceMeta['arguments']['data']['config']['validation'] = [
100-
'validate-number' => true,
100+
'validate-zero-or-greater' => true
101101
];
102102
return [
103103
'price_value' => [

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/AdvancedPricing/OptionTier.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,18 @@ public function hasGroupPriceOptions()
122122
{
123123
return $this->_rootElement->find('tbody tr')->isPresent();
124124
}
125+
126+
/**
127+
* Wait until price form locks
128+
*
129+
* @return void
130+
*/
131+
public function waitTierPriceFormLocks()
132+
{
133+
$this->_rootElement->waitUntil(
134+
function () {
135+
return $this->isVisible() ? null : true;
136+
}
137+
);
138+
}
125139
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Test\Constraint;
8+
9+
use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit;
10+
use Magento\Mtf\Constraint\AbstractConstraint;
11+
12+
/**
13+
* Asserts that tier price formatting correct
14+
*/
15+
class AssertProductFormattingTierPrice extends AbstractConstraint
16+
{
17+
/**
18+
* Assert that success message is displayed after product save.
19+
*
20+
* @param CatalogProductEdit $productPage
21+
* @return void
22+
*/
23+
public function processAssert(CatalogProductEdit $productPage)
24+
{
25+
$productPage->getProductForm()->openSection('advanced-pricing');
26+
$productPage->getAdvancedPrice()->getFieldsData([]);
27+
$productPage->getAdvancedPrice()->getTierPriceForm()->waitUntilTierPriceFormLocks();
28+
\PHPUnit_Framework_Assert::assertFalse(
29+
$productPage->getAdvancedPrice()->getTierPriceForm()->isVisible(),
30+
'Advanced price form still visible'
31+
);
32+
}
33+
34+
/**
35+
* Returns a string representation of the object
36+
*
37+
* @return string
38+
*/
39+
public function toString()
40+
{
41+
return 'Advanced price formatting correct.';
42+
}
43+
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductEdit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<block name="newAttributeModal" class="Magento\Catalog\Test\Block\Adminhtml\Product\Modal\NewAttribute" locator=".product_form_product_form_add_attribute_modal_create_new_attribute_modal" strategy="css selector"/>
1414
<block name="productForm" class="Magento\Catalog\Test\Block\Adminhtml\Product\ProductForm" locator="[id='page:main-container']" strategy="css selector"/>
1515
<block name="storeSwitcherBlock" class="Magento\Store\Test\Block\Switcher" locator=".store-switcher" strategy="css selector" />
16+
<block name="advancedPrice" class="Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\AdvancedPricing" locator="table[data-index='tier_price']" strategy="css selector" />
1617
</page>
1718
</config>

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,5 +2077,25 @@
20772077
<field name="visibility" xsi:type="string">Catalog, Search</field>
20782078
<field name="url_key" xsi:type="string">simple-product-%isolation%</field>
20792079
</dataset>
2080+
<dataset name="simple_with_hight_tier_price">
2081+
<field name="attribute_set_id" xsi:type="array">
2082+
<item name="dataset" xsi:type="string">default</item>
2083+
</field>
2084+
<field name="name" xsi:type="string">Simple Product %isolation%</field>
2085+
<field name="sku" xsi:type="string">sku_simple_product_%isolation%</field>
2086+
<field name="price" xsi:type="array">
2087+
<item name="value" xsi:type="string">300</item>
2088+
</field>
2089+
<field name="product_has_weight" xsi:type="string">This item has weight</field>
2090+
<field name="weight" xsi:type="string">1</field>
2091+
<field name="quantity_and_stock_status" xsi:type="array">
2092+
<item name="qty" xsi:type="string">34</item>
2093+
<item name="is_in_stock" xsi:type="string">In Stock</item>
2094+
</field>
2095+
<field name="tier_price" xsi:type="array">
2096+
<item name="dataset" xsi:type="string">high_cost</item>
2097+
</field>
2098+
<field name="url_key" xsi:type="string">simple-product-%isolation%</field>
2099+
</dataset>
20802100
</repository>
20812101
</config>

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/TierPrice.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,15 @@
112112
</item>
113113
</field>
114114
</dataset>
115+
<dataset name="high_cost">
116+
<field name="0" xsi:type="array">
117+
<item name="price" xsi:type="string">500000</item>
118+
<item name="website" xsi:type="string">All Websites [USD]</item>
119+
<item name="price_qty" xsi:type="string">1</item>
120+
<item name="customer_group" xsi:type="array">
121+
<item name="dataset" xsi:type="string">ALL_GROUPS</item>
122+
</item>
123+
</field>
124+
</dataset>
115125
</repository>
116126
</config>

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,9 @@
177177
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
178178
<constraint name="Magento\Catalog\Test\Constraint\AssertProductPriceOnDifferentStoreViews" />
179179
</variation>
180+
<variation name="UpdateSimpleProductEntityTestVariation14" summary="An error appears on open tier price with locale formatting" ticketId="MAGETWO-62076">
181+
<data name="initialProduct/dataset" xsi:type="string">simple_with_hight_tier_price</data>
182+
<constraint name="Magento\Catalog\Test\Constraint\AssertProductFormattingTierPrice" />
183+
</variation>
180184
</testCase>
181185
</config>

0 commit comments

Comments
 (0)