Class: Capybara::Node::Base
- Inherits:
-
Object
- Object
- Capybara::Node::Base
- Defined in:
- lib/capybara/slow_finder_errors.rb
Instance Method Summary collapse
- #synchronize_with_timeout_error(*args, &block) ⇒ Object (also: #synchronize)
Instance Method Details
#synchronize_with_timeout_error(*args, &block) ⇒ Object Also known as: synchronize
7 8 9 10 11 12 13 14 15 |
# File 'lib/capybara/slow_finder_errors.rb', line 7 def synchronize_with_timeout_error(*args, &block) start_time = Time.now synchronize_without_timeout_error(*args, &block) rescue ::ElementNotFound => e seconds = args.first || .default_max_wait_time raise e unless seconds > 0 && Time.now-start_time > seconds raise e, "#{$!}\n\n#{ADDITIONAL_MESSAGE}", e.backtrace end |