Created
July 7, 2011 22:10
-
-
Save kilaulena/1070663 to your computer and use it in GitHub Desktop.
test capybara visibility
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
Then /^"([^\"]+)" should be visible$/ do |text| | |
assert page.has_xpath?("//*[not(descendant-or-self::script)][ancestor::*[contains(@style,'display: none;')]][contains(normalize-space(.),'#{text}')]") | |
end | |
Then /^"([^\"]+)" should not be visible$/ do |text| | |
assert page.has_xpath?("//*[not(descendant-or-self::script)][ancestor::*[contains(@style,'display: none;')]][contains(normalize-space(.),'#{text}')]") | |
end |
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
When I follow "¥ JPY" | |
Then "¥ JPY" should be visible within ".header_nav" | |
And "€ EUR" should not be visible within ".header_nav" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment