File tree Expand file tree Collapse file tree 8 files changed +94
-2
lines changed
Test/Unit/Ui/DataProvider/Product/Form/Modifier
Ui/DataProvider/Product/Form/Modifier
dev/tests/functional/tests/app/Magento/Catalog/Test
Block/Adminhtml/Product/Edit/Section/AdvancedPricing Expand file tree Collapse file tree 8 files changed +94
-2
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public function testModifyMeta()
69
69
'data ' => [
70
70
'config ' => [
71
71
'visible ' => true ,
72
- 'validation ' => ['validate-number ' => true ],
72
+ 'validation ' => ['validate-zero-or-greater ' => true ],
73
73
],
74
74
],
75
75
],
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ private function getUpdatedTierPriceStructure(array $priceMeta)
97
97
$ priceMeta ['arguments ' ]['data ' ]['config ' ]['visible ' ] = $ firstOption
98
98
&& $ firstOption ['value ' ] == ProductPriceOptionsInterface::VALUE_FIXED ;
99
99
$ priceMeta ['arguments ' ]['data ' ]['config ' ]['validation ' ] = [
100
- 'validate-number ' => true ,
100
+ 'validate-zero-or-greater ' => true
101
101
];
102
102
return [
103
103
'price_value ' => [
Original file line number Diff line number Diff line change @@ -122,4 +122,18 @@ public function hasGroupPriceOptions()
122
122
{
123
123
return $ this ->_rootElement ->find ('tbody tr ' )->isPresent ();
124
124
}
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
+ }
125
139
}
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change 13
13
<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" />
14
14
<block name =" productForm" class =" Magento\Catalog\Test\Block\Adminhtml\Product\ProductForm" locator =" [id='page:main-container']" strategy =" css selector" />
15
15
<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" />
16
17
</page >
17
18
</config >
Original file line number Diff line number Diff line change 2077
2077
<field name =" visibility" xsi : type =" string" >Catalog, Search</field >
2078
2078
<field name =" url_key" xsi : type =" string" >simple-product-%isolation%</field >
2079
2079
</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 >
2080
2100
</repository >
2081
2101
</config >
Original file line number Diff line number Diff line change 112
112
</item >
113
113
</field >
114
114
</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 >
115
125
</repository >
116
126
</config >
Original file line number Diff line number Diff line change 177
177
<constraint name =" Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
178
178
<constraint name =" Magento\Catalog\Test\Constraint\AssertProductPriceOnDifferentStoreViews" />
179
179
</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 >
180
184
</testCase >
181
185
</config >
You can’t perform that action at this time.
0 commit comments