Skip to content

Commit 5e0aeea

Browse files
committed
Merge pull request #118 from magento-mpi/MTA-556
[MPI] Refactor end-to-end functional tests
2 parents f4121a4 + 6d830b2 commit 5e0aeea

File tree

34 files changed

+805
-117
lines changed

34 files changed

+805
-117
lines changed

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,44 @@ protected function getPreset($name)
190190
],
191191
],
192192
],
193+
194+
'fixed_100_dollar' => [
195+
'bundle_options' => [
196+
[
197+
'title' => 'Drop-down Option',
198+
'type' => 'Drop-down',
199+
'required' => 'Yes',
200+
'assigned_products' => [
201+
[
202+
'search_data' => [
203+
'name' => '%product_name%',
204+
],
205+
'data' => [
206+
'selection_price_value' => 10.00,
207+
'selection_price_type' => 'Fixed',
208+
'selection_qty' => 1,
209+
],
210+
],
211+
[
212+
'search_data' => [
213+
'name' => '%product_name%',
214+
],
215+
'data' => [
216+
'selection_price_value' => 560.00,
217+
'selection_price_type' => 'Fixed',
218+
'selection_qty' => 1,
219+
]
220+
],
221+
],
222+
],
223+
],
224+
'products' => [
225+
[
226+
'catalogProductSimple::product_10_dollar',
227+
'catalogProductSimple::default',
228+
],
229+
],
230+
],
193231

194232
'second' => [
195233
'bundle_options' => [

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,25 @@ protected function getPreset($name)
7777
'subtotal' => 756,
7878
],
7979
],
80+
'fixed_100_dollar' => [
81+
'options' => [
82+
'bundle_options' => [
83+
[
84+
'title' => 'Drop-down Option',
85+
'type' => 'Drop-down',
86+
'value' => [
87+
'name' => 'product_10_dollar',
88+
],
89+
],
90+
],
91+
],
92+
'qty' => 1,
93+
'cartItem' => [
94+
'price' => 110,
95+
'qty' => 1,
96+
'subtotal' => 110,
97+
],
98+
],
8099
'forUpdateMiniShoppingCart' => [
81100
'options' => [
82101
'bundle_options' => [

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,5 +203,45 @@
203203
<item name="preset" xsi:type="string">required_two_fixed_options</item>
204204
</field>
205205
</dataset>
206+
207+
<dataset name="bundle_fixed_100_dollar_product">
208+
<field name="name" xsi:type="string">Bundle fixed product %isolation%</field>
209+
<field name="sku" xsi:type="string">sku_bundle_fixed_product_%isolation%</field>
210+
<field name="sku_type" xsi:type="string">Fixed</field>
211+
<field name="price_type" xsi:type="string">Fixed</field>
212+
<field name="price" xsi:type="array">
213+
<item name="value" xsi:type="string">100</item>
214+
<item name="preset" xsi:type="string">fixed_100_dollar</item>
215+
</field>
216+
<field name="tax_class_id" xsi:type="array">
217+
<item name="dataSet" xsi:type="string">taxable_goods</item>
218+
</field>
219+
<field name="quantity_and_stock_status" xsi:type="array">
220+
<item name="qty" xsi:type="string">666</item>
221+
<item name="is_in_stock" xsi:type="string">In Stock</item>
222+
</field>
223+
<field name="weight" xsi:type="string">1</field>
224+
<field name="weight_type" xsi:type="string">Fixed</field>
225+
<field name="status" xsi:type="string">Product online</field>
226+
<field name="shipment_type" xsi:type="string">Together</field>
227+
<field name="website_ids" xsi:type="array">
228+
<item name="0" xsi:type="string">Main Website</item>
229+
</field>
230+
<field name="stock_data" xsi:type="array">
231+
<item name="manage_stock" xsi:type="string">Yes</item>
232+
<item name="use_config_enable_qty_increments" xsi:type="string">Yes</item>
233+
<item name="use_config_qty_increments" xsi:type="string">Yes</item>
234+
<item name="is_in_stock" xsi:type="string">In Stock</item>
235+
</field>
236+
<field name="url_key" xsi:type="string">bundle-fixed-product-%isolation%</field>
237+
<field name="visibility" xsi:type="string">Catalog, Search</field>
238+
<field name="bundle_selections" xsi:type="array">
239+
<item name="preset" xsi:type="string">fixed_100_dollar</item>
240+
</field>
241+
<field name="attribute_set_id" xsi:type="string">Default</field>
242+
<field name="checkout_data" xsi:type="array">
243+
<item name="preset" xsi:type="string">fixed_100_dollar</item>
244+
</field>
245+
</dataset>
206246
</storage>
207247
</repository>

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,10 @@ protected function getPreset($name)
173173
],
174174
'order_default' => [
175175
'qty' => 1,
176-
'cartItem' => [],
176+
'cartItem' => [
177+
'price' => 560,
178+
'subtotal' => 560,
179+
],
177180
],
178181
'two_products' => [
179182
'qty' => 2,
@@ -193,6 +196,20 @@ protected function getPreset($name)
193196
],
194197
'cartItem' => [],
195198
],
199+
'order_special_price' => [
200+
'qty' => 1,
201+
'cartItem' => [
202+
'price' => 9,
203+
'subtotal' => 9,
204+
],
205+
],
206+
'order_10_dollar_product' => [
207+
'qty' => 1,
208+
'cartItem' => [
209+
'price' => 10,
210+
'subtotal' => 10,
211+
],
212+
]
196213
];
197214
return isset($presets[$name]) ? $presets[$name] : [];
198215
}

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,35 @@
3636
</field>
3737
</dataset>
3838

