Skip to content

Commit bbdde4b

Browse files
author
Maksym Aposov
committed
MAGETWO-44516: Provide fix for Functional Tests MX
1 parent 91f33ac commit bbdde4b

File tree

2 files changed

+14
-4
lines changed
  • dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super

2 files changed

+14
-4
lines changed

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,21 @@ class Config extends Tab
6060
*
6161
* @var string
6262
*/
63-
protected $attributeElement = '.entry-edit.have-price';
63+
protected $attributeElement = 'tr[data-row-number]';
6464

6565
/**
6666
* Delete variation button selector.
6767
*
6868
* @var string
6969
*/
70-
protected $deleteVariationButton = '.action-delete';
70+
protected $deleteVariation = '[data-bind*="removeProduct"]';
71+
72+
/**
73+
* Action menu
74+
*
75+
* @var string
76+
*/
77+
protected $actionMenu = '.action-select';
7178

7279
/**
7380
* Variations content selector.
@@ -199,9 +206,10 @@ public function getDataFormTab($fields = null, SimpleElement $element = null)
199206
public function deleteAttributes()
200207
{
201208
$attributeElements = $this->_rootElement->getElements($this->attributeElement);
202-
$this->_rootElement->find($this->variationsContent)->click();
203209
foreach (array_reverse($attributeElements) as $element) {
204-
$element->find($this->deleteVariationButton)->click();
210+
$element->find($this->actionMenu)->hover();
211+
$element->find($this->actionMenu)->click();
212+
$element->find($this->deleteVariation)->click();
205213
}
206214
}
207215
}

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ protected function updateOptions(array $attribute)
272272
$label = isset($option['admin']) ? $option['admin'] : $option['label'];
273273
$optionContainer = $attributeBlock->find(sprintf($this->attributeOptionByName, $label));
274274

275+
//Create option
275276
if (!$optionContainer->isVisible()) {
276277
$mapping = $this->dataMapping($option);
277278
$attributeBlock->find($this->addOption)->click();
@@ -282,6 +283,7 @@ protected function updateOptions(array $attribute)
282283
->setValue($mapping['label']['value']);
283284
$this->getTemplateBlock()->waitLoader();
284285
$optionContainer->find('[data-action=save]')->click();
286+
$optionContainer = $attributeBlock->find(sprintf($this->attributeOptionByName, $label));
285287
}
286288
//Select option
287289
if (!$optionContainer->find('[type="checkbox"]')->isSelected()) {

0 commit comments

Comments
 (0)