Sredoje Cutovic
Sredoje Cutovic

Reputation: 133

Cucumber wait for page to finish page load

What's the best way to force cucumber to wait for page to finish loading of the page?

Im logging into my website and on the first page I have a string "User profile"

page.should have_css(".user-profile") page.should have_content("User profile")

Sometimes logging takes to long and test fails on this step page.should have_content("User profile") how to to fix this?

Upvotes: 1

Views: 2244

Answers (1)

netoctone
netoctone

Reputation: 231

Try to set a different wait time https://github.com/jnicklas/capybara#asynchronous-javascript-ajax-and-friends

Capybara.default_wait_time = 5

Upvotes: 2

Related Questions