39+
<dataset name="product_10_dollar">
40+
<field name="attribute_set_id" xsi:type="array">
41+
<item name="dataSet" xsi:type="string">default</item>
42+
</field>
43+
<field name="name" xsi:type="string">product_10_dollar %isolation%</field>
44+
<field name="sku" xsi:type="string">sku_product_10_dollar_%isolation%</field>
45+
<field name="is_virtual" xsi:type="string">No</field>
46+
<field name="weight" xsi:type="string">1</field>
47+
<field name="quantity_and_stock_status" xsi:type="array">
48+
<item name="qty" xsi:type="string">1000</item>
49+
<item name="is_in_stock" xsi:type="string">In Stock</item>
50+
</field>
51+
<field name="price" xsi:type="array">
52+
<item name="value" xsi:type="string">10</item>
53+
<item name="preset" xsi:type="string">-</item>
54+
</field>
55+
<field name="tax_class_id" xsi:type="array">
56+
<item name="dataSet" xsi:type="string">taxable_goods</item>
57+
</field>
58+
<field name="website_ids" xsi:type="array">
59+
<item name="0" xsi:type="string">Main Website</item>
60+
</field>
61+
<field name="visibility" xsi:type="string">Catalog, Search</field>
62+
<field name="url_key" xsi:type="string">product-10-dollar-%isolation%</field>
63+
<field name="checkout_data" xsi:type="array">
64+
<item name="preset" xsi:type="string">order_10_dollar_product</item>
65+
</field>
66+
</dataset>
67+
3968
<dataset name="product_with_url_key">
4069
<field name="name" xsi:type="string">Simple Product %isolation%</field>
4170
<field name="sku" xsi:type="string">sku_simple_product_%isolation%</field>
@@ -342,6 +371,9 @@
342371
<item name="0" xsi:type="string">Main Website</item>
343372
</field>
344373
<field name="url_key" xsi:type="string">simple-product-%isolation%</field>
374+
<field name="checkout_data" xsi:type="array">
375+
<item name="preset" xsi:type="string">order_special_price</item>
376+
</field>
345377
</dataset>
346378

347379
<dataset name="adc_123_simple_for_advancedsearch">

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ public function __prepare(Category $category)
5757
/**
5858
* Run create product simple entity test.
5959
*
60-
* @param string $configData
6160
* @param CatalogProductSimple $product
6261
* @param Category $category
6362
* @param CatalogProductIndex $productGrid
6463
* @param CatalogProductNew $newProductPage
64+
* @param string $configData
6565
* @return array
6666
*/
6767
public function testCreate(
68-
$configData,
6968
CatalogProductSimple $product,
7069
Category $category,
7170
CatalogProductIndex $productGrid,
72-
CatalogProductNew $newProductPage
71+
CatalogProductNew $newProductPage,
72+
$configData = null
7373
) {
7474
$this->configData = $configData;
7575

0 commit comments

Comments
 (0)