Skip to content

Instantly share code, notes, and snippets.

@mxriverlynn
Created September 27, 2011 21:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxriverlynn/1246299 to your computer and use it in GitHub Desktop.
Save mxriverlynn/1246299 to your computer and use it in GitHub Desktop.
capybara has_image? matcher
module Capybara
class Session
def has_image?(src)
has_xpath?("//img[contains(@src,\"/images/#{src}\")]")
end
end
end
Then /^the biometrics section should be marked incomplete$/ do
within "#assessment-menu" do
page.should have_image "warning_24.png"
end
end
@jamogriff
Copy link

Cheers for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment