lib/watir/wait.rb in watir-6.0.0 vs lib/watir/wait.rb in watir-6.0.1
- old
+ new
@@ -113,11 +113,16 @@
#
# @param [Fixnum] timeout seconds to wait before timing out
# @param [String] message error message for when times out
#
- def wait_until(timeout: nil, message: nil, &blk)
+ def wait_until(deprecated_timeout = nil, deprecated_message = nil, timeout: nil, message: nil, &blk)
+ if deprecated_message || deprecated_timeout
+ warn "Instead of passing arguments into #wait_until, use keywords"
+ timeout = deprecated_timeout
+ message = deprecated_message
+ end
message ||= "waiting for true condition on #{selector_string}"
Wait.until(timeout: timeout, message: message, object: self, &blk)
self
end
@@ -134,10 +139,15 @@
#
# @param [Fixnum] timeout seconds to wait before timing out
# @param [String] message error message for when times out
#
- def wait_while(timeout: nil, message: nil, &blk)
+ def wait_while(deprecated_timeout = nil, deprecated_message = nil, timeout: nil, message: nil, &blk)
+ if deprecated_message || deprecated_timeout
+ warn "Instead of passing arguments into #wait_while method, use keywords"
+ timeout = deprecated_timeout
+ message = deprecated_message
+ end
message ||= "waiting for false condition on #{selector_string}"
Wait.while(timeout: timeout, message: message, object: self, &blk)
self
end