Skip to content

Commit

Permalink
Maintenance: Try to make the modal actions in selenium more robust.
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikklein committed Dec 15, 2021
1 parent 39e8eae commit 429256e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/support/capybara/common_actions.rb
Expand Up @@ -253,22 +253,22 @@ def use_template(template)
# Checks if modal is ready
#
# @param timeout [Integer] seconds to wait
def modal_ready(timeout: 4)
def modal_ready(timeout: Capybara.default_max_wait_time)
wait(timeout).until_exists { find('.modal.in', wait: 0) }
end

# Checks if modal has disappeared
#
# @param timeout [Integer] seconds to wait
def modal_disappear(timeout: 4)
def modal_disappear(timeout: Capybara.default_max_wait_time)
wait(timeout).until_disappears { find('.modal', wait: 0) }
end

# Executes action inside of modal. Makes sure modal has opened and closes
#
# @param timeout [Integer] seconds to wait
# @param wait_for_disappear [Bool] wait for modal to close
def in_modal(timeout: 4, disappears: true, &block)
def in_modal(timeout: Capybara.default_max_wait_time, disappears: true, &block)
modal_ready(timeout: timeout)

within('.modal', &block)
Expand Down

0 comments on commit 429256e

Please sign in to comment.