#wait_for_ajax method for Capybara tests