How do you verify that the submit button is disabled after clicking the capybara button?

We are trying to disable a specific submit button after clicking on it. Something like that:

assert !page.has_css?("#review_button[disabled='disabled']")
click_button "Review"
assert page.has_css?("#review_button[disabled='disabled']")

The problem, of course, is that the form is submitted before the second statement is validated. Is there a way to turn off the actual form submission or pause it until the second statement is verified?

+5
source share
1 answer

I remember that I had the same problem, and I never found a good way to do this, because, as you said, it goes only to the next statement when the "Review" action is completed.

, , , , , (, , ), , . ( ), , .

+1

All Articles