How do I confirm a javascript popup with Capybara?

前端 未结 8 987
梦谈多话
梦谈多话 2020-12-08 01:55

I\'ve tried several examples found online, but with no luck. I am looking to confirm the confirm message of a delete link. The last attempt was the code below, but that re

8条回答
  •  余生分开走
    2020-12-08 02:21

    for capybara-webkit:

    page.driver.browser.accept_js_confirms
    page.driver.browser.reject_js_confirms
    

    which is still working, but the documentation says also:

    page.driver.accept_js_confirms!
    page.driver.accept_js_confirms!
    

    See https://github.com/thoughtbot/capybara-webkit , search "accept_js_confirms"

提交回复
热议问题