diff --git a/tests/acceptance/pageObjects/FilesPageElement/filesList.js b/tests/acceptance/pageObjects/FilesPageElement/filesList.js index 8fa6537b2a8..9fe5158ed33 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/filesList.js +++ b/tests/acceptance/pageObjects/FilesPageElement/filesList.js @@ -474,10 +474,6 @@ module.exports = { // Check if the item is inside the view after it's renredered if (position.top > -1 && position.top <= visiblePosition) { - // Scroll item to the top of the list - scrollDistance += position.top - tableHeaderPosition - virtualScrollWrapper.scrollTop = scrollDistance - done() return } @@ -488,8 +484,9 @@ module.exports = { return } + // we assume that we'll always have enough screen height for showing 5 list items at once, + // thus, scrolling by 5 items at a time and checking again if the item is now visible. const listItemHeight = document.querySelector(listItemSelector).clientHeight - scrollDistance += listItemHeight * 5 virtualScrollWrapper.scrollTop = scrollDistance setTimeout(function() {