How to click first link in list of items after upgrading to Capybara 2.0?

后端 未结 7 1091
抹茶落季
抹茶落季 2020-12-12 15:11

How to click first link in that case:

Agree
7条回答
  •  误落风尘
    2020-12-12 16:09

    Try the following:

    within ".item" do
      click_link("Agree", :match => :first)
    end
    

    Sources:

    • http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Actions#click_link-instance_method
    • https://github.com/jnicklas/capybara#strategy

提交回复
热议问题