lib/watir.rb in watir-6.16.0 vs lib/watir.rb in watir-6.16.1
- old
+ new
@@ -44,16 +44,13 @@
always_locate_message
true
end
def always_locate_message
- msg = <<~ALWAYS_LOCATE.tr("\n", ' ')
- Watir#always_locate is deprecated; elements are always cached and will always
- be re-located if they go stale before use.
- Use Element#stale? or Element#wait_until(&:stale?) if needed for flow control.
- ALWAYS_LOCATE
- Watir.logger.warn msg, ids: %i[always_locate deprecations]
+ msg = 'Watir#always_locate'
+ repl_msg = 'Element#stale? or Element#wait_until(&:stale?) if needed for flow control'
+ Watir.logger.deprecate msg, repl_msg, ids: [:always_locate]
end
#
# Whether or not Watir should prefer CSS when translating the Watir selector to Selenium.
#
@@ -62,15 +59,13 @@
prefer_css_message
false
end
def prefer_css_message
- msg = <<~PREFER_CSS.tr("\n", ' ')
- Watir#prefer_css is deprecated; all elements that can not be passed directly
- as Selenium locators will be translated to XPath. To continue using CSS Selectors
- require the watir_css gem - https://github.com/watir/watir_css
- PREFER_CSS
- Watir.logger.warn msg, ids: %i[prefer_css deprecations]
+ msg = 'Watir#prefer_css'
+ repl_msg = 'watir_css gem - https://github.com/watir/watir_css'
+
+ Watir.logger.deprecate msg, repl_msg, ids: [:prefer_css]
end
#
# Default wait time for wait methods.
#