@@ -346,10 +346,23 @@ public function selectMassAction($massActionSelection)
346
346
public function selectAction ($ action )
347
347
{
348
348
$ 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 ();
353
366
if (is_array ($ action )) {
354
367
$ this ->getGridHeaderElement ()
355
368
->find (sprintf ($ this ->actionList , end ($ action )), Locator::SELECTOR_XPATH )
0 commit comments