Cucumber Capybara scroll to bottom of page

2019-04-03 07:17发布

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?

2条回答
\"骚年 ilove
2楼-- · 2019-04-03 08:06

You could use javascript to achieve this:

page.execute_script "window.scrollBy(0,10000)"
查看更多
唯我独甜
3楼-- · 2019-04-03 08:20

I solved this with visit '#footer' inside a "scroll to the bottom of the page" step.

查看更多
登录 后发表回答