From b4dbb6ee2c1581d8e749789d8067c3d3052c9c29 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Fri, 19 Feb 2016 19:09:06 +0200 Subject: [PATCH 01/17] MAGETWO-49390: Stabilize MX domain functional tests --- .../grid/filters/elements/ui-select.html | 1 + .../Catalog/Product/Edit/Section/Bundle.php | 27 +++++--- .../Product/Edit/Section/Bundle/Option.php | 4 +- .../Bundle/Test/Fixture/BundleProduct.xml | 6 +- .../Product/Edit/Section/Options.php | 44 ++++++++++--- .../Product/Edit/Section/Options/Type.php | 14 ++++- .../Section/ProductDetails/AttributeSet.php | 63 +++---------------- .../Block/Adminhtml/Product/ProductForm.xml | 4 +- .../Test/Fixture/CatalogProductSimple.xml | 2 +- .../Product/UpdateSimpleProductEntityTest.xml | 14 ++--- .../Test/Fixture/ConfigurableProduct.xml | 2 +- .../Test/Fixture/DownloadableProduct.xml | 3 +- .../Ui/Test/Block/Adminhtml/FormSections.php | 2 +- 13 files changed, 93 insertions(+), 93 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html index b8a5b8a05976..facdc717979b 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html @@ -42,6 +42,7 @@ } ">
diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php index 04419af326aa..f9315c0cc596 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php @@ -28,29 +28,36 @@ class Bundle extends Section * * @var string */ - protected $openOption = '[data-index="bundle_options"] tbody tr:nth-child(%d) [data-role="collapsible-title"]'; + protected $openOption = + '[data-index="bundle_options"] > tbody > tr:nth-child(%d) [data-role="collapsible-title"]'; /** * Selector for option content. * * @var string */ - protected $optionContent = '[data-index="bundle_options"] tbody tr:nth-child(%d) [data-role="collapsible-content"]'; + protected $optionContent = + '[data-index="bundle_options"] > tbody > tr:nth-child(%d) [data-role="collapsible-content"]'; + + /** + * Locator for bundle option row. + * + * @var string + */ + protected $bundleOption = '[data-index="bundle_options"] > tbody > tr:nth-child(%d)'; /** * Get bundle options block. * - * @param int $blockNumber + * @param int $rowNumber * @return Option */ - protected function getBundleOptionBlock($blockNumber) + protected function getBundleOptionBlock($rowNumber) { return $this->blockFactory->create( 'Magento\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Bundle\Option', [ - 'element' => $this->_rootElement->find( - sprintf('[data-index="bundle_options"] tbody tr:nth-child(%d)', $blockNumber) - ) + 'element' => $this->_rootElement->find(sprintf($this->bundleOption, $rowNumber)) ] ); } @@ -96,15 +103,15 @@ public function getFieldsData($fields = null, SimpleElement $element = null) if (!isset($fields['bundle_selections'])) { return $this; } - $index = 0; + $index = 1; foreach ($fields['bundle_selections']['value']['bundle_options'] as $key => &$bundleOption) { - if (!$this->_rootElement->find(sprintf($this->optionContent, $key))->isVisible()) { + if (!$this->_rootElement->find(sprintf($this->optionContent, $index))->isVisible()) { $this->_rootElement->find(sprintf($this->openOption, $index))->click(); } foreach ($bundleOption['assigned_products'] as &$product) { $product['data']['getProductName'] = $product['search_data']['name']; } - $newFields['bundle_selections'][$key] = $this->getBundleOptionBlock($key)->getOptionData($bundleOption); + $newFields['bundle_selections'][$key] = $this->getBundleOptionBlock($index)->getOptionData($bundleOption); $index++; } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle/Option.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle/Option.php index 8b6668775dd6..79d363f4f1e9 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle/Option.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle/Option.php @@ -27,7 +27,7 @@ class Option extends Form * * @var string */ - protected $selectionBlock = '[data-index="bundle_selections"] tbody tr:nth-child(%d)'; + protected $selectionBlock = '[data-index="bundle_selections"] > tbody > tr:nth-child(%d)'; /** * Selector for 'Add Products to Option' button. @@ -106,7 +106,7 @@ public function getOptionData(array $fields) $mapping = $this->dataMapping($fields); $newField = $this->_getData($mapping); foreach ($fields['assigned_products'] as $key => $field) { - $newField['assigned_products'][$key] = $this->getSelectionBlock($key + 1)->getProductRow($field['data']); + $newField['assigned_products'][$key] = $this->getSelectionBlock($key)->getProductRow($field['data']); } return $newField; } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml index f83dd6192d0c..81e4d66fa8e7 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml @@ -34,8 +34,8 @@ - - + + @@ -80,7 +80,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php index a004b0ca67c6..fe831814b51c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php @@ -23,14 +23,14 @@ class Options extends Section * * @var string */ - protected $customOptionRow = '//*[*[@class="fieldset-wrapper-title"]//span[.="%s"]]'; + protected $customOptionRow = './/*[*[@class="fieldset-wrapper-title"]//span[.="%s"]]'; /** - * New custom option row CSS locator. + * New custom option row locator. * * @var string */ - protected $newCustomOptionRow = '[data-index="custom_options"] [data-role="grid"] tbody tr:nth-child(%d)'; + protected $newCustomOptionRow = './/*[@data-index="options"]/tbody/tr[%d]'; /** * Add an option button. @@ -53,6 +53,27 @@ class Options extends Section */ protected $importGrid = ".product_form_product_form_custom_options_import_options_modal"; + /** + * Locator for 'Add Value' button. + * + * @var string + */ + protected $addValue = '[data-action="add_new_row"]'; + + /** + * Locator for dynamic data row. + * + * @var string + */ + protected $dynamicDataRow = '[data-index="values"] tbody tr:nth-child(%d)'; + + /** + * Locator for static data row. + * + * @var string + */ + protected $staticDataRow = '[data-index="container_type_static"] div:nth-child(%d)'; + /** * Fill custom options form on tab. * @@ -81,7 +102,10 @@ public function setFieldsData(array $fields, SimpleElement $element = null) unset($field['options']); } - $rootElement = $this->_rootElement->find(sprintf($this->newCustomOptionRow, $keyRoot + 1)); + $rootElement = $this->_rootElement->find( + sprintf($this->newCustomOptionRow, $keyRoot + 1), + Locator::SELECTOR_XPATH + ); $data = $this->dataMapping($field); $this->_fill($data, $rootElement); @@ -92,12 +116,14 @@ public function setFieldsData(array $fields, SimpleElement $element = null) __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($field['type']), ['element' => $rootElement] ); - + $context = $rootElement->find($this->addValue)->isVisible() + ? $this->dynamicDataRow + : $this->staticDataRow; foreach ($options as $key => $option) { ++$key; $optionsForm->fillOptions( $option, - $rootElement->find('[data-index="values"] tbody tr:nth-child(' . $key . ')') + $rootElement->find(sprintf($context, $key)) ); } } @@ -177,11 +203,13 @@ public function getFieldsData($tabFields = null, SimpleElement $element = null) __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($field['type']), ['element' => $rootElement] ); - + $context = $rootElement->find($this->addValue)->isVisible() + ? $this->dynamicDataRow + : $this->staticDataRow; foreach ($options as $key => $option) { $formDataItem['options'][$key++] = $optionsForm->getDataOptions( $option, - $rootElement->find('.fieldset .data-table tbody tr:nth-child(' . $key . ')') + $rootElement->find(sprintf($context, $key)) ); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Type.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Type.php index c335929a6991..c9042494d8a2 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Type.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Type.php @@ -18,14 +18,14 @@ class Type extends OptgroupselectElement * * @var string */ - protected $optGroup = './/*/*/*/ul/li/div/label/span/ancestor::li/ul/li/div/label[text() = "%s"]'; + protected $optGroup = './/*[@data-role="option-group" and *//*[contains(.,"%s")]]//span'; /** * Option group locator. * * @var string */ - protected $optGroupValue = './/*/*/*/ul/li/div/label/span[text()="%s"]/ancestor::li/ul/li/div/label[text() = "%s"]'; + protected $optGroupValue = './/*[@data-role="option-group" and div[contains(.,"%s")]]//label[text()="%s"]'; /** * Locator for Advanced Select element @@ -34,6 +34,13 @@ class Type extends OptgroupselectElement */ protected $advancedSelect = '[data-role="advanced-select"]'; + /** + * Selector for selected option. + * + * @var string + */ + protected $selectedOption = '[data-role="selected-option"]'; + /** * Get element data. * @@ -42,7 +49,8 @@ class Type extends OptgroupselectElement */ protected function getData(ElementInterface $element) { - return trim($element->getValue(), chr(0xC2) . chr(0xA0)); + $this->find($this->advancedSelect)->click(); + return trim($element->getText()); } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php index e0aac594a76a..6aea585552ca 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php @@ -10,87 +10,44 @@ use Magento\Mtf\Client\Locator; /** - * Class AttributeSet - * Set and Get Attribute Set on the Product form + * Set and Get Attribute Set on the Product form. */ class AttributeSet extends SuggestElement { /** - * Attribute Set locator + * Attribute Set locator. * * @var string */ - protected $value = '.action-toggle > span'; + protected $attributeSet = './/div[text()="%s"]'; /** - * Attribute Set button + * Attribute Set value locator. * * @var string */ - protected $actionToggle = '.action-toggle'; + protected $attributeSetValue = '[data-role="selected-option"]'; /** - * Magento loader - * - * @var string - */ - protected $loader = '[data-role="loader"]'; - - /** - * Page header selector. - * - * @var string - */ - protected $header = 'header'; - - /** - * Set value + * Set value. * * @param string $value * @return void */ public function setValue($value) { - if ($value !== $this->find($this->actionToggle)->getText()) { - $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $this->find($this->actionToggle)->click(); - $this->clear(); - if ($value == '') { - return; - } - foreach (str_split($value) as $symbol) { - $this->keys([$symbol]); - $searchedItem = $this->find(sprintf($this->resultItem, $value), Locator::SELECTOR_XPATH); - if ($searchedItem->isVisible()) { - try { - $searchedItem->hover(); - $this->driver->find($this->header)->hover(); - $searchedItem->click(); - break; - } catch (\Exception $e) { - // In parallel run on windows change the focus is lost on element - // that causes disappearing of category suggest list. - } - } - } + if (!$this->context->find(sprintf($this->attributeSet, $value), Locator::SELECTOR_XPATH)) { + parent::setValue($value); } - // Wait loader - $element = $this->driver; - $selector = $this->loader; - $element->waitUntil( - function () use ($element, $selector) { - return $element->find($selector)->isVisible() == false ? true : null; - } - ); } /** - * Get value + * Get value. * * @return string */ public function getValue() { - return $this->find($this->value)->getText(); + return $this->context->find($this->attributeSetValue)->getText(); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml index f819d7c3ac83..ce8d4581dba9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml @@ -69,9 +69,9 @@ [name="product[special_from_date]"] - + [name="product[special_to_date]"] - + [name="product[cost]"] diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml index 54a5d4ad04c6..5c837ded6d97 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml @@ -76,7 +76,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml index a2f06e94659e..ca158461c35f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml @@ -13,7 +13,7 @@ Test simple product %isolation% test_simple_product_%isolation% 245.00 - 200.0000 + 200 test-simple-product-%isolation% 120.0000 Catalog, Search @@ -29,7 +29,7 @@ Test simple product %isolation% test_simple_product_%isolation% 325.00 - 123.0000 + 123 test-simple-product-%isolation% 129.0000 Not Visible Individually @@ -43,7 +43,7 @@ Test simple product %isolation% test_simple_product_%isolation% 325.01 - 125.0000 + 125 test-simple-product-%isolation% 25.0000 Catalog @@ -60,7 +60,7 @@ Test simple product %isolation% test_simple_product_%isolation% 325.02 - 89.0000 + 89 test-simple-product-%isolation% 89.0000 Search @@ -77,7 +77,7 @@ Test simple product %isolation% test_simple_product_%isolation% 325.03 - 25.0000 + 25 Out of Stock test-simple-product-%isolation% 125.0000 @@ -94,7 +94,7 @@ Test simple product %isolation% test_simple_product_%isolation% 74.00 - 87.0000 + 87 test-simple-product-%isolation% 333.0000 No @@ -109,7 +109,7 @@ Test simple product %isolation% test_simple_product_%isolation% 74.00 - 87.0000 + 87 test-simple-product-%isolation% 333.0000 diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml index 5e8684995ac9..346f8c86139a 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml @@ -71,7 +71,7 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml index af7f3efc4dbb..eacafb113c78 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml @@ -81,8 +81,7 @@ - - + diff --git a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php index 594f1c0f8bb6..674ef10fa2ee 100644 --- a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php +++ b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/FormSections.php @@ -114,7 +114,7 @@ public function isCollapsible($sectionName) * @param string $sectionName * @return bool */ - public function isCollapsed($sectionName) + private function isCollapsed($sectionName) { return $this->getContainerElement($sectionName)->find($this->opened)->isVisible(); } From 6d8bd0ec989957bc6abeb935321f557780648c6c Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Fri, 19 Feb 2016 20:33:19 +0200 Subject: [PATCH 02/17] MAGETWO-49390: Stabilize MX domain functional tests - Modified ProductVideo; - Refactored setFieldsData method for custom options; --- .../Test/Constraint/AssertBundlePriceType.php | 1 - .../Product/Edit/Section/Options.php | 45 ++++++++++++------- .../Product/Edit/Tab/ImagesAndVideos.php | 3 +- .../Block/Adminhtml/Product/ProductForm.xml | 2 +- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php index be0f886de0a7..eb031e4b1683 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php @@ -79,7 +79,6 @@ protected function assertPrice( $cartItem = $checkoutCartView->getCartBlock()->getCartItem($product); $specialPrice = 0; - $optionPrice = []; $fillData = $product->getCheckoutData(); foreach ($fillData['options']['bundle_options'] as $key => $data) { diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php index fe831814b51c..ed668daf6aa2 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php @@ -9,6 +9,7 @@ use Magento\Mtf\Client\Element\SimpleElement; use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Search\Grid; use Magento\Mtf\ObjectManager; +use Magento\Mtf\Client\ElementInterface; use Magento\Mtf\Client\Locator; use Magento\Ui\Test\Block\Adminhtml\Section; use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\AbstractOptions; @@ -111,21 +112,7 @@ public function setFieldsData(array $fields, SimpleElement $element = null) // Fill subform if (isset($field['type']) && !empty($options)) { - /** @var AbstractOptions $optionsForm */ - $optionsForm = $this->blockFactory->create( - __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($field['type']), - ['element' => $rootElement] - ); - $context = $rootElement->find($this->addValue)->isVisible() - ? $this->dynamicDataRow - : $this->staticDataRow; - foreach ($options as $key => $option) { - ++$key; - $optionsForm->fillOptions( - $option, - $rootElement->find(sprintf($context, $key)) - ); - } + $this->setOptionTypeData($options, $field['type'], $rootElement); } } @@ -161,6 +148,34 @@ protected function getSearchGridBlock() ); } + /** + * Set Option Type data. + * + * @param array $options + * @param string $type + * @param ElementInterface $element + * @return $this + */ + private function setOptionTypeData(array $options, $type, ElementInterface $element) + { + /** @var AbstractOptions $optionsForm */ + $optionsForm = $this->blockFactory->create( + __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($type), + ['element' => $element] + ); + $context = $element->find($this->addValue)->isVisible() + ? $this->dynamicDataRow + : $this->staticDataRow; + foreach ($options as $key => $option) { + ++$key; + $optionsForm->fillOptions( + $option, + $element->find(sprintf($context, $key)) + ); + } + return $this; + } + /** * Get data of tab. * diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/Edit/Tab/ImagesAndVideos.php b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/Edit/Tab/ImagesAndVideos.php index 814e65531667..40ca3bb74c53 100755 --- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/Edit/Tab/ImagesAndVideos.php +++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/Edit/Tab/ImagesAndVideos.php @@ -8,7 +8,6 @@ use Magento\Backend\Test\Block\Widget\Tab; use Magento\Mtf\Client\Element\SimpleElement; -use Magento\Mtf\Client\Locator; /** * Product images tab. @@ -20,7 +19,7 @@ class ImagesAndVideos extends Tab * * @var string */ - protected $addVideoButton = '#product_info_tabs_image-management_content #add_video_button'; + protected $addVideoButton = '[data-role="add-video-button"]'; /** * Video dialog CSS locator. diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml index 5a3c8fbe3fd8..891c2749d5f0 100755 --- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml @@ -8,7 +8,7 @@ \Magento\ProductVideo\Test\Block\Adminhtml\Product\Edit\Tab\ImagesAndVideos - #product_info_tabs_image-management + [data-index="block_gallery"] css selector From b1fb8197e2984d2b007c347e422205efcfbc0705 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Sun, 21 Feb 2016 16:02:50 +0200 Subject: [PATCH 03/17] MAGETWO-49390: Stabilize MX domain functional tests - Product form page actions locators updated; --- .../Adminhtml/Product/FormPageActions.php | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/FormPageActions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/FormPageActions.php index 812194181bfa..75f6bcf2cf61 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/FormPageActions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/FormPageActions.php @@ -11,49 +11,48 @@ use Magento\Mtf\Fixture\FixtureInterface; /** - * Class FormAction - * Form action + * Product Form page actions. */ class FormPageActions extends ParentFormPageActions { /** - * Save and create new product - 'Save & New' + * Save and create new product - 'Save & New'. */ - const SAVE_NEW = 'new'; + const SAVE_NEW = '0'; /** - * Save and create a duplicate product - 'Save & Duplicate' + * Save and create a duplicate product - 'Save & Duplicate'. */ - const SAVE_DUPLICATE = 'duplicate'; + const SAVE_DUPLICATE = '1'; /** - * Save and close the product page - 'Save & Close' + * Save and close the product page - 'Save & Close'. */ - const SAVE_CLOSE = 'close'; + const SAVE_CLOSE = '2'; /** - * CSS selector toggle "Save button" + * CSS selector toggle "Save button". * * @var string */ - protected $toggleButton = '[data-ui-id="page-actions-toolbar-save-split-button-dropdown"]'; + protected $toggleButton = '[data-ui-id="save-button-dropdown"]'; /** - * Save type item + * Save type item. * * @var string */ - protected $saveTypeItem = '#save-split-button-%s-button'; + protected $saveTypeItem = '[data-ui-id="save-button-item-%d"]'; /** - * "Save" button + * "Save" button. * * @var string */ - protected $saveButton = '#save-button'; + protected $saveButton = '[data-ui-id="save-button"]'; /** - * Click on "Save" button + * Click on "Save" button. * * @param FixtureInterface|null $product [optional] * @return void From 24f36535afbb4772b4bfeaaba9bb0fc6e496738e Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Mon, 22 Feb 2016 17:52:15 +0200 Subject: [PATCH 04/17] MAGETWO-49390: Stabilize MX domain functional tests - Removed openTab deprecated method for product page; - Changed option values for product_has_weight field; - Refactored handling reviews on product page; --- .../Bundle/Test/Repository/BundleProduct.xml | 46 +++++------ .../Block/Adminhtml/Product/ProductForm.xml | 3 +- .../AssertAttributeSetOnProductForm.php | 2 +- .../Handler/CatalogProductSimple/Curl.php | 4 +- .../Test/Repository/CatalogProductSimple.xml | 82 +++++++++---------- .../ProductTypeSwitchingOnUpdateTest.php | 8 +- .../UpdateVirtualProductEntityTest.xml | 22 ++--- .../Block/Adminhtml/Product/ProductForm.xml | 2 +- .../Test/Repository/ConfigurableProduct.xml | 26 +++--- .../Product/Edit/Section/Downloadable.php | 17 +++- .../Edit/Section/Downloadable/Links.php | 1 - .../Test/Repository/CatalogProductSimple.xml | 4 +- .../AssertGetVideoInfoDataIsCorrect.php | 4 +- .../Product/Edit/Section/Reviews.php | 35 ++++++++ .../Adminhtml/Product/Edit/Tab/Reviews.php | 18 ---- .../Test/Block/Adminhtml/Product/Grid.php | 22 ++--- .../Block/Adminhtml/Product/ProductForm.xml | 4 +- ...teProductReviewEntityOnProductPageTest.php | 4 +- 18 files changed, 161 insertions(+), 143 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Section/Reviews.php delete mode 100644 dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Tab/Reviews.php diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml index 78fd6fc645cb..87e7906cee65 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml @@ -11,8 +11,8 @@ Bundle dynamic product %isolation% bundle-dynamic-product-%isolation% sku_bundle_dynamic_product_%isolation% - Dynamic - Dynamic + Yes + Yes bundle_dynamic_with_category @@ -30,15 +30,15 @@ Bundle dynamic product %isolation% sku_bundle_dynamic_product_%isolation% - Dynamic - Dynamic + Yes + Yes default_dynamic In Stock - Dynamic + Yes Separately taxable_goods @@ -66,8 +66,8 @@ Bundle fixed product %isolation% sku_bundle_fixed_product_%isolation% - Fixed - Fixed + No + No 750 default_fixed @@ -79,8 +79,8 @@ In Stock 1 - Fixed - Yes + No + This item has weight Yes Together @@ -107,8 +107,8 @@ Bundle fixed product %isolation% bundle-fixed-product-%isolation% sku_bundle_fixed_product_%isolation% - Fixed - Fixed + No + No 100 @@ -116,8 +116,8 @@ taxable_goods 1 - Fixed - Yes + No + This item has weight Main Website @@ -133,8 +133,8 @@ Bundle dynamic product %isolation% bundle-dynamic-product-%isolation% sku_bundle_dynamic_product_%isolation% - Dynamic - Dynamic + Yes + Yes bundle_dynamic_with_category @@ -153,8 +153,8 @@ Bundle fixed product %isolation% bundle-fixed-product-%isolation% sku_bundle_fixed_product_%isolation% - Fixed - Fixed + No + No 100 @@ -162,8 +162,8 @@ taxable_goods 1 - Fixed - Yes + No + This item has weight Main Website @@ -179,8 +179,8 @@ Bundle fixed product %isolation% sku_bundle_fixed_product_%isolation% - Fixed - Fixed + No + No 100 fixed_100_dollar @@ -192,8 +192,8 @@ In Stock 1 - Fixed - Yes + No + This item has weight Yes Together diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml index ce8d4581dba9..f248590b4f21 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml @@ -27,8 +27,7 @@ select - [data-role="weight-switcher"] - radiobutton + select [data-index='container_category_ids'] diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php index 0f66f26036df..9ad4cee5e868 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php @@ -72,7 +72,7 @@ public function processAssert( ); if ($attributeSetOriginal === null) { - $productEdit->getProductForm()->openTab('product-details'); + $productEdit->getProductForm()->openSection('product-details'); \PHPUnit_Framework_Assert::assertTrue( $productEdit->getProductForm()->checkAttributeLabel($productAttribute), diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php index 2d13aacee7cb..cb5ed762f6c3 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php @@ -69,8 +69,8 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface 'No' => 0 ], 'product_has_weight' => [ - 'Yes' => 1, - 'No' => 0, + 'This item has weight' => 1, + 'This item has no weight' => 0, ], 'use_config_enable_qty_increments' => [ 'Yes' => 1, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index a7cf11cf2d18..64d29e43873c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -13,7 +13,7 @@ Simple Product %isolation% sku_simple_product_%isolation% - Yes + This item has weight 1 25 @@ -42,7 +42,7 @@ Product \'!@#$%^&*()+:;\\|}{][?=-~` %isolation% sku_simple_product_%isolation% No - Yes + This item has weight 1 25 @@ -74,7 +74,7 @@ 25 In Stock - Yes + This item has weight 1 560 @@ -98,7 +98,7 @@ product_10_dollar %isolation% sku_product_10_dollar_%isolation% - Yes + This item has weight 1 1000 @@ -126,7 +126,7 @@ product_20_dollar %isolation% sku_product_20_dollar_%isolation% - Yes + This item has weight 1 1000 @@ -148,7 +148,7 @@ Simple Product %isolation% sku_simple_product_%isolation% - Yes + This item has weight 1 25 @@ -173,7 +173,7 @@ Simple Product %isolation% sku_simple_product_%isolation% - Yes + This item has weight 1 1000 @@ -201,7 +201,7 @@ Simple Product %isolation% sku_simple_product_%isolation% - Yes + This item has weight 1 25 @@ -230,7 +230,7 @@ 666.0000 In Stock - Yes + This item has weight 1 default @@ -255,7 +255,7 @@ 666 In Stock - Yes + This item has weight 1 default @@ -280,7 +280,7 @@ 666 In Stock - Yes + This item has weight 1 100 @@ -303,7 +303,7 @@ 666 In Stock - Yes + This item has weight 1 default @@ -326,7 +326,7 @@ Simple product without category %isolation% simple-product-%isolation% simple_product_without_category_%isolation% - Yes + This item has weight 1 default @@ -358,7 +358,7 @@ 100 - Yes + This item has weight 100 Main Website @@ -385,7 +385,7 @@ 111 In Stock - Yes + This item has weight 1 Yes @@ -410,7 +410,7 @@ 50 - Yes + This item has weight 50 52 @@ -431,7 +431,7 @@ default - Yes + This item has weight 1 100 @@ -457,7 +457,7 @@ default - Yes + This item has weight 1 10 @@ -490,7 +490,7 @@ 666 In Stock - Yes + This item has weight 1 <p>dfj_full</p> Yes @@ -514,7 +514,7 @@ 666 In Stock - Yes + This item has weight 0.1 <p>Simple with Weight 0.1</p> Yes @@ -538,7 +538,7 @@ 666 In Stock - Yes + This item has weight 150.1 <p>Simple with Weight 150.1</p> Yes @@ -562,7 +562,7 @@ 666 In Stock - Yes + This item has weight 1 <p>adc_Full</p> Yes @@ -584,7 +584,7 @@ 25 In Stock - Yes + This item has weight 1 100 @@ -604,7 +604,7 @@ 100 - Yes + This item has weight 1 99 @@ -623,7 +623,7 @@ 300 - Yes + This item has weight 1 34 @@ -644,7 +644,7 @@ 300 - Yes + This item has weight 1 85 @@ -671,7 +671,7 @@ 300 - Yes + This item has weight 1 23 @@ -698,7 +698,7 @@ 300 - Yes + This item has weight 1 842 @@ -728,7 +728,7 @@ 300 - Yes + This item has weight 1 953 @@ -751,7 +751,7 @@ No 2 - Yes + This item has weight 1 default @@ -771,7 +771,7 @@ Simple Product out of stock %isolation% sku_simple_product_out_of_stock%isolation% - Yes + This item has weight 1 25 @@ -799,7 +799,7 @@ Simple Product offline %isolation% sku_simple_product_offline_%isolation% - Yes + This item has weight 1 25 @@ -828,7 +828,7 @@ Simple Product not visible %isolation% sku_simple_product_not_visible_%isolation% - Yes + This item has weight 1 25 @@ -856,7 +856,7 @@ Simple Product with cart limit %isolation% sku_simple_product_with_cart_limit_%isolation% - Yes + This item has weight 1 25 @@ -893,7 +893,7 @@ 300 - Yes + This item has weight 1 63 @@ -917,7 +917,7 @@ Simple Product with qty increments %isolation% sku_simple_product_with_qty_increments_%isolation% - Yes + This item has weight 1 25 @@ -954,7 +954,7 @@ 300 - Yes + This item has weight 1 25 @@ -976,7 +976,7 @@ 666 In Stock - Yes + This item has weight 1 default @@ -1013,7 +1013,7 @@ 70 - Yes + This item has weight 1 954 @@ -1054,7 +1054,7 @@ In Stock 100 - Yes + This item has weight 1 simple-product-%isolation% @@ -1069,7 +1069,7 @@ Simple Product %isolation% sku_simple_product_%isolation% simple-product-%isolation% - Yes + This item has weight 1 1000 diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php index 0852269b2894..8417e4589fef 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest.php @@ -127,9 +127,9 @@ protected function performAction($actionName) */ protected function deleteVariations() { - $this->catalogProductEdit->getProductForm()->openTab('variations'); + $this->catalogProductEdit->getProductForm()->openSection('variations'); /** @var Config $variationsTab */ - $variationsTab = $this->catalogProductEdit->getProductForm()->getTab('variations'); + $variationsTab = $this->catalogProductEdit->getProductForm()->getSection('variations'); $variationsTab->deleteVariations(); } @@ -140,9 +140,9 @@ protected function deleteVariations() */ protected function clearDownloadableData() { - $this->catalogProductEdit->getProductForm()->openTab('downloadable_information'); + $this->catalogProductEdit->getProductForm()->openSection('downloadable_information'); /** @var Downloadable $downloadableInfoTab */ - $downloadableInfoTab = $this->catalogProductEdit->getProductForm()->getTab('downloadable_information'); + $downloadableInfoTab = $this->catalogProductEdit->getProductForm()->getSection('downloadable_information'); $downloadableInfoTab->getDownloadableBlock('Links')->clearDownloadableData(); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml index b967e6f87b9f..0c02c916c333 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml @@ -13,7 +13,7 @@ 99.99 None 999 - No + This item has no weight default_subcategory MAGETWO-23002 In Stock @@ -34,7 +34,7 @@ 120.00 taxable_goods 999 - No + This item has no weight 45 In Stock Catalog, Search @@ -54,7 +54,7 @@ 185.00 None 999 - No + This item has no weight default_subcategory MAGETWO-23002 Out of Stock @@ -74,7 +74,7 @@ virtual_sku_%isolation% 99.99 taxable_goods - No + This item has no weight Out of Stock Search virtual-product-%isolation% @@ -90,7 +90,7 @@ virtual_sku_%isolation% 5.00 None - No + This item has no weight Out of Stock Catalog virtual-product-%isolation% @@ -107,7 +107,7 @@ 145.00 taxable_goods 999 - No + This item has no weight default_subcategory MAGETWO-23002 In Stock @@ -126,7 +126,7 @@ virtual_sku_%isolation% 99.99 None - No + This item has no weight default_subcategory 45 Out of Stock @@ -145,7 +145,7 @@ 5.00 taxable_goods Yes - No + This item has no weight Out of Stock Search virtual-product-%isolation% @@ -162,7 +162,7 @@ 120.00 None 999 - No + This item has no weight default_subcategory In Stock options_suite @@ -181,7 +181,7 @@ virtual_sku_%isolation% 99.99 taxable_goods - No + This item has no weight Out of Stock Catalog, Search virtual-product-%isolation% @@ -198,7 +198,7 @@ 99.99 None 999 - No + This item has no weight default_subcategory MAGETWO-23002 In Stock diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.xml index 6f638f00f4e0..a08e0861e3ef 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/ProductForm.xml @@ -8,7 +8,7 @@ \Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Variations\Config - #product_info_tabs_product-details + [data-index='product-details'] css selector diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml index 0e2c351a27c3..64e351ecccca 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Repository/ConfigurableProduct.xml @@ -14,7 +14,7 @@ 40 price_40 - Yes + This item has weight 30 Yes Catalog, Search @@ -45,7 +45,7 @@ price_40 - Yes + This item has weight 30 Yes Catalog, Search @@ -77,7 +77,7 @@ 10 9 - Yes + This item has weight 5 Yes Catalog, Search @@ -105,7 +105,7 @@ Test configurable product with size %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -133,7 +133,7 @@ Test configurable product with color and size %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -161,7 +161,7 @@ Test configurable product %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -190,7 +190,7 @@ 40 price_40 - Yes + This item has weight 30 Yes Catalog, Search @@ -215,7 +215,7 @@ Test configurable product %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -243,7 +243,7 @@ Test configurable product %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 30 Yes Catalog, Search @@ -272,7 +272,7 @@ taxable_goods - Yes + This item has weight 1 1 @@ -302,7 +302,7 @@ taxable_goods - Yes + This item has weight 1 Main Website @@ -321,7 +321,7 @@ Test configurable product %isolation% sku_test_configurable_product_%isolation% - Yes + This item has weight 1 Yes Catalog, Search @@ -351,7 +351,7 @@ taxable_goods - Yes + This item has weight 1 1 diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable.php index edbb6814a9c7..b06d95fb14ed 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable.php @@ -30,7 +30,14 @@ class Downloadable extends Section * * @var string */ - protected $downloadableBlock = '[data-index="downloadable"] > div > fieldset'; + protected $downloadableBlock = '[data-index="container_%s"]'; + + /** + * Locator for is downloadable product checkbox. + * + * @var string + */ + protected $isDownloadableProduct = '[name="is_downloadable"]'; /** * Get Downloadable block. @@ -44,7 +51,7 @@ public function getDownloadableBlock($type, SimpleElement $element = null) $element = $element ?: $this->_rootElement; return $this->blockFactory->create( 'Magento\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Downloadable\\' . $type, - ['element' => $element->find($this->downloadableBlock, Locator::SELECTOR_CSS)] + ['element' => $element->find(sprintf($this->downloadableBlock, strtolower($type)), Locator::SELECTOR_CSS)] ); } @@ -78,11 +85,15 @@ public function getFieldsData($fields = null, SimpleElement $element = null) * * @param array $fields * @param SimpleElement|null $element - * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @return $this */ public function setFieldsData(array $fields, SimpleElement $element = null) { + $context = $element ?: $this->_rootElement; + $isDownloadable = $context->find($this->isDownloadableProduct); + if ($isDownloadable->isVisible()) { + $isDownloadable->click(); + } if (isset($fields['downloadable_sample']['value'])) { $this->getDownloadableBlock('Samples')->fillSamples($fields['downloadable_sample']['value']); } diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable/Links.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable/Links.php index 087a92f04be5..b06584a0b14b 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable/Links.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Downloadable/Links.php @@ -127,7 +127,6 @@ public function clearDownloadableData() while ($this->_rootElement->find(sprintf($this->rowBlock, $index))->isVisible()) { $rowBlock = $this->getRowBlock($index - 1); $rowBlock->clickDeleteButton(); - ++$index; } } diff --git a/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml index f3ee8cb520a7..da2dc550f734 100644 --- a/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Msrp/Test/Repository/CatalogProductSimple.xml @@ -14,7 +14,7 @@ Simple Product with msrp %isolation% sku_simple_product_with_msrp_%isolation% 1 - Yes + This item has weight 25 In Stock @@ -42,7 +42,7 @@ simple-product-with-msrp-%isolation% sku_simple_product_with_msrp_%isolation% 1 - Yes + This item has weight 1000 In Stock diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Constraint/AssertGetVideoInfoDataIsCorrect.php b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Constraint/AssertGetVideoInfoDataIsCorrect.php index be7af60ae89e..ca3bd3174bee 100755 --- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Constraint/AssertGetVideoInfoDataIsCorrect.php +++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Constraint/AssertGetVideoInfoDataIsCorrect.php @@ -30,8 +30,8 @@ public function processAssert( ) { $editProductPage->open(['id' => $initialProduct->getId()]); - $editProductPage->getProductForm()->openTab('images-and-videos'); - $imagesTab = $editProductPage->getProductForm()->getTab('images-and-videos'); + $editProductPage->getProductForm()->openSection('images-and-videos'); + $imagesTab = $editProductPage->getProductForm()->getSection('images-and-videos'); $result = $imagesTab->clickFirstVideo()->getVideoDialog()->validate($video); \PHPUnit_Framework_Assert::assertTrue( diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Section/Reviews.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Section/Reviews.php new file mode 100644 index 000000000000..c1c17679a966 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Section/Reviews.php @@ -0,0 +1,35 @@ +blockFactory->create( + 'Magento\Review\Test\Block\Adminhtml\Product\Grid', + ['element' => $this->_rootElement->find($this->reviews)] + ); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Tab/Reviews.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Tab/Reviews.php deleted file mode 100644 index 56330ef7a2f5..000000000000 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/Edit/Tab/Reviews.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'selector' => 'input[name="entity_id"]', + 'title' => [ + 'selector' => 'input[name="title"]', ], - 'name' => [ - 'selector' => 'input[name="name"]', + 'sku' => [ + 'selector' => 'input[name="sku"]', ], ]; - - /** - * Locator value for link in action column - * - * @var string - */ - protected $editLink = '.col-entity_id'; } diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml index 178ebee634a5..2727bde5a8f9 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml @@ -7,8 +7,8 @@ --> - \Magento\Review\Test\Block\Adminhtml\Product\Edit\Tab\Reviews - #product_info_tabs_product-reviews + \Magento\Review\Test\Block\Adminhtml\Product\Edit\Section\Reviews + [data-index="review"] css selector diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php index 0a373da1808d..fc6db720f92d 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/UpdateProductReviewEntityOnProductPageTest.php @@ -134,12 +134,12 @@ public function test(Review $review, $rating) ['product' => $product] )->run(); - $this->catalogProductEdit->getProductForm()->openTab('product_reviews'); + $this->catalogProductEdit->getProductForm()->openSection('product_reviews'); $filter = [ 'title' => $this->reviewInitial->getTitle(), 'sku' => $product->getSku(), ]; - $this->catalogProductEdit->getProductForm()->getTab('product_reviews')->getReviewsGrid() + $this->catalogProductEdit->getProductForm()->getSection('product_reviews')->getReviewsGrid() ->searchAndOpen($filter); $this->reviewEdit->getReviewForm()->fill($review); $this->reviewEdit->getPageActions()->save(); From 5fa39524d2874dd68ee6afff188bcdb516f276e1 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Mon, 22 Feb 2016 18:03:19 +0200 Subject: [PATCH 05/17] MAGETWO-49390: Stabilize MX domain functional tests - Renamed tabs into sections in product forms; --- .../Bundle/Test/Block/Adminhtml/Product/ProductForm.xml | 4 ++-- .../Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml | 4 ++-- .../ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml | 4 ++-- .../Review/Test/Block/Adminhtml/Product/ProductForm.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/ProductForm.xml index e4f8bad11586..055ef48d66b9 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Product/ProductForm.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> - + \Magento\Ui\Test\Block\Adminhtml\Section [data-index='product-details'] @@ -48,4 +48,4 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml index c8c639326b23..d0c904cd818d 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml @@ -5,10 +5,10 @@ * See COPYING.txt for license details. */ --> - + \Magento\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Downloadable [data-index="downloadable"] css selector - + diff --git a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml index 891c2749d5f0..bf712dbaf98f 100755 --- a/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/ProductVideo/Test/Block/Adminhtml/Product/ProductForm.xml @@ -5,7 +5,7 @@ * See COPYING.txt for license details. */ --> - + \Magento\ProductVideo\Test\Block\Adminhtml\Product\Edit\Tab\ImagesAndVideos [data-index="block_gallery"] @@ -26,4 +26,4 @@ - + diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml index 2727bde5a8f9..febed388f77a 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Product/ProductForm.xml @@ -5,10 +5,10 @@ * See COPYING.txt for license details. */ --> - + \Magento\Review\Test\Block\Adminhtml\Product\Edit\Section\Reviews [data-index="review"] css selector - + From 6edc6fb4a82847c31b4a9018c323a73988a261b1 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Mon, 22 Feb 2016 20:00:13 +0200 Subject: [PATCH 06/17] MAGETWO-49390: Stabilize MX domain functional tests - Import options functionality fixed; --- .../Product/Edit/Section/Options.php | 4 +-- .../Edit/Section/Options/Search/Grid.php | 22 +++++---------- .../Ui/Test/Block/Adminhtml/DataGrid.php | 28 +++++++++++++++++++ 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php index ed668daf6aa2..0104e83fd7fc 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php @@ -52,7 +52,7 @@ class Options extends Section * * @var string */ - protected $importGrid = ".product_form_product_form_custom_options_import_options_modal"; + protected $importGrid = ".product_form_product_form_import_options_modal"; /** * Locator for 'Add Value' button. @@ -144,7 +144,7 @@ protected function getSearchGridBlock() { return $this->blockFactory->create( 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Search\Grid', - ['element' => $this->_rootElement->find($this->importGrid)] + ['element' => $this->browser->find($this->importGrid)] ); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Search/Grid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Search/Grid.php index 20f6c385426d..53b8db76c01f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Search/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Search/Grid.php @@ -6,30 +6,22 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Search; -use Magento\Backend\Test\Block\Widget\Grid as GridInterface; +use Magento\Ui\Test\Block\Adminhtml\DataGrid; /** - * Class Grid - * 'Import custom options to product' grid + * 'Import custom options to product' grid. */ -class Grid extends GridInterface +class Grid extends DataGrid { /** - * Selector for 'Import' button + * Selector for 'Import' button. * * @var string */ - protected $importProducts = '#import-custom-options-apply-button'; + protected $importProducts = '[data-role="action"]'; /** - * An element locator which allows to select entities in grid - * - * @var string - */ - protected $selectItem = 'tbody tr .col-id'; - - /** - * Filters param for grid + * Filters param for grid. * * @var array */ @@ -40,7 +32,7 @@ class Grid extends GridInterface ]; /** - * Press 'Import' button + * Press 'Import' button. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php index a803f46cd5c7..a8e4029361fe 100644 --- a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php +++ b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php @@ -238,6 +238,34 @@ public function searchAndOpen(array $filter) } } + /** + * Search item and select it. + * + * @param array $filter + * @throws \Exception + */ + public function searchAndSelect(array $filter) + { + $this->search($filter); + $rowItem = $this->getRow($filter); + if ($rowItem->isVisible()) { + $this->clickSelectItem($rowItem); + } else { + throw new \Exception('Searched item was not found.'); + } + } + + /** + * Click on select item checkbox. + * + * @param SimpleElement $rowItem + * @return void + */ + private function clickSelectItem(SimpleElement $rowItem) + { + $rowItem->find($this->selectItem)->click(); + } + /** * Perform selected massaction over checked items. * From ecb6d404a572110f37f515d1503ac7e8b718c909 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Tue, 23 Feb 2016 20:08:52 +0200 Subject: [PATCH 07/17] MAGETWO-49390: Stabilize MX domain functional tests --- .../Block/Adminhtml/Product/ProductForm.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml index f248590b4f21..512907d97184 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml @@ -204,6 +204,24 @@ + + \Magento\Ui\Test\Block\Adminhtml\Section + [data-index="gift-options"] + css selector + product + + + switcher + + + checkbox + + + [name="product[gift_wrapping_price]"] + css selector + + + \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Related [data-index="related"] From c6d872d4109683eef200639aca8894f72e8e100c Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Wed, 24 Feb 2016 21:26:00 +0200 Subject: [PATCH 08/17] MAGETWO-49390: Stabilize MX domain functional tests - Added sort_order for select and multi select custom options; - Added dragAndDrop for custom options; --- .../Product/Edit/Section/Options.php | 116 +++++++++++++++--- .../Product/Edit/Section/Options/Row.php | 43 +++++++ .../Test/Block/Product/View/CustomOptions.php | 5 +- .../Test/Constraint/AssertProductForm.php | 1 - .../Test/Repository/Product/CustomOptions.xml | 14 +++ 5 files changed, 160 insertions(+), 19 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Row.php diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php index 0104e83fd7fc..38499c056e8d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php @@ -13,6 +13,7 @@ use Magento\Mtf\Client\Locator; use Magento\Ui\Test\Block\Adminhtml\Section; use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\AbstractOptions; +use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Row; /** * Product custom options section. @@ -75,6 +76,13 @@ class Options extends Section */ protected $staticDataRow = '[data-index="container_type_static"] div:nth-child(%d)'; + /** + * Sort rows data. + * + * @var array + */ + protected $sortRowsData = []; + /** * Fill custom options form on tab. * @@ -148,6 +156,22 @@ protected function getSearchGridBlock() ); } + /** + * Get select option row block. + * + * @param int $index + * @param SimpleElement $element + * @return Row + */ + protected function getRowBlock($index, SimpleElement $element = null) + { + $element = $element ?: $this->_rootElement; + return $this->blockFactory->create( + 'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options\Row', + ['element' => $element->find(sprintf($this->dynamicDataRow, ++$index))] + ); + } + /** * Set Option Type data. * @@ -167,23 +191,54 @@ private function setOptionTypeData(array $options, $type, ElementInterface $elem ? $this->dynamicDataRow : $this->staticDataRow; foreach ($options as $key => $option) { - ++$key; + if (isset($option['sort_order'])) { + $currentSortOrder = (int)$option['sort_order']; + unset($option['sort_order']); + } else { + $currentSortOrder = 0; + } $optionsForm->fillOptions( $option, - $element->find(sprintf($context, $key)) + $element->find(sprintf($context, $key + 1)) ); + $this->sortOption($key, $currentSortOrder, $element); } + $this->sortRowsData = []; + return $this; } + /** + * Sort sample element. + * + * @param int $position + * @param int $sortOrder + * @param SimpleElement|null $element + * @return void + */ + private function sortOption($position, $sortOrder, SimpleElement $element = null) + { + $currentSortRowData = ['current_position_in_grid' => $position, 'sort_order' => $sortOrder]; + foreach ($this->sortRowsData as &$sortRowData) { + if ($sortRowData['sort_order'] > $currentSortRowData['sort_order']) { + // need to reload block because we are changing dom + $target = $this->getRowBlock($sortRowData['current_position_in_grid'], $element)->getSortHandle(); + $this->getRowBlock($currentSortRowData['current_position_in_grid'], $element)->dragAndDropTo($target); + + $currentSortRowData['current_position_in_grid']--; + $sortRowData['current_position_in_grid']++; + } + } + unset($sortRowData); + $this->sortRowsData[] = $currentSortRowData; + } + /** * Get data of tab. * * @param array|null $tabFields * @param SimpleElement|null $element * @return array - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getFieldsData($tabFields = null, SimpleElement $element = null) { @@ -213,20 +268,10 @@ public function getFieldsData($tabFields = null, SimpleElement $element = null) // Data collection subform if (isset($field['type']) && !empty($options)) { - /** @var AbstractOptions $optionsForm */ - $optionsForm = $this->blockFactory->create( - __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($field['type']), - ['element' => $rootElement] + $formDataItem = array_merge( + $formDataItem, + $this->getOptionTypeData($options, $field['type'], $rootElement) ); - $context = $rootElement->find($this->addValue)->isVisible() - ? $this->dynamicDataRow - : $this->staticDataRow; - foreach ($options as $key => $option) { - $formDataItem['options'][$key++] = $optionsForm->getDataOptions( - $option, - $rootElement->find(sprintf($context, $key)) - ); - } } $formData[$name][$keyRoot] = $formDataItem; } @@ -234,6 +279,43 @@ public function getFieldsData($tabFields = null, SimpleElement $element = null) return $formData; } + /** + * Get option type data. + * + * @param array $options + * @param string $type + * @param ElementInterface $element + * @return array + */ + private function getOptionTypeData(array $options, $type, ElementInterface $element) + { + $formDataItem = []; + /** @var AbstractOptions $optionsForm */ + $optionsForm = $this->blockFactory->create( + __NAMESPACE__ . '\Options\Type\\' . $this->optionNameConvert($type), + ['element' => $element] + ); + $context = $element->find($this->addValue)->isVisible() + ? $this->dynamicDataRow + : $this->staticDataRow; + foreach ($options as $key => $option) { + if (isset($option['sort_order'])) { + $currentSortOrder = (int)$option['sort_order']; + unset($option['sort_order']); + } + $formDataItem['options'][$key] = $optionsForm->getDataOptions( + $option, + $element->find(sprintf($context, $key + 1)) + ); + if (isset($currentSortOrder)) { + $formDataItem['options'][$key]['sort_order'] = $key; + } + $key++; + } + + return $formDataItem; + } + /** * Prepare custom options with import options. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Row.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Row.php new file mode 100644 index 000000000000..8771ad2d7ee2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options/Row.php @@ -0,0 +1,43 @@ +getSortHandle()->dragAndDrop($target); + } + + /** + * Get sort handle. + * + * @return ElementInterface + */ + public function getSortHandle() + { + return $this->_rootElement->find($this->sortDraggableHandle); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php index 9fcea9e34561..136ad08e294f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php @@ -334,10 +334,13 @@ protected function getSelectOptionsData(SimpleElement $element, $firstOption = 1 $count = $firstOption; $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); + $index = 0; while ($selectOption->isVisible()) { - $listOptions[] = $this->parseOptionText($selectOption->getText()); + $listOptions[$index] = $this->parseOptionText($selectOption->getText()); + $listOptions[$index]['sort_order'] = $index; ++$count; $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); + $index++; } return [ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php index 4911ead66bbb..0bce3deb877d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php @@ -32,7 +32,6 @@ class AssertProductForm extends AbstractAssertForm * @var array */ protected $sortFields = [ - 'custom_options::title', 'cross_sell_products::id', 'up_sell_products::id', 'related_products::id', diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml index a785e3bda5ed..4ffb12ec54a5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml @@ -18,6 +18,7 @@ 10 Percent sku_drop_down_row_1 + 0 @@ -31,6 +32,7 @@ 20 Percent sku_drop_down_row_2 + 0 @@ -47,12 +49,14 @@ 10 Percent sku_drop_down_row_1 + 0 20 percent 20 Percent sku_drop_down_row_2 + 1 @@ -82,6 +86,7 @@ 30 Fixed sku_drop_down_row_1 + 0 @@ -98,6 +103,7 @@ 40 Percent sku_drop_down_row_1 + 0 @@ -140,12 +146,14 @@ 110.01 Percent Percent + 0 Test3-2 %isolation% 210.02 Fixed sku3_%isolation% + 1 @@ -159,12 +167,14 @@ 10.01 Percent sku2_%isolation% + 0 Test4-2 %isolation% 20.02 Fixed sku3_%isolation% + 1 @@ -222,18 +232,21 @@ 10 Percent sku_drop_down_row_1_%isolation% + 0 20 percent 20 Percent sku_drop_down_row_2_%isolation% + 1 30 fixed 30 Fixed sku_drop_down_row_3_%isolation% + 2 @@ -273,6 +286,7 @@ 20 Fixed sku_multiple_select_row%isolation% + 0 From 8341c8f53253d930e419e4afa92cdb221cdff65d Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Thu, 25 Feb 2016 11:49:03 +0200 Subject: [PATCH 09/17] MAGETWO-49390: Stabilize MX domain functional tests --- .../Test/Block/Adminhtml/Product/Edit/Section/Options.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php index 38499c056e8d..e0a86ec5e447 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php @@ -239,6 +239,7 @@ private function sortOption($position, $sortOrder, SimpleElement $element = null * @param array|null $tabFields * @param SimpleElement|null $element * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getFieldsData($tabFields = null, SimpleElement $element = null) { From 96e6d2999e994e94a52cb6b39d9183fb5950e3af Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Mon, 29 Feb 2016 16:58:28 +0200 Subject: [PATCH 10/17] MAGETWO-49390: Stabilize MX domain functional tests - Added weight and product_has_weight to virtual and downloadable products; --- .../Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml | 2 ++ .../Catalog/Test/Repository/CatalogProductVirtual.xml | 7 +++++++ .../Downloadable/Test/Fixture/DownloadableProduct.xml | 2 ++ .../Downloadable/Test/Repository/DownloadableProduct.xml | 6 ++++++ 4 files changed, 17 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml index c70dd2cf8bd6..40e70240c575 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml @@ -74,6 +74,8 @@ + + diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index 0e5717935215..1c3d9ccde296 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -26,6 +26,7 @@ 666 In Stock + This item has no weight 10 @@ -44,6 +45,7 @@ taxable_goods + This item has no weight Main Website @@ -62,6 +64,7 @@ taxable_goods + This item has no weight Main Website @@ -86,6 +89,7 @@ 1000 In Stock + This item has no weight 10 @@ -113,6 +117,7 @@ 666 In Stock + This item has no weight 10 @@ -140,6 +145,7 @@ 111 In Stock + This item has no weight 50 @@ -165,6 +171,7 @@ No + This item has no weight 15 diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml index eacafb113c78..6dcd720ecff2 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct.xml @@ -84,6 +84,8 @@ + + diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml index a36b8c020f4c..5df1298cc5f7 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml @@ -28,6 +28,7 @@ with_two_separately_links + This item has no weight Main Website @@ -55,6 +56,7 @@ Main Website + This item has no weight with_two_separately_links @@ -82,6 +84,7 @@ Main Website + This item has no weight with_two_separately_links @@ -113,6 +116,7 @@ Main Website + This item has no weight with_two_separately_links @@ -143,6 +147,7 @@ Main Website + This item has no weight with_two_separately_links @@ -177,6 +182,7 @@ Main Website + This item has no weight downloadable_one_dollar_product_with_no_separated_link From 9be2ff14bc76fa5f942b69d7a52af683ce8b1fe6 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Mon, 29 Feb 2016 20:27:24 +0200 Subject: [PATCH 11/17] MAGETWO-49390: Stabilize MX domain functional tests - Fixed CreateAttributeSetEntityTest; --- .../Edit/Section/ProductDetails/AttributeSet.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php index 6aea585552ca..63e6b7f8906c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/ProductDetails/AttributeSet.php @@ -28,6 +28,13 @@ class AttributeSet extends SuggestElement */ protected $attributeSetValue = '[data-role="selected-option"]'; + /** + * Selector item of search result. + * + * @var string + */ + protected $resultItem = './/label[contains(@class, "admin__action-multiselect-label")]/span[text() = "%s"]'; + /** * Set value. * @@ -36,7 +43,7 @@ class AttributeSet extends SuggestElement */ public function setValue($value) { - if (!$this->context->find(sprintf($this->attributeSet, $value), Locator::SELECTOR_XPATH)) { + if (!$this->find(sprintf($this->attributeSet, $value), Locator::SELECTOR_XPATH)->isVisible()) { parent::setValue($value); } } @@ -48,6 +55,6 @@ public function setValue($value) */ public function getValue() { - return $this->context->find($this->attributeSetValue)->getText(); + return $this->find($this->attributeSetValue)->getText(); } } From 04dcc4f10560fd05fd6947590139ecbe25b6e428 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Wed, 2 Mar 2016 20:02:10 +0200 Subject: [PATCH 12/17] MAGETWO-49390: Stabilize MX domain functional tests - Removed product_has_weight from bundle, virtual and downloadable products; - Changed locators in bundle section; --- .../Catalog/Product/Edit/Section/Bundle.php | 37 ++++++++++++------- .../Bundle/Test/Repository/BundleProduct.xml | 4 -- .../Product/Edit/Section/Options.php | 3 +- .../Test/Repository/CatalogProductVirtual.xml | 7 ---- .../Test/Repository/DownloadableProduct.xml | 6 --- .../Ui/Test/Block/Adminhtml/DataGrid.php | 13 +------ 6 files changed, 26 insertions(+), 44 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php index f9315c0cc596..26c90694d1db 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Section/Bundle.php @@ -9,6 +9,8 @@ use Magento\Mtf\Client\Element\SimpleElement; use Magento\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Bundle\Option; use Magento\Mtf\Client\Element; +use Magento\Mtf\Client\ElementInterface; +use Magento\Mtf\Client\Locator; use Magento\Ui\Test\Block\Adminhtml\Section; /** @@ -23,41 +25,47 @@ class Bundle extends Section */ protected $addNewOption = 'button[data-index="add_button"]'; + /** + * Bundle options locator. + * + * @var string + */ + protected $bundleOptions = './/*[@data-index="bundle_options"]/tbody'; + /** * Open option section. * * @var string */ - protected $openOption = - '[data-index="bundle_options"] > tbody > tr:nth-child(%d) [data-role="collapsible-title"]'; + protected $openOption = './tr[%d]//*[@data-role="collapsible-title"]'; /** * Selector for option content. * * @var string */ - protected $optionContent = - '[data-index="bundle_options"] > tbody > tr:nth-child(%d) [data-role="collapsible-content"]'; + protected $optionContent = './tr[%d]//*[@data-role="collapsible-content"]'; /** * Locator for bundle option row. * * @var string */ - protected $bundleOption = '[data-index="bundle_options"] > tbody > tr:nth-child(%d)'; + protected $bundleOptionRow = './tr[%d]'; /** * Get bundle options block. * * @param int $rowNumber + * @param ElementInterface $element * @return Option */ - protected function getBundleOptionBlock($rowNumber) + private function getBundleOptionBlock($rowNumber, ElementInterface $element) { return $this->blockFactory->create( 'Magento\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Section\Bundle\Option', [ - 'element' => $this->_rootElement->find(sprintf($this->bundleOption, $rowNumber)) + 'element' => $element->find(sprintf($this->bundleOptionRow, $rowNumber), Locator::SELECTOR_XPATH) ] ); } @@ -75,16 +83,17 @@ public function setFieldsData(array $fields, SimpleElement $element = null) if (!isset($fields['bundle_selections'])) { return $this; } + $context = $this->_rootElement->find($this->bundleOptions, Locator::SELECTOR_XPATH); foreach ($fields['bundle_selections']['value']['bundle_options'] as $key => $bundleOption) { $count = $key + 1; - $itemOption = $this->_rootElement->find(sprintf($this->openOption, $count)); - $isContent = $this->_rootElement->find(sprintf($this->optionContent, $count))->isVisible(); + $itemOption = $context->find(sprintf($this->openOption, $count), Locator::SELECTOR_XPATH); + $isContent = $context->find(sprintf($this->optionContent, $count), Locator::SELECTOR_XPATH)->isVisible(); if ($itemOption->isVisible() && !$isContent) { $itemOption->click(); } elseif (!$itemOption->isVisible()) { $this->_rootElement->find($this->addNewOption)->click(); } - $this->getBundleOptionBlock($count)->fillOption($bundleOption); + $this->getBundleOptionBlock($count, $context)->fillOption($bundleOption); } return $this; } @@ -104,14 +113,16 @@ public function getFieldsData($fields = null, SimpleElement $element = null) return $this; } $index = 1; + $context = $this->_rootElement->find($this->bundleOptions, Locator::SELECTOR_XPATH); foreach ($fields['bundle_selections']['value']['bundle_options'] as $key => &$bundleOption) { - if (!$this->_rootElement->find(sprintf($this->optionContent, $index))->isVisible()) { - $this->_rootElement->find(sprintf($this->openOption, $index))->click(); + if (!$context->find(sprintf($this->optionContent, $index), Locator::SELECTOR_XPATH)->isVisible()) { + $context->find(sprintf($this->openOption, $index), Locator::SELECTOR_XPATH)->click(); } foreach ($bundleOption['assigned_products'] as &$product) { $product['data']['getProductName'] = $product['search_data']['name']; } - $newFields['bundle_selections'][$key] = $this->getBundleOptionBlock($index)->getOptionData($bundleOption); + $newFields['bundle_selections'][$key] = + $this->getBundleOptionBlock($index, $context)->getOptionData($bundleOption); $index++; } diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml index 87e7906cee65..90d2536a0890 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Repository/BundleProduct.xml @@ -80,7 +80,6 @@ 1 No - This item has weight Yes Together @@ -117,7 +116,6 @@ 1 No - This item has weight Main Website @@ -163,7 +161,6 @@ 1 No - This item has weight Main Website @@ -193,7 +190,6 @@ 1 No - This item has weight Yes Together diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php index e0a86ec5e447..e8012cb69c66 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/Options.php @@ -163,7 +163,7 @@ protected function getSearchGridBlock() * @param SimpleElement $element * @return Row */ - protected function getRowBlock($index, SimpleElement $element = null) + private function getRowBlock($index, SimpleElement $element = null) { $element = $element ?: $this->_rootElement; return $this->blockFactory->create( @@ -311,7 +311,6 @@ private function getOptionTypeData(array $options, $type, ElementInterface $elem if (isset($currentSortOrder)) { $formDataItem['options'][$key]['sort_order'] = $key; } - $key++; } return $formDataItem; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml index 1c3d9ccde296..0e5717935215 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductVirtual.xml @@ -26,7 +26,6 @@ 666 In Stock - This item has no weight 10 @@ -45,7 +44,6 @@ taxable_goods - This item has no weight Main Website @@ -64,7 +62,6 @@ taxable_goods - This item has no weight Main Website @@ -89,7 +86,6 @@ 1000 In Stock - This item has no weight 10 @@ -117,7 +113,6 @@ 666 In Stock - This item has no weight 10 @@ -145,7 +140,6 @@ 111 In Stock - This item has no weight 50 @@ -171,7 +165,6 @@ No - This item has no weight 15 diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml index 5df1298cc5f7..a36b8c020f4c 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Repository/DownloadableProduct.xml @@ -28,7 +28,6 @@ with_two_separately_links - This item has no weight Main Website @@ -56,7 +55,6 @@ Main Website - This item has no weight with_two_separately_links @@ -84,7 +82,6 @@ Main Website - This item has no weight with_two_separately_links @@ -116,7 +113,6 @@ Main Website - This item has no weight with_two_separately_links @@ -147,7 +143,6 @@ Main Website - This item has no weight with_two_separately_links @@ -182,7 +177,6 @@ Main Website - This item has no weight downloadable_one_dollar_product_with_no_separated_link diff --git a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php index a8e4029361fe..bd68b11dc2fe 100644 --- a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php +++ b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php @@ -249,23 +249,12 @@ public function searchAndSelect(array $filter) $this->search($filter); $rowItem = $this->getRow($filter); if ($rowItem->isVisible()) { - $this->clickSelectItem($rowItem); + $rowItem->find($this->selectItem)->click(); } else { throw new \Exception('Searched item was not found.'); } } - /** - * Click on select item checkbox. - * - * @param SimpleElement $rowItem - * @return void - */ - private function clickSelectItem(SimpleElement $rowItem) - { - $rowItem->find($this->selectItem)->click(); - } - /** * Perform selected massaction over checked items. * From f736734c26d30fb66e582e1607342b361a02b209 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Wed, 9 Mar 2016 18:23:14 +0200 Subject: [PATCH 13/17] MAGETWO-49390: Stabilize MX domain functional tests --- .../Adminhtml/Customer/Edit/Tab/Reviews.php | 27 +++++++++++--- .../Test/Block/Adminhtml/ReviewsTab.php | 36 ------------------- 2 files changed, 22 insertions(+), 41 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php index 704420b799b9..9acf44f5e44e 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php @@ -6,13 +6,30 @@ namespace Magento\Review\Test\Block\Adminhtml\Customer\Edit\Tab; -use Magento\Review\Test\Block\Adminhtml\ReviewsTab; +use Magento\Backend\Test\Block\Widget\Tab; /** - * Class Reviews - * Reviews tab on customer edit page + * Reviews tab on customer edit page. */ -class Reviews extends ReviewsTab +class Reviews extends Tab { - // + /** + * Product reviews block selector. + * + * @var string + */ + protected $reviews = '#reviwGrid'; + + /** + * Returns product reviews grid. + * + * @return \Magento\Review\Test\Block\Adminhtml\Grid + */ + public function getReviewsGrid() + { + return $this->blockFactory->create( + 'Magento\Review\Test\Block\Adminhtml\Grid', + ['element' => $this->_rootElement->find($this->reviews)] + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php deleted file mode 100644 index 404b7aabe878..000000000000 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php +++ /dev/null @@ -1,36 +0,0 @@ -blockFactory->create( - 'Magento\Review\Test\Block\Adminhtml\Grid', - ['element' => $this->_rootElement->find($this->reviews)] - ); - } -} From 3a2018c2b75c5139765f3041def7b5b602bdfe00 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Wed, 9 Mar 2016 18:28:40 +0200 Subject: [PATCH 14/17] MAGETWO-49390: Stabilize MX domain functional tests --- .../base/web/templates/grid/filters/elements/ui-select.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html index facdc717979b..8c0c3aac555a 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/filters/elements/ui-select.html @@ -122,7 +122,8 @@ ">
  • + data-bind="css: { _parent: $data.optgroup }" + data-role="option-group">
    bundle_dynamic_product bundle-product-%isolation% bundle_dynamic_%isolation% - Fixed + No bundle_dynamic_%isolation% dynamic-100 - Fixed + No 1 Bundle Product Fixed Required Together @@ -35,10 +35,10 @@ bundle_fixed_product bundle-product-%isolation% bundle_fixed_%isolation% - Dynamic + Yes bundle_sku_%isolation% fixed-756 - Dynamic + Yes default_subcategory Separately default_fixed diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml index 512907d97184..65c8a5469750 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml @@ -7,7 +7,7 @@ --> - \Magento\Ui\Test\Block\Adminhtml\Section + \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\ProductDetails [data-index='product-details'] css selector product @@ -173,16 +173,6 @@ [data-index='schedule-design-update'] css selector - - \Magento\Ui\Test\Block\Adminhtml\Section - [data-index='gift-wrapping-gift-messaging'] - css selector - - - \Magento\Ui\Test\Block\Adminhtml\Section - [data-index='downloadable'] - css selector - \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\Options [data-index="custom_options"] @@ -216,10 +206,6 @@ checkbox - - [name="product[gift_wrapping_price]"] - css selector - diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml index 0c02c916c333..b27dc6dda848 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest.xml @@ -13,7 +13,6 @@ 99.99 None 999 - This item has no weight default_subcategory MAGETWO-23002 In Stock @@ -34,7 +33,6 @@ 120.00 taxable_goods 999 - This item has no weight 45 In Stock Catalog, Search @@ -54,7 +52,6 @@ 185.00 None 999 - This item has no weight default_subcategory MAGETWO-23002 Out of Stock @@ -74,7 +71,6 @@ virtual_sku_%isolation% 99.99 taxable_goods - This item has no weight Out of Stock Search virtual-product-%isolation% @@ -90,7 +86,6 @@ virtual_sku_%isolation% 5.00 None - This item has no weight Out of Stock Catalog virtual-product-%isolation% @@ -107,7 +102,6 @@ 145.00 taxable_goods 999 - This item has no weight default_subcategory MAGETWO-23002 In Stock @@ -126,7 +120,6 @@ virtual_sku_%isolation% 99.99 None - This item has no weight default_subcategory 45 Out of Stock @@ -145,7 +138,6 @@ 5.00 taxable_goods Yes - This item has no weight Out of Stock Search virtual-product-%isolation% @@ -162,7 +154,6 @@ 120.00 None 999 - This item has no weight default_subcategory In Stock options_suite @@ -181,7 +172,6 @@ virtual_sku_%isolation% 99.99 taxable_goods - This item has no weight Out of Stock Catalog, Search virtual-product-%isolation% @@ -198,7 +188,6 @@ 99.99 None 999 - This item has no weight default_subcategory MAGETWO-23002 In Stock From cc5886a4993825821f3a422c03fbe6479f1e0c65 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Thu, 10 Mar 2016 15:58:48 +0200 Subject: [PATCH 16/17] MAGETWO-49390: Stabilize MX domain functional tests - Fixed UpdateAttributeSetTest; --- .../Catalog/Test/Block/Adminhtml/Product/ProductForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index 97d51281c0c5..0bd64eb03736 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -43,7 +43,7 @@ class ProductForm extends FormSections * * @var string */ - protected $customSection = '.admin__collapsible-title'; + protected $customSection = '[data-index="%s"] .admin__collapsible-title'; /** * Attribute block selector. From 2b0d7556e13ef741518eac9a68fe92cf955365d3 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Fri, 11 Mar 2016 15:04:25 +0200 Subject: [PATCH 17/17] MAGETWO-49390: Stabilize MX domain functional tests - Curl for bundle product updated; --- .../Bundle/Test/Handler/BundleProduct/Curl.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/BundleProduct/Curl.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/BundleProduct/Curl.php index 75222de8c73b..c4c00cf8d145 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/BundleProduct/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Handler/BundleProduct/Curl.php @@ -32,16 +32,16 @@ public function __construct(DataInterface $configuration, EventManagerInterface 'No' => 0, ], 'sku_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, + 'Yes' => 0, + 'No' => 1, ], 'price_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, + 'Yes' => 0, + 'No' => 1, ], 'weight_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, + 'Yes' => 0, + 'No' => 1, ], 'shipment_type' => [ 'Together' => 0,