Skip to content

Commit 4455274

Browse files
author
Maksym Aposov
committed
MAGETWO-44516: Provide fix for Functional Tests MX
1 parent 2f0d958 commit 4455274

File tree

2 files changed

+17
-6
lines changed
  • dev/tests/functional/tests/app/Magento

2 files changed

+17
-6
lines changed

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,27 @@ class Attribute extends Form
160160
*/
161161
public function fillAttributes(array $attributes)
162162
{
163+
$attributesFilters = [];
163164
foreach ($attributes as $attribute) {
164165
if (empty($attribute['attribute_id'])) {
165166
$this->createNewVariationSet($attribute);
166167
}
168+
$attributesFilters[] = ['frontend_label' => $attribute['frontend_label']];
167169
}
168170

169-
foreach ($attributes as $attribute) {
170-
$this->getAttributesGrid()->searchAndSelect(['frontend_label' => $attribute['frontend_label']]);
171-
$this->browser->find($this->nextButton)->click();
172-
$this->getTemplateBlock()->waitLoader();
171+
//select attributes
172+
$this->getAttributesGrid()->resetFilter();
173+
if ($this->_rootElement->find('[class$=no-data]')->isVisible()) {
174+
return;
175+
}
176+
$this->getAttributesGrid()->selectItems($attributesFilters);
177+
178+
$this->browser->find($this->nextButton)->click();
179+
$this->getTemplateBlock()->waitLoader();
180+
181+
//update attributes options
182+
foreach ($attributes as $attribute)
183+
{
173184
$this->updateOptions($attribute);
174185
}
175186

dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,15 @@ public function massaction(array $items, $action, $acceptAlert = false, $massAct
286286
* @return void
287287
* @throws \Exception
288288
*/
289-
protected function selectItems(array $items)
289+
public function selectItems(array $items)
290290
{
291291
$this->sortGridByField('ID');
292292
foreach ($items as $item) {
293293
$this->_rootElement->find($this->currentPage)->setValue('');
294294
$this->waitLoader();
295295
$selectItem = $this->getRow($item)->find($this->selectItem);
296296
do {
297-
if ($selectItem->isVisible()) {
297+
if ($selectItem->isVisible() && !$selectItem->isSelected()) {
298298
$selectItem->click();
299299
break;
300300
}

0 commit comments

Comments
 (0)