Refactoring: Set wait timeout to 0 for modal element checks to improve lookup performance.

This commit is contained in:
Mantas Masalskis 2020-04-14 00:08:14 +03:00 committed by Thorsten Eckel
parent afa6b9984a
commit 57b1defd8d

View file

@ -187,14 +187,14 @@ module CommonActions
# #
# @param timeout [Integer] seconds to wait # @param timeout [Integer] seconds to wait
def modal_ready(timeout: 4) def modal_ready(timeout: 4)
wait(timeout).until_exists { find('.modal.in') } wait(timeout).until_exists { find('.modal.in', wait: 0) }
end end
# Checks if modal has disappeared # Checks if modal has disappeared
# #
# @param timeout [Integer] seconds to wait # @param timeout [Integer] seconds to wait
def modal_disappear(timeout: 4) def modal_disappear(timeout: 4)
wait(timeout).until_disappears { find('.modal.in') } wait(timeout).until_disappears { find('.modal', wait: 0) }
end end
# Scrolls to given element # Scrolls to given element