Maintenance: until_constant browser test helper method does not actually performs a Timout and can't handle nil as a result.

This commit is contained in:
Thorsten Eckel 2020-09-23 12:07:46 +02:00
parent e6bc9280bd
commit c6e11f3f4e

View file

@ -122,9 +122,16 @@ module BrowserTestHelper
#
def until_constant
previous = nil
loop do
sleep __getobj__.instance_variable_get(:@interval)
timeout = __getobj__.instance_variable_get(:@timeout)
interval = __getobj__.instance_variable_get(:@interval)
rounds = (timeout / interval).to_i
rounds.times do
sleep interval
latest = yield
next if latest.nil?
break if latest == previous
previous = latest