Maintenance: Enable allow_reload
for Capybara find methods to avoid Selenium::WebDriver::Error::StaleElementReferenceError exceptions.
This commit is contained in:
parent
1cb5b04d96
commit
88c5e0e10b
1 changed files with 16 additions and 0 deletions
16
spec/support/capybara/activate_reload_of_stale_elements.rb
Normal file
16
spec/support/capybara/activate_reload_of_stale_elements.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
||||
|
||||
# This file overwrites `Capybara::Node::Finders#all` to set the default value
|
||||
# of the `allow_reload` keyword argument to `true` (default: `false`) to enable
|
||||
# automatic reload of stale elements and avoid
|
||||
# `Selenium::WebDriver::Error::StaleElementReferenceError` exceptions.
|
||||
|
||||
module ZammadActivateReloadOfStaleElements
|
||||
|
||||
def all(*args, allow_reload: true, **options, &optional_filter_block)
|
||||
super(*args, allow_reload: allow_reload, **options, &optional_filter_block)
|
||||
end
|
||||
end
|
||||
|
||||
Capybara::Node::Base.include(ZammadActivateReloadOfStaleElements)
|
||||
Capybara::Node::Simple.include(ZammadActivateReloadOfStaleElements)
|
Loading…
Reference in a new issue