After I log in through devise I'm clicking on the button with attached javascript which makes some HTML visible.
<button id="btn_simple_search"
class="btn btn-primary btn-md well_button"
data-toggle="button"
>
Search
</button>
calls function
$("#btn_simple_search").click(function(){
$("#simple_search").toggle(500);
});
I would like for capybara test to wait till this function is completed (I don't know - like some callback or something) rather than make sleep 0.6
before I click other button or select some options from newly displayed HTML block. I'm using Minitest as the test framework. How to do it?
Above javascript is embedded directly on the page.