Skip to content

Commit

Permalink
Fix functional test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalevanec committed Feb 13, 2019
1 parent c7e0a40 commit 9eaa5fc
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ class DataGrid extends Grid
*/
protected $currentPage = ".//*[@data-ui-id='current-page-input'][not(ancestor::*[@class='sticky-header'])]";

/**
* Top page element to implement a scrolling in case of grid element not visible.
*/
private $topElementToScroll = 'header.page-header';

/**
* Clear all applied Filters.
*
Expand Down Expand Up @@ -368,6 +373,10 @@ public function selectItems(array $items, $isSortable = true)
$this->sortGridByField('ID');
}
foreach ($items as $item) {
//Scroll to the top of the page in case current page input is not visible.
if (!$this->_rootElement->find($this->currentPage, Locator::SELECTOR_XPATH)->isVisible()) {
$this->browser->find($this->topElementToScroll)->hover();
}
$this->_rootElement->find($this->currentPage, Locator::SELECTOR_XPATH)->setValue('');
$this->waitLoader();
$selectItem = $this->getRow($item)->find($this->selectItem);
Expand Down

0 comments on commit 9eaa5fc

Please sign in to comment.