Last active
December 16, 2015 09:29
-
-
Save codenamev/5413099 to your computer and use it in GitHub Desktop.
Cucumber step to look for a resource (link, image, etc.) on the page.
This file contains hidden or 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 /^I should see the ([^"]*) "([^"]*)"$/ do |element_type, file_name| | |
case element_type | |
when /link/ | |
page.should have_xpath("//link[contains(@href, '#{file_name}')]") | |
when /img/ | |
page.should have_xpath("//img[contains(@src, '#{file_name}')]") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment