I'd like to use my Cucumber/Capybara setup to test endless scroll by driving a browser and scrolling to the bottom of the page to ensure that the new content is loaded. Is there a way to do this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You could use javascript to achieve this:
page.execute_script "window.scrollBy(0,10000)"
回答2:
I solved this with visit '#footer' inside a "scroll to the bottom of the page" step.