watir 6.11.0 → 6.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES.md +17 -0
  3. data/lib/watir.rb +5 -14
  4. data/lib/watir/adjacent.rb +2 -2
  5. data/lib/watir/alert.rb +1 -1
  6. data/lib/watir/browser.rb +11 -2
  7. data/lib/watir/capabilities.rb +8 -3
  8. data/lib/watir/container.rb +4 -1
  9. data/lib/watir/element_collection.rb +24 -10
  10. data/lib/watir/elements/element.rb +19 -9
  11. data/lib/watir/elements/select.rb +3 -2
  12. data/lib/watir/js_execution.rb +20 -9
  13. data/lib/watir/legacy_wait.rb +3 -2
  14. data/lib/watir/locators.rb +6 -6
  15. data/lib/watir/locators/element/locator.rb +42 -18
  16. data/lib/watir/locators/element/selector_builder/xpath.rb +5 -1
  17. data/lib/watir/logger.rb +24 -11
  18. data/lib/watir/screenshot.rb +9 -2
  19. data/lib/watir/wait.rb +36 -16
  20. data/lib/watirspec.rb +2 -1
  21. data/lib/watirspec/guards.rb +1 -1
  22. data/lib/watirspec/runner.rb +8 -2
  23. data/lib/watirspec/server.rb +1 -1
  24. data/spec/{container_spec.rb → unit/container_spec.rb} +4 -2
  25. data/spec/{element_locator_spec.rb → unit/element_locator_spec.rb} +30 -5
  26. data/spec/unit/logger_spec.rb +78 -0
  27. data/spec/unit/unit_helper.rb +6 -0
  28. data/spec/unit/wait_spec.rb +95 -0
  29. data/spec/watirspec/alert_spec.rb +1 -8
  30. data/spec/watirspec/browser_spec.rb +241 -0
  31. data/spec/{click_spec.rb → watirspec/click_spec.rb} +0 -0
  32. data/spec/watirspec/elements/checkbox_spec.rb +1 -1
  33. data/spec/watirspec/elements/del_spec.rb +1 -1
  34. data/spec/watirspec/elements/div_spec.rb +19 -8
  35. data/spec/watirspec/elements/divs_spec.rb +12 -0
  36. data/spec/watirspec/elements/dt_spec.rb +2 -2
  37. data/spec/watirspec/elements/element_spec.rb +220 -9
  38. data/spec/watirspec/elements/hn_spec.rb +1 -1
  39. data/spec/watirspec/elements/hns_spec.rb +1 -1
  40. data/spec/{input_spec.rb → watirspec/elements/input_spec.rb} +0 -0
  41. data/spec/watirspec/elements/ins_spec.rb +1 -1
  42. data/spec/watirspec/elements/labels_spec.rb +1 -1
  43. data/spec/watirspec/elements/li_spec.rb +1 -1
  44. data/spec/watirspec/elements/link_spec.rb +1 -2
  45. data/spec/watirspec/elements/ol_spec.rb +2 -4
  46. data/spec/watirspec/elements/p_spec.rb +1 -1
  47. data/spec/watirspec/elements/pre_spec.rb +1 -1
  48. data/spec/watirspec/elements/select_list_spec.rb +2 -4
  49. data/spec/watirspec/elements/span_spec.rb +2 -3
  50. data/spec/watirspec/elements/strong_spec.rb +1 -1
  51. data/spec/watirspec/elements/table_spec.rb +2 -6
  52. data/spec/watirspec/elements/td_spec.rb +1 -2
  53. data/spec/watirspec/elements/text_field_spec.rb +11 -0
  54. data/spec/watirspec/elements/text_fields_spec.rb +1 -1
  55. data/spec/watirspec/elements/ul_spec.rb +1 -2
  56. data/spec/watirspec/html/forms_with_input_elements.html +2 -1
  57. data/spec/watirspec/html/wait.html +12 -0
  58. data/spec/watirspec/relaxed_locate_spec.rb +28 -27
  59. data/spec/{special_chars_spec.rb → watirspec/special_chars_spec.rb} +0 -0
  60. data/spec/watirspec/support/rspec_matchers.rb +88 -0
  61. data/spec/watirspec/wait_spec.rb +5 -104
  62. data/spec/watirspec/window_switching_spec.rb +1 -1
  63. data/watir.gemspec +1 -1
  64. metadata +21 -21
  65. data/spec/browser_spec.rb +0 -280
  66. data/spec/element_spec.rb +0 -150
  67. data/spec/logger_spec.rb +0 -46
  68. data/spec/watirspec/support/raise_exception_matchers.rb +0 -36
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 8eaa5c46491ba52da6c95709e75cc9759e51de70b8a5687c2d44668c1bcd7bee
4
- data.tar.gz: e66fd1830e0442e4165476ecdca900ec5aaf0aa7879f8006c223402d9442ad0d
2
+ SHA1:
3
+ metadata.gz: ea86da9b066569e766ab50f2f0657d7bc77501ab
4
+ data.tar.gz: 07ad7bd26a6dc2b01b998fe64ef5254289541dc1
5
5
  SHA512:
6
- metadata.gz: 3492caa375debcda81ccc04efec7d2c34af1caa9689ad66e6d60d44bc23f51c103a60070e493d0d1e54255fc77837f10e5aa54054dd66ae1c794546f6ec29ceb
7
- data.tar.gz: d27c43b7e043a1f2602959bc48be08efe4d4a12fa6ce5f353c1ea38f4b629452153c5232a393510dbed4608fd18fd8f69fbf7a08c573036ee3017d163d781e82
6
+ metadata.gz: 4814e526875cba217e35219544f3322baecd947df1e00cb347224bf544cdc806bcd51768ca6394130f792b575010240dbcaba141468760aab448cfcd9e14228e
7
+ data.tar.gz: a6fc636ad8301a955430501f5d293094b4028337a80ef9b2c7a6dfdc634f4482dab0c7c84216651f8a8037b5c0f310be06467e359a43707a0477eb6e64bf1c89
data/CHANGES.md CHANGED
@@ -1,3 +1,20 @@
1
+ ### 6.12.0 (2018-07-24)
2
+
3
+ * Allow elements to be located with attributes that have underscores (thanks John Fitisoff)
4
+ * Get array of elements from an Element Collection using a Range (#738)
5
+ * Deprecate using `#present?` or `#visible?` to determine if an element is stale
6
+ * Allow getting element attribute values with a Symbol
7
+ * Add new functionality to `#flash` (thanks Gijs Paulides)
8
+ * Fix bug preventing text_field from waiting until present (#675)
9
+ * Fix bug allowing `StaleElementReferenceError` during element location
10
+ * Add support for Wait methods to receive `Proc` as message values
11
+ * Add support to ignore specific warnings logged by Watir
12
+ * Deprecate locating elements by ordered parameters
13
+ * Changed scope for locator namespacing (Thanks Aleksandar)
14
+ * Deprecate current implementation of `#visible?`
15
+ * Update logic `#wait_while_present` and `#wait_until_present`
16
+ * Deprecate `#wait_while_present` and `#wait_until_present` for non-Element classes
17
+
1
18
  ### 6.11.0 (2018-05-18)
2
19
 
3
20
  * Improve lazy loading of element collections
@@ -24,7 +24,7 @@ module Watir
24
24
 
25
25
  class << self
26
26
 
27
- attr_writer :relaxed_locate, :always_locate, :default_timeout, :prefer_css, :locator_namespace
27
+ attr_writer :relaxed_locate, :always_locate, :default_timeout, :prefer_css
28
28
 
29
29
  #
30
30
  # Whether or not Watir should wait for an element to be found or present
@@ -46,11 +46,12 @@ module Watir
46
46
  end
47
47
 
48
48
  def always_locate_message
49
- Watir.logger.warn <<-EOS
49
+ msg = <<-EOS.gsub("\n", " ")
50
50
  Watir#always_locate is deprecated; elements are always cached and will always
51
51
  be re-located if they go stale before use.
52
52
  Use Element#stale? or Element#wait_until(&:stale?) if needed for flow control.
53
53
  EOS
54
+ Watir.logger.warn msg, ids: [:always_locate, :deprecations]
54
55
  end
55
56
 
56
57
  #
@@ -63,11 +64,12 @@ Use Element#stale? or Element#wait_until(&:stale?) if needed for flow control.
63
64
  end
64
65
 
65
66
  def prefer_css_message
66
- Watir.logger.warn <<-EOS
67
+ msg = <<-EOS.gsub("\n", " ")
67
68
  Watir#prefer_css is deprecated; all elements that can not be passed directly
68
69
  as Selenium locators will be translated to XPath. To continue using CSS Selectors
69
70
  require the watir_css gem - https://github.com/watir/watir_css
70
71
  EOS
72
+ Watir.logger.warn msg, ids: [:prefer_css, :deprecations]
71
73
  end
72
74
 
73
75
  #
@@ -78,15 +80,6 @@ require the watir_css gem - https://github.com/watir/watir_css
78
80
  @default_timeout ||= 30
79
81
  end
80
82
 
81
- #
82
- # Whether the locators should be used from a different namespace.
83
- # Defaults to Watir::Locators.
84
- #
85
-
86
- def locator_namespace
87
- @locator_namespace ||= Watir::Locators
88
- end
89
-
90
83
  #
91
84
  # @api private
92
85
  #
@@ -156,5 +149,3 @@ require 'watir/elements/input'
156
149
  require 'watir/radio_set'
157
150
 
158
151
  require 'watir/aliases'
159
-
160
- Watir.tag_to_class.freeze
@@ -58,7 +58,7 @@ module Watir
58
58
  #
59
59
  # @example
60
60
  # browser.text_field(name: "new_user_first_name").following_siblings.size
61
- # #=> 52
61
+ # #=> 53
62
62
  #
63
63
 
64
64
  def following_siblings(opt = {})
@@ -73,7 +73,7 @@ module Watir
73
73
  #
74
74
  # @example
75
75
  # browser.text_field(name: "new_user_first_name").siblings.size
76
- # #=> 56
76
+ # #=> 57
77
77
  #
78
78
 
79
79
  def siblings(opt = {})
@@ -110,7 +110,7 @@ module Watir
110
110
  message = "This code has slept for the duration of the default timeout "
111
111
  message << "waiting for an Alert to exist. If the test is still passing, "
112
112
  message << "consider using Alert#exists? instead of rescuing UnknownObjectException"
113
- Watir.logger.warn message
113
+ Watir.logger.warn message, ids: [:wait_for_alert]
114
114
  end
115
115
  raise Exception::UnknownObjectException, 'unable to locate alert'
116
116
  end
@@ -9,7 +9,7 @@ module Watir
9
9
  include HasWindow
10
10
  include Waitable
11
11
 
12
- attr_writer :default_context, :original_window
12
+ attr_writer :default_context, :original_window, :locator_namespace
13
13
  attr_reader :driver
14
14
  attr_reader :after_hooks
15
15
  alias_method :wd, :driver # ensures duck typing with Watir::Element
@@ -290,7 +290,7 @@ module Watir
290
290
  #
291
291
 
292
292
  def screenshot
293
- Screenshot.new driver
293
+ Screenshot.new self
294
294
  end
295
295
 
296
296
  #
@@ -326,6 +326,15 @@ module Watir
326
326
  self
327
327
  end
328
328
 
329
+ #
330
+ # Whether the locators should be used from a different namespace.
331
+ # Defaults to Watir::Locators.
332
+ #
333
+
334
+ def locator_namespace
335
+ @locator_namespace ||= Watir::Locators
336
+ end
337
+
329
338
  private
330
339
 
331
340
  def wrap_elements_in(scope, obj)
@@ -50,7 +50,8 @@ module Watir
50
50
 
51
51
  %i(open_timeout read_timeout client_timeout).each do |t|
52
52
  next if http_client.nil? || !respond_to?(t)
53
- Watir.logger.warn "You can now pass #{t} value directly into Watir::Browser opt without needing to use :http_client"
53
+ Watir.logger.warn "You can now pass #{t} value directly into Watir::Browser opt without needing to use :http_client",
54
+ ids: [:http_client, :use_capabilities]
54
55
  end
55
56
 
56
57
  http_client ||= Selenium::WebDriver::Remote::Http::Default.new
@@ -81,7 +82,10 @@ module Watir
81
82
  profile = @options.delete(:profile)
82
83
  if browser_options.is_a? Selenium::WebDriver::Firefox::Options
83
84
  @selenium_opts[:options] = browser_options
84
- Watir.logger.deprecate 'Initializing Browser with both :profile and :option', ':profile as a key inside :option' if profile
85
+ if profile
86
+ Watir.logger.deprecate 'Initializing Browser with both :profile and :option', ':profile as a key inside :option',
87
+ ids: [:firefox_profile]
88
+ end
85
89
  end
86
90
  if @options.delete(:headless)
87
91
  browser_options ||= {}
@@ -111,7 +115,8 @@ module Watir
111
115
  caps = @options.delete(:desired_capabilities)
112
116
 
113
117
  if caps
114
- Watir.logger.warn 'You can now pass values directly into Watir::Browser opt without needing to use :desired_capabilities'
118
+ Watir.logger.warn 'You can now pass values directly into Watir::Browser opt without needing to use :desired_capabilities',
119
+ ids: [:use_capabilities]
115
120
  @selenium_opts.merge!(@options)
116
121
  else
117
122
  caps = Selenium::WebDriver::Remote::Capabilities.send @browser, @options
@@ -36,6 +36,9 @@ module Watir
36
36
  def extract_selector(selectors)
37
37
  case selectors.size
38
38
  when 2
39
+ Watir.logger.deprecate "Using ordered parameters to locate elements (:#{selectors.first}, #{selectors.last.inspect})",
40
+ "{#{selectors.first}: #{selectors.last.inspect}}",
41
+ ids: [:selector_parameters]
39
42
  return { selectors[0] => selectors[1] }
40
43
  when 1
41
44
  obj = selectors.first
@@ -44,7 +47,7 @@ module Watir
44
47
  return {}
45
48
  end
46
49
 
47
- raise ArgumentError, "expected Hash or (:how, 'what'), got #{selectors.inspect}"
50
+ raise ArgumentError, "expected Hash, got #{selectors.inspect}"
48
51
  end
49
52
 
50
53
  end # Container
@@ -35,20 +35,24 @@ module Watir
35
35
  alias_method :empty?, :none?
36
36
 
37
37
  #
38
- # Get the element at the given index.
38
+ # Get the element at the given index or range.
39
39
  #
40
40
  # Any call to an ElementCollection including an adjacent selector
41
41
  # can not be lazy loaded because it must store correct type
42
42
  #
43
- # @param [Integer] idx Index of wanted element, 0-indexed
44
- # @return [Watir::Element] Returns an instance of a Watir::Element subclass
43
+ # Ranges can not be lazy loaded
44
+ #
45
+ # @param [Integer, Range] value Index (0-based) or Range of desired element(s)
46
+ # @return [Watir::Element, Watir::ElementCollection] Returns an instance of a Watir::Element subclass
45
47
  #
46
48
 
47
- def [](idx)
48
- if @selector.key? :adjacent
49
- to_a[idx] || element_class.new(@query_scope, {invalid_locator: true})
49
+ def [](value)
50
+ if value.is_a?(Range)
51
+ to_a[value]
52
+ elsif @selector.key? :adjacent
53
+ to_a[value] || element_class.new(@query_scope, {invalid_locator: true})
50
54
  else
51
- element_class.new(@query_scope, @selector.merge(index: idx))
55
+ element_class.new(@query_scope, @selector.merge(index: value))
52
56
  end
53
57
  end
54
58
 
@@ -87,9 +91,9 @@ module Watir
87
91
  tag_name = element.tag_name.to_sym
88
92
  hash[tag_name] ||= 0
89
93
  hash[tag_name] += 1
90
- Watir.tag_to_class[tag_name].new(@query_scope, @selector.merge(element: e,
91
- tag_name: tag_name,
92
- index: hash[tag_name] - 1))
94
+ Watir.element_class_for(tag_name).new(@query_scope, @selector.merge(element: e,
95
+ tag_name: tag_name,
96
+ index: hash[tag_name] - 1))
93
97
  else
94
98
  element
95
99
  end
@@ -107,6 +111,16 @@ module Watir
107
111
  self
108
112
  end
109
113
 
114
+ #
115
+ # Returns browser.
116
+ #
117
+ # @return [Watir::Browser]
118
+ #
119
+
120
+ def browser
121
+ @query_scope.browser
122
+ end
123
+
110
124
  #
111
125
  # Returns true if two element collections are equal.
112
126
  #
@@ -262,11 +262,12 @@ module Watir
262
262
  # browser.a(id: "link_2").attribute_value "title"
263
263
  # #=> "link_title_2"
264
264
  #
265
- # @param [String] attribute_name
265
+ # @param [String, ::Symbol] attribute_name
266
266
  # @return [String, nil]
267
267
  #
268
268
 
269
269
  def attribute_value(attribute_name)
270
+ attribute_name = attribute_name.to_s.tr('_', '-') if attribute_name.is_a?(::Symbol)
270
271
  element_call { @element.attribute attribute_name }
271
272
  end
272
273
  alias_method :attribute, :attribute_value
@@ -402,9 +403,13 @@ module Watir
402
403
  #
403
404
 
404
405
  def visible?
406
+ Watir.logger.warn "#visible? behavior will be changing slightly, consider switching to #present? (more details: http://watir.com/element-existentialism/)",
407
+ ids: [:visible_element]
405
408
  assert_exists
406
409
  @element.displayed?
407
410
  rescue Selenium::WebDriver::Error::StaleElementReferenceError
411
+ Watir.logger.deprecate "Checking `#visible? == false` to determine a stale element", "`#stale? == true`",
412
+ ids: [:stale_visible]
408
413
  reset!
409
414
  raise unknown_exception
410
415
  end
@@ -429,7 +434,13 @@ module Watir
429
434
  #
430
435
 
431
436
  def present?
432
- visible?
437
+ assert_exists
438
+ @element.displayed?
439
+ rescue Selenium::WebDriver::Error::StaleElementReferenceError
440
+ Watir.logger.deprecate "Checking `#present? == false` to determine a stale element", "`#stale? == true`",
441
+ ids: [:stale_present]
442
+ reset!
443
+ false
433
444
  rescue UnknownObjectException, UnknownFrameException
434
445
  false
435
446
  end
@@ -534,8 +545,8 @@ module Watir
534
545
  end
535
546
 
536
547
  def wait_for_present
537
- return visible? unless Watir.relaxed_locate?
538
- return if present?
548
+ p = present?
549
+ return p if !Watir.relaxed_locate? || p
539
550
 
540
551
  begin
541
552
  @query_scope.wait_for_present unless @query_scope.is_a? Browser
@@ -555,8 +566,7 @@ module Watir
555
566
  begin
556
567
  wait_until(&:enabled?)
557
568
  rescue Watir::Wait::TimeoutError
558
- message = "element present, but timed out after #{Watir.default_timeout} seconds, waiting for #{inspect} to be enabled"
559
- raise ObjectDisabledException, message
569
+ raise_disabled
560
570
  end
561
571
  end
562
572
 
@@ -609,7 +619,7 @@ module Watir
609
619
  end
610
620
 
611
621
  def raise_disabled
612
- message = "element present and enabled, but timed out after #{Watir.default_timeout} seconds, waiting for #{inspect} to not be disabled"
622
+ message = "element present, but timed out after #{Watir.default_timeout} seconds, waiting for #{inspect} to be enabled"
613
623
  raise ObjectDisabledException, message
614
624
  end
615
625
 
@@ -663,11 +673,11 @@ module Watir
663
673
  retry
664
674
  rescue Selenium::WebDriver::Error::ElementNotVisibleError, Selenium::WebDriver::Error::ElementNotInteractableError
665
675
  raise_present unless Wait.timer.remaining_time > 0
666
- raise_present unless precondition == :wait_for_present || precondition == :wait_for_enabled
676
+ raise_present unless %i[wait_for_present wait_for_enabled wait_for_writable].include?(precondition)
667
677
  retry
668
678
  rescue Selenium::WebDriver::Error::InvalidElementStateError
669
679
  raise_disabled unless Wait.timer.remaining_time > 0
670
- raise_disabled unless precondition == :wait_for_writable || precondition == :wait_for_enabled
680
+ raise_disabled unless %i[wait_for_present wait_for_enabled wait_for_writable].include?(precondition)
671
681
  retry
672
682
  rescue Selenium::WebDriver::Error::NoSuchWindowError
673
683
  raise Exception::NoMatchingWindowFoundException, "browser window was closed"
@@ -94,7 +94,7 @@ module Watir
94
94
  #
95
95
 
96
96
  def select_value(str_or_rx)
97
- Watir.logger.deprecate '#select_value', "#select"
97
+ Watir.logger.deprecate '#select_value', "#select", ids: [:select_value]
98
98
  select_by str_or_rx
99
99
  end
100
100
 
@@ -157,7 +157,8 @@ module Watir
157
157
  found = find_options(:value, str_or_rx)
158
158
 
159
159
  if found && found.size > 1
160
- Watir.logger.deprecate "Selecting Multiple Options with #select", "#select_all"
160
+ Watir.logger.deprecate "Selecting Multiple Options with #select", "#select_all",
161
+ ids: [:select_by]
161
162
  end
162
163
  return select_matching(found) if found && found.any?
163
164
  raise NoValueFoundException, "#{str_or_rx.inspect} not found in select list"
@@ -33,29 +33,40 @@ module Watir
33
33
  # browser.li(id: 'non_link_1').flash
34
34
  # browser.li(id: 'non_link_1').flash(color: "green", flashes: 3, delay: 0.05)
35
35
  # browser.li(id: 'non_link_1').flash(color: "yellow")
36
+ # browser.li(id: 'non_link_1').flash(color: ["yellow", "green"])
36
37
  # browser.li(id: 'non_link_1').flash(flashes: 4)
37
38
  # browser.li(id: 'non_link_1').flash(delay: 0.1)
39
+ # browser.li(id: 'non_link_1').flash(:fast)
40
+ # browser.li(id: 'non_link_1').flash(:slow)
41
+ # browser.li(id: 'non_link_1').flash(:rainbow)
38
42
  #
39
- # @param [String] color what color to flash with
43
+ # @param [Symbol] preset :fast, :slow, :long or :rainbow for pre-set values
44
+ # @param [String/Array] color what 'color' or [colors] to flash with
40
45
  # @param [Integer] flashes number of times element should be flashed
41
46
  # @param [Integer, Float] delay how long to wait between flashes
42
47
  #
43
48
  # @return [Watir::Element]
44
49
  #
45
50
 
46
- def flash(color: 'red', flashes: 5, delay: 0.2)
47
- background_color = style("backgroundColor")
51
+ def flash(preset = :default, color: 'red', flashes: 10, delay: 0.1)
52
+ presets = {
53
+ fast: { delay: 0.04 },
54
+ slow: { delay: 0.2 },
55
+ long: { flashes: 5, delay: 0.5 },
56
+ rainbow: { flashes: 5, color: %w(red orange yellow green blue indigo violet) }
57
+ }
58
+ return self.flash(presets[preset]) unless presets[preset].nil?
59
+
60
+ background_color = original_color = style("background-color")
48
61
  background_color = 'white' if background_color.empty?
49
- element_color = element_call { execute_js(:backgroundColor, @element) }.strip
50
- element_color = 'white' if element_color.empty?
62
+ colors = Array(color).push(background_color)
51
63
 
52
- (flashes * 2).times do |n|
53
- nextcolor = n.even? ? color : background_color
54
- element_call { execute_js(:backgroundColor, @element, nextcolor) }
64
+ (colors * flashes).each do |next_color|
65
+ element_call { execute_js(:backgroundColor, @element, next_color) }
55
66
  sleep(delay)
56
67
  end
57
68
 
58
- element_call { execute_js(:backgroundColor, @element, element_color) }
69
+ element_call { execute_js(:backgroundColor, @element, original_color) }
59
70
 
60
71
  self
61
72
  end
@@ -83,7 +83,7 @@ module Watir
83
83
  def when_present(timeout = nil)
84
84
  warning = '#when_present has been deprecated and is unlikely to be needed; '
85
85
  warning << 'replace this with #wait_until_present if a wait is still needed'
86
- Watir.logger.warn warning
86
+ Watir.logger.warn warning, ids: [:when_present, :deprecations]
87
87
 
88
88
  timeout ||= Watir.default_timeout
89
89
  message = "waiting for #{selector_string} to become present"
@@ -109,7 +109,8 @@ module Watir
109
109
  #
110
110
 
111
111
  def when_enabled(timeout = nil)
112
- Watir.logger.warn '#when_enabled has been deprecated and is unlikely to be needed'
112
+ Watir.logger.warn '#when_enabled has been deprecated and is unlikely to be needed',
113
+ ids: [:when_enabled, :deprecations]
113
114
 
114
115
  timeout ||= Watir.default_timeout
115
116
  message = "waiting for #{selector_string} to become enabled"
@@ -26,23 +26,23 @@ module Watir
26
26
  module Locators
27
27
  module ClassHelpers
28
28
  def locator_class
29
- class_from_string("#{Watir.locator_namespace}::#{element_class_name}::Locator") ||
29
+ class_from_string("#{browser.locator_namespace}::#{element_class_name}::Locator") ||
30
30
  class_from_string("Watir::Locators::#{element_class_name}::Locator") ||
31
- class_from_string("#{Watir.locator_namespace}::Element::Locator") ||
31
+ class_from_string("#{browser.locator_namespace}::Element::Locator") ||
32
32
  Watir::Locators::Element::Locator
33
33
  end
34
34
 
35
35
  def element_validator_class
36
- class_from_string("#{Watir.locator_namespace}::#{element_class_name}::Validator") ||
36
+ class_from_string("#{browser.locator_namespace}::#{element_class_name}::Validator") ||
37
37
  class_from_string("Watir::Locators::#{element_class_name}::Validator") ||
38
- class_from_string("#{Watir.locator_namespace}::Element::Validator") ||
38
+ class_from_string("#{browser.locator_namespace}::Element::Validator") ||
39
39
  Watir::Locators::Element::Validator
40
40
  end
41
41
 
42
42
  def selector_builder_class
43
- class_from_string("#{Watir.locator_namespace}::#{element_class_name}::SelectorBuilder") ||
43
+ class_from_string("#{browser.locator_namespace}::#{element_class_name}::SelectorBuilder") ||
44
44
  class_from_string("Watir::Locators::#{element_class_name}::SelectorBuilder") ||
45
- class_from_string("#{Watir.locator_namespace}::Element::SelectorBuilder") ||
45
+ class_from_string("#{browser.locator_namespace}::Element::SelectorBuilder") ||
46
46
  Watir::Locators::Element::SelectorBuilder
47
47
  end
48
48