How do I fix my Cucumber expectation error when polling?

前端 未结 1 1322
忘掉有多难
忘掉有多难 2021-01-27 10:02

I have the helper sign_in which signs in a user. I\'m trying to use a new approach to make sure that the user signed in using polling:

def sign_in(         


        
1条回答
  •  不思量自难忘°
    2021-01-27 10:54

    You shouldn't need to do any of that.

    Capybara has Powerful synchronization features mean you never have to manually wait for asynchronous processes to complete

    Your test for page.should have_content just needs a bit more time, you can give it to it in the step or as a general setup. The default wait is 2 seconds, and you might need 5 seconds or more.

    Add Capybara.default_wait_time = 5

    In the link above, search down and find Asynchronous JavaScript (Ajax and friends)

    You should be able to delete your AsyncSupport entirely. Just remember, if you set this inside a step and you want the wait to be 2 seconds otherwise, you might want an ensure block to set it back to the original time.

    0 讨论(0)
提交回复
热议问题