mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Don't swallow errors in find, closes #190
This commit is contained in:
parent
b022ca9926
commit
05d969756f
1 changed files with 4 additions and 3 deletions
|
@ -25,9 +25,10 @@ module Capybara
|
||||||
#
|
#
|
||||||
def find(*args)
|
def find(*args)
|
||||||
node = wait_conditionally_until { all(*args).first }
|
node = wait_conditionally_until { all(*args).first }
|
||||||
ensure
|
unless node
|
||||||
options = if args.last.is_a?(Hash) then args.last else {} end
|
options = if args.last.is_a?(Hash) then args.last else {} end
|
||||||
raise Capybara::ElementNotFound, options[:message] || "Unable to find '#{args[1] || args[0]}'" unless node
|
raise Capybara::ElementNotFound, options[:message] || "Unable to find '#{args[1] || args[0]}'"
|
||||||
|
end
|
||||||
return node
|
return node
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue