How to wait till an element appears after an AJAX call using capybara-webkit?
问题 The capybara method, wait_until doesn't seems to work for capybara-webkit. Is there any alternate solution for that, or any Javascript implementations? Intentionally need some replacement for sleep , e.g. sleep 2 . 回答1: You can take a look at this solution wrapped up by Thoughtbot: here I found it very useful. 回答2: If your AJAX call results in a change to the DOM, Capybara will wait for it if you do page.should have_selector?("some selector") It is an intentional Capybara feature that it