File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,11 @@ class DataGrid extends Grid
162
162
*/
163
163
protected $ currentPage = ".//*[@data-ui-id='current-page-input'][not(ancestor::*[@class='sticky-header'])] " ;
164
164
165
+ /**
166
+ * Top page element to implement a scrolling in case of grid element not visible.
167
+ */
168
+ private $ topElementToScroll = 'header.page-header ' ;
169
+
165
170
/**
166
171
* Clear all applied Filters.
167
172
*
@@ -368,6 +373,10 @@ public function selectItems(array $items, $isSortable = true)
368
373
$ this ->sortGridByField ('ID ' );
369
374
}
370
375
foreach ($ items as $ item ) {
376
+ //Scroll to the top of the page in case current page input is not visible.
377
+ if (!$ this ->_rootElement ->find ($ this ->currentPage , Locator::SELECTOR_XPATH )->isVisible ()) {
378
+ $ this ->browser ->find ($ this ->topElementToScroll )->hover ();
379
+ }
371
380
$ this ->_rootElement ->find ($ this ->currentPage , Locator::SELECTOR_XPATH )->setValue ('' );
372
381
$ this ->waitLoader ();
373
382
$ selectItem = $ this ->getRow ($ item )->find ($ this ->selectItem );
You can’t perform that action at this time.
0 commit comments