Let's assume that we have some element with id = "scrollElement" and overflow: auto (or scroll).
And we have to test scrolling in capybara and some headless browser with javascript (poltergeist and phantomjs in my case).
I did it this way:
And we have to test scrolling in capybara and some headless browser with javascript (poltergeist and phantomjs in my case).
I did it this way: