Skip to content

Commit b4a1072

Browse files
author
Dmytro Aponasenko
committed
Merge branch 'MTA-549' of https://github.corp.ebay.com/magento-qmt/magento2ce into develop
2 parents ab8c3c3 + e036b46 commit b4a1072

File tree

27 files changed

+309
-477
lines changed

27 files changed

+309
-477
lines changed

dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/BundleSelections.php

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ protected function getPreset($name)
152152
],
153153
],
154154
],
155+
155156
'default_fixed' => [
156157
'bundle_options' => [
157158
[
@@ -189,6 +190,7 @@ protected function getPreset($name)
189190
],
190191
],
191192
],
193+
192194
'second' => [
193195
'bundle_options' => [
194196
[
@@ -226,6 +228,7 @@ protected function getPreset($name)
226228
],
227229
],
228230
],
231+
229232
'all_types_fixed' => [
230233
'bundle_options' => [
231234
[
@@ -356,6 +359,7 @@ protected function getPreset($name)
356359
],
357360
],
358361
],
362+
359363
'all_types_dynamic' => [
360364
'bundle_options' => [
361365
[
@@ -470,6 +474,7 @@ protected function getPreset($name)
470474
],
471475
],
472476
],
477+
473478
'with_not_required_options' => [
474479
'bundle_options' => [
475480
[
@@ -538,6 +543,77 @@ protected function getPreset($name)
538543
],
539544
],
540545
],
546+
547+
'two_options_with_fixed_and_percent_prices' => [
548+
'bundle_options' => [
549+
[
550+
'title' => 'BundleOption1',
551+
'type' => 'Drop-down',
552+
'required' => 'Yes',
553+
'assigned_products' => [
554+
[
555+
'search_data' => [
556+
'name' => '%product_name%',
557+
],
558+
'data' => [
559+
'selection_price_value' => 10.00,
560+
'selection_price_type' => 'Fixed',
561+
'selection_qty' => 1,
562+
],
563+
],
564+
[
565+
'search_data' => [
566+
'name' => '%product_name%',
567+
],
568+
'data' => [
569+
'selection_price_value' => 20.00,
570+
'selection_price_type' => 'Percent',
571+
'selection_qty' => 1,
572+
]
573+
],
574+
],
575+
],
576+
],
577+
'products' => [
578+
[
579+
'catalogProductSimple::product_without_category',
580+
'catalogProductSimple::product_without_category',
581+
],
582+
],
583+
],
584+
585+
'two_options_assigned_products_without_category' => [
586+
'bundle_options' => [
587+
[
588+
'title' => 'Drop-down Option',
589+
'type' => 'Drop-down',
590+
'assigned_products' => [
591+
[
592+
'search_data' => [
593+
'name' => '%product_name%',
594+
],
595+
'data' => [
596+
'selection_qty' => 1,
597+
],
598+
],
599+
[
600+
'search_data' => [
601+
'name' => '%product_name%',
602+
],
603+
'data' => [
604+
'selection_qty' => 1,
605+
]
606+
],
607+
],
608+
],
609+
],
610+
'products' => [
611+
[
612+
'catalogProductSimple::product_without_category',
613+
'catalogProductSimple::product_without_category',
614+
],
615+
],
616+
],
541617
];
542618
if (!isset($presets[$name])) {
543619
throw new \InvalidArgumentException(

dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct/Price.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ public function getPreset()
186186
'price_to' => '756.00',
187187
'cart_price' => '756.00',
188188
],
189+
'bundle_fixed_with_category' => [
190+
'price_from' => '130.00',
191+
'price_to' => '144.00',
192+
],
193+
'bundle_dynamic_with_category' => [
194+
'price_from' => '100.00',
195+
'price_to' => '100.00',
196+
]
189197
];
190198
if (!isset($presets[$this->currentPreset])) {
191199
return null;

dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,51 @@
131131
<item name="preset" xsi:type="string">default_fixed</item>
132132
</field>
133133
</dataset>
134+
135+
<dataset name="bundle_fixed_with_category">
136+
<field name="name" xsi:type="string">Bundle fixed product %isolation%</field>
137+
<field name="url_key" xsi:type="string">bundle-fixed-product-%isolation%</field>
138+
<field name="sku" xsi:type="string">sku_bundle_fixed_product_%isolation%</field>
139+
<field name="sku_type" xsi:type="string">Fixed</field>
140+
<field name="price_type" xsi:type="string">Fixed</field>
141+
<field name="price" xsi:type="array">
142+
<item name="value" xsi:type="string">100</item>
143+
</field>
144+
<field name="tax_class_id" xsi:type="array">
145+
<item name="dataSet" xsi:type="string">taxable_goods</item>
146+
</field>
147+
<field name="weight" xsi:type="string">1</field>
148+
<field name="weight_type" xsi:type="string">Fixed</field>
149+
<field name="website_ids" xsi:type="array">
150+
<item name="0" xsi:type="string">Main Website</item>
151+
</field>
152+
<field name="category_ids" xsi:type="array">
153+
<item name="presets" xsi:type="string">default_subcategory</item>
154+
</field>
155+
<field name="bundle_selections" xsi:type="array">
156+
<item name="preset" xsi:type="string">two_options_with_fixed_and_percent_prices</item>
157+
</field>
158+
</dataset>
159+
160+
<dataset name="bundle_dynamic_with_category">
161+
<field name="name" xsi:type="string">Bundle dynamic product %isolation%</field>
162+
<field name="url_key" xsi:type="string">bundle-dynamic-product-%isolation%</field>
163+
<field name="sku" xsi:type="string">sku_bundle_dynamic_product_%isolation%</field>
164+
<field name="sku_type" xsi:type="string">Dynamic</field>
165+
<field name="price_type" xsi:type="string">Dynamic</field>
166+
<field name="price" xsi:type="array">
167+
<item name="value" xsi:type="string">-</item>
168+
<item name="preset" xsi:type="string">bundle_dynamic_with_category</item>
169+
</field>
170+
<field name="website_ids" xsi:type="array">
171+
<item name="0" xsi:type="string">Main Website</item>
172+
</field>
173+
<field name="category_ids" xsi:type="array">
174+
<item name="presets" xsi:type="string">default_subcategory</item>
175+
</field>
176+
<field name="bundle_selections" xsi:type="array">
177+
<item name="preset" xsi:type="string">two_options_assigned_products_without_category</item>
178+
</field>
179+
</dataset>
134180
</storage>
135181
</repository>

dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/EditBundleTest.php

Lines changed: 0 additions & 131 deletions
This file was deleted.

dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/UpdateBundleProductEntityTest.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
use Magento\Mtf\TestCase\Injectable;
1313

1414
/**
15-
* Test Creation for Update BundleProductEntity
16-
*
1715
* Test Flow:
1816
*
1917
* Precondition:
@@ -28,7 +26,6 @@
2826
* 5. Click "Save".
2927
* 6. Perform asserts
3028
*
31-
*
3229
* @group Bundle_Product_(MX)
3330
* @ZephyrId MAGETWO-26195
3431
*/
@@ -73,15 +70,27 @@ public function __inject(
7370
*
7471
* @param BundleProduct $product
7572
* @param BundleProduct $originalProduct
76-
* @return void
73+
* @return array
7774
*/
7875
public function test(BundleProduct $product, BundleProduct $originalProduct)
7976
{
77+
// Preconditions
8078
$originalProduct->persist();
81-
$this->catalogProductIndex->open();
79+
$originalCategory = $originalProduct->hasData('category_ids')
80+
? $originalProduct->getDataFieldConfig('category_ids')['source']->getCategories()
81+
: null;
82+
$category = $product->hasData('category_ids')
83+
? $product->getDataFieldConfig('category_ids')['source']->getCategories()
84+
: $originalCategory;
85+
86+
// Steps
8287
$filter = ['sku' => $originalProduct->getSku()];
88+
89+
$this->catalogProductIndex->open();
8390
$this->catalogProductIndex->getProductGrid()->searchAndOpen($filter);
8491
$this->catalogProductEdit->getProductForm()->fill($product);
8592
$this->catalogProductEdit->getFormPageActions()->save();
93+
94+
return ['category' => $category];
8695
}
8796
}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
"originalProduct/dataSet";"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/price/preset";"product/data/weight_type";"product/data/weight";"product/data/category_ids/presets";"product/data/description";"product/data/bundle_shipment_type";"product/data/bundle_selections/preset";"product/data/checkout_data/preset";"product/data/visibility";"product/data/url_key";"constraint"
2-
"bundle_dynamic_product";"bundle_fixed_%isolation%";"Fixed";"bundle_fixed_%isolation%";"dynamic-100";"Fixed";"1";"-";"Bundle Product Fixed Required";"Together";"default_dynamic";"default";"-";"bundle-fixed-url-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertBundlePriceView, assertBundlePriceType"
3-
"bundle_fixed_product";"bundle_dynamic_%isolation%";"Dynamic";"bundle_sku_%isolation%";"fixed-756";"Dynamic";"-";"default_subcategory";"-";"Separately";"default_fixed";"default";"Catalog, Search";"bundle-dynamic-url-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType"
1+
"description";"originalProduct/dataSet";"product/data/url_key";"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/price/value";"product/data/price/preset";"product/data/weight_type";"product/data/weight";"product/data/category_ids/presets";"product/data/description";"product/data/bundle_shipment_type";"product/data/bundle_selections/preset";"product/data/checkout_data/preset";"product/data/visibility";"constraint"
2+
"Update dynamic bundle product";"bundle_dynamic_product";"bundle-product-%isolation%";"bundle_dynamic_%isolation%";"Fixed";"bundle_dynamic_%isolation%";"-";"dynamic-100";"Fixed";"1";"-";"Bundle Product Fixed Required";"Together";"default_dynamic";"default";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertBundlePriceView, assertBundlePriceType"
3+
"Update fixed bundle product";"bundle_fixed_product";"bundle-product-%isolation%";"bundle_fixed_%isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"fixed-756";"Dynamic";"-";"default_subcategory";"-";"Separately";"default_fixed";"default";"Catalog, Search";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage, assertBundleProductForm, assertBundleProductPage, assertProductInStock, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType"
4+
"MAGETWO-12841: Edit Bundle Product (Fixed Price)";"bundle_fixed_with_category";"bundle-product-%isolation%";"bundle_fixed_%isolation%";"-";"bundle_sku_%isolation%";"120.00";"bundle_fixed_with_category";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleProductPage"
5+
"MAGETWO-12842: Edit Bundle (dynamic) Product";"bundle_dynamic_with_category";"bundle-product-%isolation%";"bundle_dynamic_%isolation%";"-";"bundle_sku_%isolation%";"-";"bundle_dynamic_with_category";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleProductPage"

dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,19 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, $data
4242
{
4343
$this->params = $params;
4444
if (isset($data['dataSet']) && $data['dataSet'] !== '-') {
45+
/** @var CatalogAttributeSet $attributeSet */
4546
$attributeSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataSet' => $data['dataSet']]);
47+
if (!$attributeSet->hasData('attribute_set_id')) {
48+
$attributeSet->persist();
49+
}
4650
}
4751
if (isset($data['attribute_set']) && $data['attribute_set'] instanceof CatalogAttributeSet) {
4852
$attributeSet = $data['attribute_set'];
4953
}
50-
/** @var CatalogAttributeSet $attributeSet */
5154
if (!isset($data['dataSet']) && !isset($data['attribute_set'])) {
5255
$this->data = $data;
5356
} else {
57+
/** @var CatalogAttributeSet $attributeSet */
5458
$this->data = $attributeSet->getAttributeSetName();
5559
$this->attributeSet = $attributeSet;
5660
}

0 commit comments

Comments
 (0)