Skip to content

Commit dfdb40d

Browse files
committed
Merge branch 'develop_mainline' into bugs
2 parents 95191b8 + 044bada commit dfdb40d

File tree

48 files changed

+541
-372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+541
-372
lines changed

app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
}
4343
">
4444
<div class="admin__action-multiselect-text"
45+
data-role="selected-option"
4546
data-bind="text: setCaption()">
4647
</div>
4748
</div>
@@ -121,7 +122,8 @@
121122
">
122123
<!-- ko foreach: { data: options, as: 'option'} -->
123124
<li class="admin__action-multiselect-menu-inner-item _root"
124-
data-bind="css: { _parent: $data.optgroup }">
125+
data-bind="css: { _parent: $data.optgroup }"
126+
data-role="option-group">
125127
<div class="action-menu-item"
126128
data-bind="
127129
css: {

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

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
use Magento\Mtf\Client\Element\SimpleElement;
1010
use Magento\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Bundle\Option;
1111
use Magento\Mtf\Client\Element;
12+
use Magento\Mtf\Client\ElementInterface;
13+
use Magento\Mtf\Client\Locator;
1214
use Magento\Ui\Test\Block\Adminhtml\Section;
1315

1416
/**
@@ -23,34 +25,47 @@ class Bundle extends Section
2325
*/
2426
protected $addNewOption = 'button[data-index="add_button"]';
2527

28+
/**
29+
* Bundle options locator.
30+
*
31+
* @var string
32+
*/
33+
protected $bundleOptions = './/*[@data-index="bundle_options"]/tbody';
34+
2635
/**
2736
* Open option section.
2837
*
2938
* @var string
3039
*/
31-
protected $openOption = '[data-index="bundle_options"] tbody tr:nth-child(%d) [data-role="collapsible-title"]';
40+
protected $openOption = './tr[%d]//*[@data-role="collapsible-title"]';
3241

3342
/**
3443
* Selector for option content.
3544
*
3645
* @var string
3746
*/
38-
protected $optionContent = '[data-index="bundle_options"] tbody tr:nth-child(%d) [data-role="collapsible-content"]';
47+
protected $optionContent = './tr[%d]//*[@data-role="collapsible-content"]';
48+
49+
/**
50+
* Locator for bundle option row.
51+
*
52+
* @var string
53+
*/
54+
protected $bundleOptionRow = './tr[%d]';
3955

4056
/**
4157
* Get bundle options block.
4258
*
43-
* @param int $blockNumber
59+
* @param int $rowNumber
60+
* @param ElementInterface $element
4461
* @return Option
4562
*/
46-
protected function getBundleOptionBlock($blockNumber)
63+
private function getBundleOptionBlock($rowNumber, ElementInterface $element)
4764
{
4865
return $this->blockFactory->create(
4966
'Magento\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Bundle\Option',
5067
[
51-
'element' => $this->_rootElement->find(
52-
sprintf('[data-index="bundle_options"] tbody tr:nth-child(%d)', $blockNumber)
53-
)
68+
'element' => $element->find(sprintf($this->bundleOptionRow, $rowNumber), Locator::SELECTOR_XPATH)
5469
]
5570
);
5671
}
@@ -68,16 +83,17 @@ public function setFieldsData(array $fields, SimpleElement $element = null)
6883
if (!isset($fields['bundle_selections'])) {
6984
return $this;
7085
}
86+
$context = $this->_rootElement->find($this->bundleOptions, Locator::SELECTOR_XPATH);
7187
foreach ($fields['bundle_selections']['value']['bundle_options'] as $key => $bundleOption) {
7288
$count = $key + 1;
73-
$itemOption = $this->_rootElement->find(sprintf($this->openOption, $count));
74-
$isContent = $this->_rootElement->find(sprintf($this->optionContent, $count))->isVisible();
89+
$itemOption = $context->find(sprintf($this->openOption, $count), Locator::SELECTOR_XPATH);
90+
$isContent = $context->find(sprintf($this->optionContent, $count), Locator::SELECTOR_XPATH)->isVisible();
7591
if ($itemOption->isVisible() && !$isContent) {
7692
$itemOption->click();
7793
} elseif (!$itemOption->isVisible()) {
7894
$this->_rootElement->find($this->addNewOption)->click();
7995
}
80-
$this->getBundleOptionBlock($count)->fillOption($bundleOption);
96+
$this->getBundleOptionBlock($count, $context)->fillOption($bundleOption);
8197
}
8298
return $this;
8399
}
@@ -96,15 +112,17 @@ public function getFieldsData($fields = null, SimpleElement $element = null)
96112
if (!isset($fields['bundle_selections'])) {
97113
return $this;
98114
}
99-
$index = 0;
115+
$index = 1;
116+
$context = $this->_rootElement->find($this->bundleOptions, Locator::SELECTOR_XPATH);
100117
foreach ($fields['bundle_selections']['value']['bundle_options'] as $key => &$bundleOption) {
101-
if (!$this->_rootElement->find(sprintf($this->optionContent, $key))->isVisible()) {
102-
$this->_rootElement->find(sprintf($this->openOption, $index))->click();
118+
if (!$context->find(sprintf($this->optionContent, $index), Locator::SELECTOR_XPATH)->isVisible()) {
119+
$context->find(sprintf($this->openOption, $index), Locator::SELECTOR_XPATH)->click();
103120
}
104121
foreach ($bundleOption['assigned_products'] as &$product) {
105122
$product['data']['getProductName'] = $product['search_data']['name'];
106123
}
107-
$newFields['bundle_selections'][$key] = $this->getBundleOptionBlock($key)->getOptionData($bundleOption);
124+
$newFields['bundle_selections'][$key] =
125+
$this->getBundleOptionBlock($index, $context)->getOptionData($bundleOption);
108126
$index++;
109127
}
110128

dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle/Option.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Option extends Form
2727
*
2828
* @var string
2929
*/
30-
protected $selectionBlock = '[data-index="bundle_selections"] tbody tr:nth-child(%d)';
30+
protected $selectionBlock = '[data-index="bundle_selections"] > tbody > tr:nth-child(%d)';
3131

3232
/**
3333
* Selector for 'Add Products to Option' button.
@@ -106,7 +106,7 @@ public function getOptionData(array $fields)
106106
$mapping = $this->dataMapping($fields);
107107
$newField = $this->_getData($mapping);
108108
foreach ($fields['assigned_products'] as $key => $field) {
109-
$newField['assigned_products'][$key] = $this->getSelectionBlock($key + 1)->getProductRow($field['data']);
109+
$newField['assigned_products'][$key] = $this->getSelectionBlock($key)->getProductRow($field['data']);
110110
}
111111
return $newField;
112112
}

dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/ProductForm.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<tabs>
8+
<sections>
99
<product-details>
10-
<class>\Magento\Ui\Test\Block\Adminhtml\Section</class>
11-
<selector>[data-index='product-details']</selector>
12-
<strategy>css selector</strategy>
13-
<wrapper>product</wrapper>
1410
<fields>
1511
<shipment_type>
1612
<input>select</input>
@@ -48,4 +44,4 @@
4844
</price_view>
4945
</fields>
5046
</advanced-pricing>
51-
</tabs>
47+
</sections>

dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AssertBundlePriceType extends AbstractConstraint
2222
*
2323
* @var string
2424
*/
25-
protected $productPriceType = 'Dynamic';
25+
protected $productPriceType = 'Yes';
2626

2727
/**
2828
* Assert that displayed price for bundle items on shopping cart page equals to passed from fixture.
@@ -79,7 +79,6 @@ protected function assertPrice(
7979
$cartItem = $checkoutCartView->getCartBlock()->getCartItem($product);
8080
$specialPrice = 0;
8181

82-
8382
$optionPrice = [];
8483
$fillData = $product->getCheckoutData();
8584
foreach ($fillData['options']['bundle_options'] as $key => $data) {
@@ -91,7 +90,7 @@ protected function assertPrice(
9190
}
9291
}
9392

94-
$optionPrice[$key]['price'] = $this->productPriceType == 'Fixed'
93+
$optionPrice[$key]['price'] = $this->productPriceType == 'No'
9594
? number_format(
9695
$bundleData['bundle_selections']['bundle_options'][$key]['assigned_products'][$data['value']['key']]
9796
['data']['selection_price_value'],

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
<field name="description" is_required="0" group="content" />
3535
<field name="enable_googlecheckout" is_required="0" />
3636
<field name="gallery" is_required="0" />
37-
<field name="gift_message_available" is_required="0" group="autosettings" />
38-
<field name="use_config_gift_message_available" is_required="0" group="autosettings" />
37+
<field name="gift_message_available" is_required="0" group="gift-options" />
38+
<field name="use_config_gift_message_available" is_required="0" group="gift-options" />
3939
<field name="has_options" is_required="0" />
4040
<field name="image" is_required="0" />
4141
<field name="image_label" is_required="0" />
@@ -80,7 +80,7 @@
8080
<field name="updated_at" is_required="1" />
8181
<field name="url_key" is_required="0" group="search-engine-optimization" />
8282
<field name="url_path" is_required="0" />
83-
<field name="visibility" is_required="0" group="autosettings" />
83+
<field name="visibility" is_required="0" group="product-details" />
8484
<field name="id" />
8585
<field name="bundle_selections" is_required="1" group="bundle" source="Magento\Bundle\Test\Fixture\BundleProduct\BundleSelections" repository="Magento\Bundle\Test\Repository\BundleProduct\BundleSelection" />
8686
<field name="checkout_data" is_required="1" group="null" repository="Magento\Bundle\Test\Repository\BundleProduct\CheckoutData" />

dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/BundleProduct/Curl.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ public function __construct(DataInterface $configuration, EventManagerInterface
3232
'No' => 0,
3333
],
3434
'sku_type' => [
35-
'Dynamic' => 0,
36-
'Fixed' => 1,
35+
'Yes' => 0,
36+
'No' => 1,
3737
],
3838
'price_type' => [
39-
'Dynamic' => 0,
40-
'Fixed' => 1,
39+
'Yes' => 0,
40+
'No' => 1,
4141
],
4242
'weight_type' => [
43-
'Dynamic' => 0,
44-
'Fixed' => 1,
43+
'Yes' => 0,
44+
'No' => 1,
4545
],
4646
'shipment_type' => [
4747
'Together' => 0,

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

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<field name="name" xsi:type="string">Bundle dynamic product %isolation%</field>
1212
<field name="url_key" xsi:type="string">bundle-dynamic-product-%isolation%</field>
1313
<field name="sku" xsi:type="string">sku_bundle_dynamic_product_%isolation%</field>
14-
<field name="sku_type" xsi:type="string">Dynamic</field>
15-
<field name="price_type" xsi:type="string">Dynamic</field>
14+
<field name="sku_type" xsi:type="string">Yes</field>
15+
<field name="price_type" xsi:type="string">Yes</field>
1616
<field name="price" xsi:type="array">
1717
<item name="dataset" xsi:type="string">bundle_dynamic_with_category</item>
1818
</field>
@@ -30,15 +30,15 @@
3030
<dataset name="bundle_dynamic_product">
3131
<field name="name" xsi:type="string">Bundle dynamic product %isolation%</field>
3232
<field name="sku" xsi:type="string">sku_bundle_dynamic_product_%isolation%</field>
33-
<field name="sku_type" xsi:type="string">Dynamic</field>
34-
<field name="price_type" xsi:type="string">Dynamic</field>
33+
<field name="sku_type" xsi:type="string">Yes</field>
34+
<field name="price_type" xsi:type="string">Yes</field>
3535
<field name="price" xsi:type="array">
3636
<item name="dataset" xsi:type="string">default_dynamic</item>
3737
</field>
3838
<field name="quantity_and_stock_status" xsi:type="array">
3939
<item name="is_in_stock" xsi:type="string">In Stock</item>
4040
</field>
41-
<field name="weight_type" xsi:type="string">Dynamic</field>
41+
<field name="weight_type" xsi:type="string">Yes</field>
4242
<field name="shipment_type" xsi:type="string">Separately</field>
4343
<field name="tax_class_id" xsi:type="array">
4444
<item name="dataset" xsi:type="string">taxable_goods</item>
@@ -66,8 +66,8 @@
6666
<dataset name="bundle_fixed_product">
6767
<field name="name" xsi:type="string">Bundle fixed product %isolation%</field>
6868
<field name="sku" xsi:type="string">sku_bundle_fixed_product_%isolation%</field>
69-
<field name="sku_type" xsi:type="string">Fixed</field>
70-
<field name="price_type" xsi:type="string">Fixed</field>
69+
<field name="sku_type" xsi:type="string">No</field>
70+
<field name="price_type" xsi:type="string">No</field>
7171
<field name="price" xsi:type="array">
7272
<item name="value" xsi:type="string">750</item>
7373
<item name="dataset" xsi:type="string">default_fixed</item>
@@ -79,8 +79,7 @@
7979
<item name="is_in_stock" xsi:type="string">In Stock</item>
8080
</field>
8181
<field name="weight" xsi:type="string">1</field>
82-
<field name="weight_type" xsi:type="string">Fixed</field>
83-
<field name="product_has_weight" xsi:type="string">Yes</field>
82+
<field name="weight_type" xsi:type="string">No</field>
8483
<field name="status" xsi:type="string">Yes</field>
8584
<field name="shipment_type" xsi:type="string">Together</field>
8685
<field name="website_ids" xsi:type="array">
@@ -107,17 +106,16 @@
107106
<field name="name" xsi:type="string">Bundle fixed product %isolation%</field>
108107
<field name="url_key" xsi:type="string">bundle-fixed-product-%isolation%</field>
109108
<field name="sku" xsi:type="string">sku_bundle_fixed_product_%isolation%</field>
110-
<field name="sku_type" xsi:type="string">Fixed</field>
111-
<field name="price_type" xsi:type="string">Fixed</field>
109+
<field name="sku_type" xsi:type="string">No</field>
110+
<field name="price_type" xsi:type="string">No</field>
112111
<field name="price" xsi:type="array">
113112
<item name="value" xsi:type="string">100</item>
114113
</field>
115114
<field name="tax_class_id" xsi:type="array">
116115
<item name="dataset" xsi:type="string">taxable_goods</item>
117116
</field>
118117
<field name="weight" xsi:type="string">1</field>
119-
<field name="weight_type" xsi:type="string">Fixed</field>
120-
<field name="product_has_weight" xsi:type="string">Yes</field>
118+
<field name="weight_type" xsi:type="string">No</field>
121119
<field name="website_ids" xsi:type="array">
122120
<item name="0" xsi:type="string">Main Website</item>
123121
</field>
@@ -133,8 +131,8 @@
133131
<field name="name" xsi:type="string">Bundle dynamic product %isolation%</field>
134132
<field name="url_key" xsi:type="string">bundle-dynamic-product-%isolation%</field>
135133
<field name="sku" xsi:type="string">sku_bundle_dynamic_product_%isolation%</field>
136-
<field name="sku_type" xsi:type="string">Dynamic</field>
137-
<field name="price_type" xsi:type="string">Dynamic</field>
134+
<field name="sku_type" xsi:type="string">Yes</field>
135+
<field name="price_type" xsi:type="string">Yes</field>
138136
<field name="price" xsi:type="array">
139137
<item name="dataset" xsi:type="string">bundle_dynamic_with_category</item>
140138
</field>
@@ -153,17 +151,16 @@
153151
<field name="name" xsi:type="string">Bundle fixed product %isolation%</field>
154152
<field name="url_key" xsi:type="string">bundle-fixed-product-%isolation%</field>
155153
<field name="sku" xsi:type="string">sku_bundle_fixed_product_%isolation%</field>
156-
<field name="sku_type" xsi:type="string">Fixed</field>
157-
<field name="price_type" xsi:type="string">Fixed</field>
154+
<field name="sku_type" xsi:type="string">No</field>
155+
<field name="price_type" xsi:type="string">No</field>
158156
<field name="price" xsi:type="array">
159157
<item name="value" xsi:type="string">100</item>
160158
</field>
161159
<field name="tax_class_id" xsi:type="array">
162160
<item name="dataset" xsi:type="string">taxable_goods</item>
163161
</field>
164162
<field name="weight" xsi:type="string">1</field>
165-
<field name="weight_type" xsi:type="string">Fixed</field>
166-
<field name="product_has_weight" xsi:type="string">Yes</field>
163+
<field name="weight_type" xsi:type="string">No</field>
167164
<field name="website_ids" xsi:type="array">
168165
<item name="0" xsi:type="string">Main Website</item>
169166
</field>
@@ -179,8 +176,8 @@
179176
<dataset name="bundle_fixed_100_dollar_product">
180177
<field name="name" xsi:type="string">Bundle fixed product %isolation%</field>
181178
<field name="sku" xsi:type="string">sku_bundle_fixed_product_%isolation%</field>
182-
<field name="sku_type" xsi:type="string">Fixed</field>
183-
<field name="price_type" xsi:type="string">Fixed</field>
179+
<field name="sku_type" xsi:type="string">No</field>
180+
<field name="price_type" xsi:type="string">No</field>
184181
<field name="price" xsi:type="array">
185182
<item name="value" xsi:type="string">100</item>
186183
<item name="dataset" xsi:type="string">fixed_100_dollar</item>
@@ -192,8 +189,7 @@
192189
<item name="is_in_stock" xsi:type="string">In Stock</item>
193190
</field>
194191
<field name="weight" xsi:type="string">1</field>
195-
<field name="weight_type" xsi:type="string">Fixed</field>
196-
<field name="product_has_weight" xsi:type="string">Yes</field>
192+
<field name="weight_type" xsi:type="string">No</field>
197193
<field name="status" xsi:type="string">Yes</field>
198194
<field name="shipment_type" xsi:type="string">Together</field>
199195
<field name="website_ids" xsi:type="array">

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
<data name="originalProduct/dataset" xsi:type="string">bundle_dynamic_product</data>
1313
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
1414
<data name="product/data/name" xsi:type="string">bundle_dynamic_%isolation%</data>
15-
<data name="product/data/sku_type" xsi:type="string">Fixed</data>
15+
<data name="product/data/sku_type" xsi:type="string">No</data>
1616
<data name="product/data/sku" xsi:type="string">bundle_dynamic_%isolation%</data>
1717
<data name="product/data/price/dataset" xsi:type="string">dynamic-100</data>
18-
<data name="product/data/weight_type" xsi:type="string">Fixed</data>
18+
<data name="product/data/weight_type" xsi:type="string">No</data>
1919
<data name="product/data/weight" xsi:type="string">1</data>
2020
<data name="product/data/description" xsi:type="string">Bundle Product Fixed Required</data>
2121
<data name="product/data/bundle_shipment_type" xsi:type="string">Together</data>
@@ -35,10 +35,10 @@
3535
<data name="originalProduct/dataset" xsi:type="string">bundle_fixed_product</data>
3636
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
3737
<data name="product/data/name" xsi:type="string">bundle_fixed_%isolation%</data>
38-
<data name="product/data/sku_type" xsi:type="string">Dynamic</data>
38+
<data name="product/data/sku_type" xsi:type="string">Yes</data>
3939
<data name="product/data/sku" xsi:type="string">bundle_sku_%isolation%</data>
4040
<data name="product/data/price/dataset" xsi:type="string">fixed-756</data>
41-
<data name="product/data/weight_type" xsi:type="string">Dynamic</data>
41+
<data name="product/data/weight_type" xsi:type="string">Yes</data>
4242
<data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data>
4343
<data name="product/data/bundle_shipment_type" xsi:type="string">Separately</data>
4444
<data name="product/data/bundle_selections/dataset" xsi:type="string">default_fixed</data>

0 commit comments

Comments
 (0)