activate_reload_of_stale_elements.rb 694 B

12345678910111213141516
  1. # Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
  2. # This file overwrites `Capybara::Node::Finders#all` to set the default value
  3. # of the `allow_reload` keyword argument to `true` (default: `false`) to enable
  4. # automatic reload of stale elements and avoid
  5. # `Selenium::WebDriver::Error::StaleElementReferenceError` exceptions.
  6. module ZammadActivateReloadOfStaleElements
  7. def all(*args, allow_reload: true, **options, &optional_filter_block)
  8. super(*args, allow_reload: allow_reload, **options, &optional_filter_block)
  9. end
  10. end
  11. Capybara::Node::Base.include(ZammadActivateReloadOfStaleElements)
  12. Capybara::Node::Simple.include(ZammadActivateReloadOfStaleElements)