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:
parent
e6bc9280bd
commit
c6e11f3f4e
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue