Skip to content

Commit

Permalink
Merge pull request magento#118 from magento-mpi/MTA-556
Browse files Browse the repository at this point in the history
[MPI] Refactor end-to-end functional tests
  • Loading branch information
vpelipenko committed Mar 3, 2015
2 parents f4121a4 + 6d830b2 commit 5e0aeea
Show file tree
Hide file tree
Showing 34 changed files with 805 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,44 @@ protected function getPreset($name)
],
],
],

'fixed_100_dollar' => [
'bundle_options' => [
[
'title' => 'Drop-down Option',
'type' => 'Drop-down',
'required' => 'Yes',
'assigned_products' => [
[
'search_data' => [
'name' => '%product_name%',
],
'data' => [
'selection_price_value' => 10.00,
'selection_price_type' => 'Fixed',
'selection_qty' => 1,
],
],
[
'search_data' => [
'name' => '%product_name%',
],
'data' => [
'selection_price_value' => 560.00,
'selection_price_type' => 'Fixed',
'selection_qty' => 1,
]
],
],
],
],
'products' => [
[
'catalogProductSimple::product_10_dollar',
'catalogProductSimple::default',
],
],
],

'second' => [
'bundle_options' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ protected function getPreset($name)
'subtotal' => 756,
],
],
'fixed_100_dollar' => [
'options' => [
'bundle_options' => [
[
'title' => 'Drop-down Option',
'type' => 'Drop-down',
'value' => [
'name' => 'product_10_dollar',
],
],
],
],
'qty' => 1,
'cartItem' => [
'price' => 110,
'qty' => 1,
'subtotal' => 110,
],
],
'forUpdateMiniShoppingCart' => [
'options' => [
'bundle_options' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,45 @@
<item name="preset" xsi:type="string">required_two_fixed_options</item>
</field>
</dataset>

<dataset name="bundle_fixed_100_dollar_product">
<field name="name" xsi:type="string">Bundle fixed product %isolation%</field>
<field name="sku" xsi:type="string">sku_bundle_fixed_product_%isolation%</field>
<field name="sku_type" xsi:type="string">Fixed</field>
<field name="price_type" xsi:type="string">Fixed</field>
<field name="price" xsi:type="array">
<item name="value" xsi:type="string">100</item>
<item name="preset" xsi:type="string">fixed_100_dollar</item>
</field>
<field name="tax_class_id" xsi:type="array">
<item name="dataSet" xsi:type="string">taxable_goods</item>
</field>
<field name="quantity_and_stock_status" xsi:type="array">
<item name="qty" xsi:type="string">666</item>
<item name="is_in_stock" xsi:type="string">In Stock</item>
</field>
<field name="weight" xsi:type="string">1</field>
<field name="weight_type" xsi:type="string">Fixed</field>
<field name="status" xsi:type="string">Product online</field>
<field name="shipment_type" xsi:type="string">Together</field>
<field name="website_ids" xsi:type="array">
<item name="0" xsi:type="string">Main Website</item>
</field>
<field name="stock_data" xsi:type="array">
<item name="manage_stock" xsi:type="string">Yes</item>
<item name="use_config_enable_qty_increments" xsi:type="string">Yes</item>
<item name="use_config_qty_increments" xsi:type="string">Yes</item>
<item name="is_in_stock" xsi:type="string">In Stock</item>
</field>
<field name="url_key" xsi:type="string">bundle-fixed-product-%isolation%</field>
<field name="visibility" xsi:type="string">Catalog, Search</field>
<field name="bundle_selections" xsi:type="array">
<item name="preset" xsi:type="string">fixed_100_dollar</item>
</field>
<field name="attribute_set_id" xsi:type="string">Default</field>
<field name="checkout_data" xsi:type="array">
<item name="preset" xsi:type="string">fixed_100_dollar</item>
</field>
</dataset>
</storage>
</repository>
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ protected function getPreset($name)
],
'order_default' => [
'qty' => 1,
'cartItem' => [],
'cartItem' => [
'price' => 560,
'subtotal' => 560,
],
],
'two_products' => [
'qty' => 2,
Expand All @@ -193,6 +196,20 @@ protected function getPreset($name)
],
'cartItem' => [],
],
'order_special_price' => [
'qty' => 1,
'cartItem' => [
'price' => 9,
'subtotal' => 9,
],
],
'order_10_dollar_product' => [
'qty' => 1,
'cartItem' => [
'price' => 10,
'subtotal' => 10,
],
]
];
return isset($presets[$name]) ? $presets[$name] : [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,35 @@
</field>
</dataset>

<dataset name="product_10_dollar">
<field name="attribute_set_id" xsi:type="array">
<item name="dataSet" xsi:type="string">default</item>
</field>
<field name="name" xsi:type="string">product_10_dollar %isolation%</field>
<field name="sku" xsi:type="string">sku_product_10_dollar_%isolation%</field>
<field name="is_virtual" xsi:type="string">No</field>
<field name="weight" xsi:type="string">1</field>
<field name="quantity_and_stock_status" xsi:type="array">
<item name="qty" xsi:type="string">1000</item>
<item name="is_in_stock" xsi:type="string">In Stock</item>
</field>
<field name="price" xsi:type="array">
<item name="value" xsi:type="string">10</item>
<item name="preset" xsi:type="string">-</item>
</field>
<field name="tax_class_id" xsi:type="array">
<item name="dataSet" xsi:type="string">taxable_goods</item>
</field>
<field name="website_ids" xsi:type="array">
<item name="0" xsi:type="string">Main Website</item>
</field>
<field name="visibility" xsi:type="string">Catalog, Search</field>
<field name="url_key" xsi:type="string">product-10-dollar-%isolation%</field>
<field name="checkout_data" xsi:type="array">
<item name="preset" xsi:type="string">order_10_dollar_product</item>
</field>
</dataset>

<dataset name="product_with_url_key">
<field name="name" xsi:type="string">Simple Product %isolation%</field>
<field name="sku" xsi:type="string">sku_simple_product_%isolation%</field>
Expand Down Expand Up @@ -342,6 +371,9 @@
<item name="0" xsi:type="string">Main Website</item>
</field>
<field name="url_key" xsi:type="string">simple-product-%isolation%</field>
<field name="checkout_data" xsi:type="array">
<item name="preset" xsi:type="string">order_special_price</item>
</field>
</dataset>

<dataset name="adc_123_simple_for_advancedsearch">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ public function __prepare(Category $category)
/**
* Run create product simple entity test.
*
* @param string $configData
* @param CatalogProductSimple $product
* @param Category $category
* @param CatalogProductIndex $productGrid
* @param CatalogProductNew $newProductPage
* @param string $configData
* @return array
*/
public function testCreate(
$configData,
CatalogProductSimple $product,
Category $category,
CatalogProductIndex $productGrid,
CatalogProductNew $newProductPage
CatalogProductNew $newProductPage,
$configData = null
) {
$this->configData = $configData;

Expand Down
Loading

0 comments on commit 5e0aeea

Please sign in to comment.