Skip to content

Commit 585dbf6

Browse files
committed
MAGETWO-65534: Unstable Tests in L4 Functional Tests EE build on mainline develop: AddToCartCrossSellTest, NavigateUpSellProductsTest, NavigateRelatedProductsTest
- Update searchAndSelect method for Grid;
1 parent 8523c4e commit 585dbf6

File tree

1 file changed

+19
-3
lines changed
  • dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml

1 file changed

+19
-3
lines changed

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ public function searchAndSelect(array $filter)
277277
$rowItem = $this->getRow($filter);
278278
$this->waitUntilRowIsVisible($rowItem);
279279
if ($rowItem->isVisible()) {
280+
$this->waitUntilSelectRowIsVisible($rowItem);
280281
$rowItem->find($this->selectItem)->click();
281282
} else {
282283
throw new \Exception("Searched item was not found by filter\n" . print_r($filter, true));
@@ -287,16 +288,31 @@ public function searchAndSelect(array $filter)
287288
/**
288289
* Wait for row is visible in the grid.
289290
*
290-
* @param \Magento\Mtf\Client\ElementInterface $rowItem
291-
* @return bool
291+
* @param ElementInterface $rowItem
292+
* @return void
292293
*/
293294
private function waitUntilRowIsVisible($rowItem)
294295
{
295296
$locator = $rowItem->getLocator()['value'];
296297
$strategy = $rowItem->getLocator()['using'];
297298
$this->_rootElement->waitUntil(
298299
function () use ($locator, $strategy) {
299-
return $this->browser->find($locator, $strategy)->isVisible();
300+
return $this->_rootElement->find($locator, $strategy)->isVisible();
301+
}
302+
);
303+
}
304+
305+
/**
306+
* Wait for select row is visible.
307+
*
308+
* @param ElementInterface $rowItem
309+
* @return void
310+
*/
311+
private function waitUntilSelectRowIsVisible($rowItem)
312+
{
313+
$this->_rootElement->waitUntil(
314+
function () use ($rowItem) {
315+
return $rowItem->find($this->selectItem)->isVisible();
300316
}
301317
);
302318
}

0 commit comments

Comments
 (0)