lib/watir/wait.rb in watir-6.5.0 vs lib/watir/wait.rb in watir-6.6.0
- old
+ new
@@ -35,11 +35,11 @@
# @raise [TimeoutError] if timeout is exceeded
#
def until(deprecated_timeout = nil, deprecated_message = nil, timeout: nil, message: nil, interval: nil, object: nil)
if deprecated_message || deprecated_timeout
- warn "Instead of passing arguments into Wait#until method, use keywords"
+ Watir.logger.deprecate "Using arguments for Wait#until", "keywords"
timeout = deprecated_timeout
message = deprecated_message
end
timeout ||= Watir.default_timeout
run_with_timer(timeout, interval) do
@@ -61,11 +61,11 @@
# @raise [TimeoutError] if timeout is exceeded
#
def while(deprecated_timeout = nil, deprecated_message = nil, timeout: nil, message: nil, interval: nil, object: nil)
if deprecated_message || deprecated_timeout
- warn "Instead of passing arguments into Wait#while method, use keywords"
+ Watir.logger.deprecate "Using arguments for Wait#while", "keywords"
timeout = deprecated_timeout
message = deprecated_message
end
timeout ||= Watir.default_timeout
run_with_timer(timeout, interval) { return unless yield(object) }
@@ -115,11 +115,11 @@
# @param [String] message error message for when times out
#
def wait_until(deprecated_timeout = nil, deprecated_message = nil, timeout: nil, message: nil, interval: nil, &blk)
if deprecated_message || deprecated_timeout
- warn "Instead of passing arguments into #wait_until, use keywords"
+ Watir.logger.deprecate "Using arguments for #wait_until", "keywords"
timeout = deprecated_timeout
message = deprecated_message
end
message ||= "waiting for true condition on #{inspect}"
Wait.until(timeout: timeout, message: message, interval: interval, object: self, &blk)
@@ -141,11 +141,11 @@
# @param [String] message error message for when times out
#
def wait_while(deprecated_timeout = nil, deprecated_message = nil, timeout: nil, message: nil, interval: nil, &blk)
if deprecated_message || deprecated_timeout
- warn "Instead of passing arguments into #wait_while method, use keywords"
+ Watir.logger.deprecate "Using arguments for #wait_while", "keywords"
timeout = deprecated_timeout
message = deprecated_message
end
message ||= "waiting for false condition on #{inspect}"
Wait.while(timeout: timeout, message: message, interval: interval, object: self, &blk)
@@ -165,11 +165,11 @@
# @see Watir::Element#present?
#
def wait_until_present(deprecated_timeout = nil, timeout: nil, interval: nil)
if deprecated_timeout
- warn "Instead of passing arguments into #wait_until_present method, use keywords"
+ Watir.logger.deprecate "Using arguments for #wait_until_present", "keywords"
timeout = deprecated_timeout
end
wait_until(timeout: timeout, interval: interval, &:present?)
end
@@ -185,10 +185,10 @@
# @see Watir::Element#present?
#
def wait_while_present(deprecated_timeout = nil, timeout: nil)
if deprecated_timeout
- warn "Instead of passing arguments into #wait_while_present method, use keywords"
+ Watir.logger.deprecate "Using arguments for #wait_while_present", "keywords"
timeout = deprecated_timeout
end
wait_while(timeout: timeout) do
self.reset! if self.is_a? Watir::Element
self.present?