Created
March 26, 2015 22:03
-
-
Save hubertlepicki/d7a492824efc5d906b4c to your computer and use it in GitHub Desktop.
Allow Capybara to click on links without href
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module XPath | |
module HTML | |
def link(locator) | |
locator = locator.to_s | |
link = descendant(:a) #[attr(:href)] | |
link[attr(:id).equals(locator) | string.n.is(locator) | attr(:title).is(locator) | descendant(:img)[attr(:alt).is(locator)]] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment