I've got a page which displays modal box from UI Bootstrap. My protractor test then clicks a button in the modal which closes it, the test then clicks another button on the page.
The problem is that there is nothing waiting until the modal actually disappears so quite often is tries to click the button on the page but fails because the modal backdrop is still covering the page.
Currently my code to close the modal looks like this:
@When /^I click button in modal with class "([^"]*)"$/, (className, callback) ->
element(By.css '.modal-dialog').
element(By.css 'button.' + className).
click().
then(callback)
Any idea how to wait until the modal disappears before triggering the callback?