Capybara: is it possible to get an attribute value from a css string?

后端 未结 3 1230
悲哀的现实
悲哀的现实 2020-12-14 16:17

If I\'ve got some HTML like:

I\'ve seen that I

3条回答
  •  清歌不尽
    2020-12-14 16:41

    If you are looking for an HTML element with a given value for a given attribute, you could do:

    expect(page).to have_css('a[href="www"]')
    

提交回复
热议问题