activate_reload_of_stale_elements.rb 614 B

12345678910111213141516
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://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(*, allow_reload: true, **, &optional_filter_block)
  8. super
  9. end
  10. end
  11. Capybara::Node::Base.include(ZammadActivateReloadOfStaleElements)
  12. Capybara::Node::Simple.include(ZammadActivateReloadOfStaleElements)