How do I confirm a javascript popup with Capybara?

前端 未结 8 966
梦谈多话
梦谈多话 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:12

    try to add :js => true to your test.

    RSpec’s metadata feature can be used to switch to a different driver. Use :js => true to switch to the javascript driver, or provide a :driver option to switch to one specific driver. For example:

    it 'will use the default js driver' :js => true do
      ...
    end
    

提交回复
热议问题