Skip to content

Commit 6189bef

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-67109' into 2.1.8-develop-pr20
2 parents 1abd6f9 + 3cc79f3 commit 6189bef

File tree

1 file changed

+17
-4
lines changed
  • dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml

1 file changed

+17
-4
lines changed

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,23 @@ public function selectMassAction($massActionSelection)
346346
public function selectAction($action)
347347
{
348348
$actionType = is_array($action) ? key($action) : $action;
349-
$this->getGridHeaderElement()->find($this->actionButton)->click();
350-
$this->getGridHeaderElement()
351-
->find(sprintf($this->actionList, $actionType), Locator::SELECTOR_XPATH)
352-
->click();
349+
// Find Action button (dropdown actually)
350+
$actionButton = $this->getGridHeaderElement()->find($this->actionButton);
351+
// Click it to show options (actions)
352+
$actionButton->click();
353+
// Find needed element (action) to click on
354+
$actionElement = $this->getGridHeaderElement()
355+
->find(sprintf($this->actionList, $actionType), Locator::SELECTOR_XPATH);
356+
// Scroll to show it (action option) on viewport. It can be out of viewport because of small window height.
357+
$actionElement->hover();
358+
// In case of small window after scroll to action element it may became hidden
359+
// It because of appearance special top-stick panel of actions
360+
// So we need to click action button again to show list of actions
361+
if (!$actionElement->isVisible()) {
362+
$actionButton->click();
363+
}
364+
// Click on action element to run appropriate command
365+
$actionElement->click();
353366
if (is_array($action)) {
354367
$this->getGridHeaderElement()
355368
->find(sprintf($this->actionList, end($action)), Locator::SELECTOR_XPATH)

0 commit comments

Comments
 (0)