MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / until

Method until

rb/lib/selenium/webdriver/common/wait.rb:51–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 #
50
51 def until
52 end_time = current_time + @timeout
53 last_error = nil
54
55 until current_time > end_time
56 begin
57 result = yield
58 return result if result
59 rescue *@ignored => last_error # rubocop:disable Naming/RescuedExceptionsVariableName
60 # swallowed
61 end
62
63 sleep @interval
64 end
65
66 msg = if @message
67 @message.dup
68 elsif @message_provider
69 @message_provider.call
70 else
71 "timed out after #{@timeout} seconds"
72 end
73
74 msg << " (#{last_error.message})" if last_error
75
76 raise Error::TimeoutError, msg
77 end
78
79 private
80

Callers

nothing calls this directly

Calls 2

callMethod · 0.65
messageMethod · 0.45

Tested by

no test coverage detected