Testing for javascript alerts with Capybara Testing for javascript alerts with Capybara selenium selenium

Testing for javascript alerts with Capybara


I've tried to do it, but Capybara doesn't support it. Capybara comes with Selenium 2.0, not Selenium RC (as stated in the page), which is the library that supports that method.

Using it with Cucumber outside of Capybara involves loading and initializing the selenium-client driver. I assume you are using it within the context of Rails, so it will require setting up the environment, I'm not sure how much work is this, but I'd say is not worth the hassle.

If your concern are the alerts created by the link_to ... :confirm => "Are you sure?" and similar, don't worry, Cucumber provides a nice workaround for those with some pseudo-js emulation.