Im using Capybara & I am trying to find some xpath that may or may not exist on a page.
I would like to be able to use a selector that I created myself (:tab_is_selected), so that I could search for an xpath like:
page.should have_xpath(:tab_is_selected, selectable)
Where selectable is the name of some tab.
If I use find, it just fails because the xpath does not always exist.
Does anyone know if there is some library in Capybara that could allow me to do this?
Otherwise I will have to write my own module.
Thanks.
I have been using:
and
http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Matchers