How to check a checkbox in capybara?

前端 未结 13 1855
灰色年华
灰色年华 2020-11-30 23:34

I\'m using Rspec and Capybara.

How can I write a step to check a checkbox? I\'ve tried check by value but it can\'t find my checkbox<

相关标签:
13条回答
  • 2020-12-01 00:04
    check find(".whenever input")[:id]
    

    I think this will make capybara wait for any event listener attached to that input, which sometimes is a pain-in-the-ass if it doesn't waits .... If that input doesn't have an ID, choose another property (there must be one)...

    0 讨论(0)
提交回复
热议问题