ignore errors when trying to create detailed error message
This commit is contained in:
parent
a65e51a7c7
commit
1a21567b9a
|
@ -61,10 +61,15 @@ module Capybara
|
||||||
end
|
end
|
||||||
|
|
||||||
if @node and check_visible_text? and report_on_invisible
|
if @node and check_visible_text? and report_on_invisible
|
||||||
invisible_text = text(@node, :all)
|
begin
|
||||||
invisible_count = invisible_text.scan(@search_regexp).size
|
raise Selenium::WebDriver::Error::UnknownError
|
||||||
if invisible_count != @count
|
invisible_text = text(@node, :all)
|
||||||
details_message << ". it was found #{invisible_count} #{Capybara::Helpers.declension("time", "times", invisible_count)} including non-visible text"
|
invisible_count = invisible_text.scan(@search_regexp).size
|
||||||
|
if invisible_count != @count
|
||||||
|
details_message << ". it was found #{invisible_count} #{Capybara::Helpers.declension("time", "times", invisible_count)} including non-visible text"
|
||||||
|
end
|
||||||
|
rescue
|
||||||
|
# An error getting the non-visible text (if element goes out of scope) should not affect the response
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue