watir 6.19.1 → 7.0.0.beta1

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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/.github/actions/install-chrome/action.yml +1 -0
  3. data/.github/actions/setup-linux/action.yml +8 -0
  4. data/.github/workflows/tests.yml +100 -0
  5. data/CHANGES.md +7 -0
  6. data/README.md +1 -4
  7. data/Rakefile +1 -1
  8. data/lib/watir.rb +1 -45
  9. data/lib/watir/alert.rb +3 -8
  10. data/lib/watir/capabilities.rb +54 -230
  11. data/lib/watir/cell_container.rb +4 -4
  12. data/lib/watir/container.rb +4 -26
  13. data/lib/watir/elements/checkbox.rb +4 -4
  14. data/lib/watir/elements/date_field.rb +4 -4
  15. data/lib/watir/elements/date_time_field.rb +4 -4
  16. data/lib/watir/elements/element.rb +12 -49
  17. data/lib/watir/elements/file_field.rb +4 -4
  18. data/lib/watir/elements/font.rb +4 -4
  19. data/lib/watir/elements/hidden.rb +4 -4
  20. data/lib/watir/elements/html_elements.rb +444 -445
  21. data/lib/watir/elements/iframe.rb +4 -4
  22. data/lib/watir/elements/radio.rb +4 -4
  23. data/lib/watir/elements/select.rb +12 -78
  24. data/lib/watir/elements/svg_elements.rb +96 -96
  25. data/lib/watir/elements/text_field.rb +4 -4
  26. data/lib/watir/generator/base/generator.rb +4 -4
  27. data/lib/watir/generator/base/visitor.rb +0 -29
  28. data/lib/watir/generator/html/generator.rb +2 -1
  29. data/lib/watir/has_window.rb +4 -4
  30. data/lib/watir/http_client.rb +0 -8
  31. data/lib/watir/locators.rb +1 -5
  32. data/lib/watir/locators/button/matcher.rb +0 -23
  33. data/lib/watir/locators/button/selector_builder/xpath.rb +4 -15
  34. data/lib/watir/locators/element/matcher.rb +4 -19
  35. data/lib/watir/locators/element/selector_builder.rb +2 -37
  36. data/lib/watir/locators/element/selector_builder/xpath.rb +26 -41
  37. data/lib/watir/radio_set.rb +2 -2
  38. data/lib/watir/row_container.rb +4 -4
  39. data/lib/watir/version.rb +1 -1
  40. data/lib/watir/wait.rb +4 -74
  41. data/lib/watir/window.rb +6 -22
  42. data/lib/watir/window_collection.rb +5 -49
  43. data/lib/watirspec/implementation.rb +4 -0
  44. data/spec/spec_helper.rb +2 -7
  45. data/spec/unit/capabilities_spec.rb +196 -929
  46. data/spec/unit/match_elements/button_spec.rb +0 -13
  47. data/spec/unit/match_elements/element_spec.rb +38 -47
  48. data/spec/unit/match_elements/text_field_spec.rb +6 -6
  49. data/spec/unit/selector_builder/element_spec.rb +6 -23
  50. data/spec/unit/selector_builder/text_field_spec.rb +6 -7
  51. data/spec/watirspec/alert_spec.rb +4 -21
  52. data/spec/watirspec/browser_spec.rb +2 -2
  53. data/spec/watirspec/cookies_spec.rb +1 -1
  54. data/spec/watirspec/elements/button_spec.rb +0 -10
  55. data/spec/watirspec/elements/checkbox_spec.rb +10 -22
  56. data/spec/watirspec/elements/div_spec.rb +4 -34
  57. data/spec/watirspec/elements/divs_spec.rb +2 -2
  58. data/spec/watirspec/elements/element_spec.rb +38 -84
  59. data/spec/watirspec/elements/form_spec.rb +2 -4
  60. data/spec/watirspec/elements/links_spec.rb +4 -4
  61. data/spec/watirspec/elements/select_list_spec.rb +7 -108
  62. data/spec/watirspec/elements/span_spec.rb +2 -2
  63. data/spec/watirspec/elements/spans_spec.rb +1 -1
  64. data/spec/watirspec/elements/strong_spec.rb +1 -1
  65. data/spec/watirspec/html/non_control_elements.html +8 -3
  66. data/spec/watirspec/support/rspec_matchers.rb +1 -32
  67. data/spec/watirspec/window_switching_spec.rb +2 -49
  68. data/spec/watirspec_helper.rb +6 -1
  69. data/watir.gemspec +3 -4
  70. metadata +11 -32
  71. data/.github/workflows/linux.yml +0 -61
  72. data/.github/workflows/mac.yml +0 -55
  73. data/.github/workflows/unit.yml +0 -37
  74. data/.github/workflows/windows.yml +0 -39
  75. data/lib/watir/legacy_wait.rb +0 -123
  76. data/spec/unit/container_spec.rb +0 -35
  77. data/spec/watirspec/legacy_wait_spec.rb +0 -216
@@ -91,12 +91,12 @@ module Watir
91
91
  end # FrameCollection
92
92
 
93
93
  module Container
94
- def frame(*args)
95
- Frame.new(self, extract_selector(args).merge(tag_name: 'frame'))
94
+ def frame(opts = {})
95
+ Frame.new(self, opts.merge(tag_name: 'frame'))
96
96
  end
97
97
 
98
- def frames(*args)
99
- FrameCollection.new(self, extract_selector(args).merge(tag_name: 'frame'))
98
+ def frames(opts = {})
99
+ FrameCollection.new(self, opts.merge(tag_name: 'frame'))
100
100
  end
101
101
  end # Container
102
102
 
@@ -39,12 +39,12 @@ module Watir
39
39
  end # Radio
40
40
 
41
41
  module Container
42
- def radio(*args)
43
- Radio.new(self, extract_selector(args).merge(tag_name: 'input', type: 'radio'))
42
+ def radio(opts = {})
43
+ Radio.new(self, opts.merge(tag_name: 'input', type: 'radio'))
44
44
  end
45
45
 
46
- def radios(*args)
47
- RadioCollection.new(self, extract_selector(args).merge(tag_name: 'input', type: 'radio'))
46
+ def radios(opts = {})
47
+ RadioCollection.new(self, opts.merge(tag_name: 'input', type: 'radio'))
48
48
  end
49
49
  end # Container
50
50
 
@@ -33,27 +33,11 @@ module Watir
33
33
  if str_or_rx.size > 1 || str_or_rx.first.is_a?(Array)
34
34
  str_or_rx.flatten.map { |v| select_all_by v }.first
35
35
  else
36
- str_or_rx.flatten.map { |v| select_by v }.first
36
+ found = find_options(:value, str_or_rx.flatten.first).first
37
+ select_matching([found])
37
38
  end
38
39
  end
39
40
 
40
- #
41
- # Select all options whose text or label matches the given string.
42
- #
43
- # @param [String, Regexp] str_or_rx
44
- # @raise [Watir::Exception::NoValueFoundException] if the value does not exist.
45
- # @return [String] The text of the first option selected.
46
- #
47
-
48
- def select_all(*str_or_rx)
49
- Watir.logger.deprecate('#select_all',
50
- '#select with an Array instance',
51
- ids: [:select_all])
52
-
53
- results = str_or_rx.flatten.map { |v| select_all_by v }
54
- results.first
55
- end
56
-
57
41
  #
58
42
  # Uses JavaScript to select the option whose text matches the given string.
59
43
  #
@@ -69,37 +53,6 @@ module Watir
69
53
  end
70
54
  end
71
55
 
72
- #
73
- # Uses JavaScript to select all options whose text matches the given string.
74
- #
75
- # @param [String, Regexp] str_or_rx
76
- # @raise [Watir::Exception::NoValueFoundException] if the value does not exist.
77
- #
78
-
79
- def select_all!(*str_or_rx)
80
- Watir.logger.deprecate('#select_all!',
81
- '#select! with an Array instance',
82
- ids: [:select_all])
83
-
84
- results = str_or_rx.flatten.map { |v| select_by!(v, :multiple) }
85
- results.first
86
- end
87
-
88
- #
89
- # Selects the option(s) whose value attribute matches the given string.
90
- #
91
- # @see +select+
92
- #
93
- # @param [String, Regexp] str_or_rx
94
- # @raise [Watir::Exception::NoValueFoundException] if the value does not exist.
95
- # @return [String] The option selected. If multiple options match, returns the first match
96
- #
97
-
98
- def select_value(str_or_rx)
99
- Watir.logger.deprecate '#select_value', '#select', ids: [:select_value]
100
- select_by str_or_rx
101
- end
102
-
103
56
  #
104
57
  # Returns true if any of the selected options' text or label matches the given value.
105
58
  #
@@ -155,17 +108,6 @@ module Watir
155
108
 
156
109
  private
157
110
 
158
- def select_by(str_or_rx)
159
- found = find_options(:value, str_or_rx)
160
-
161
- if found.size > 1
162
- Watir.logger.deprecate 'Selecting multiple options with #select using a String or Regexp value',
163
- '#select with the desired values in an Array instance',
164
- ids: [:select_by]
165
- end
166
- select_matching(found)
167
- end
168
-
169
111
  def select_by!(str_or_rx, number)
170
112
  js_rx = process_str_or_rx(str_or_rx)
171
113
 
@@ -208,27 +150,20 @@ module Watir
208
150
  def select_all_by(str_or_rx)
209
151
  raise Error, 'you can only use #select_all on multi-selects' unless multiple?
210
152
 
211
- found = find_options :text, str_or_rx
212
-
213
- select_matching(found)
153
+ select_matching(find_options(:text, str_or_rx))
214
154
  end
215
155
 
216
156
  def find_options(how, str_or_rx)
157
+ msg = "expected String, Numeric or Regexp, got #{str_or_rx.inspect}:#{str_or_rx.class}"
158
+ raise TypeError, msg unless [String, Numeric, Regexp].any? { |k| str_or_rx.is_a?(k) }
159
+
217
160
  wait_while do
218
- case str_or_rx
219
- when String, Numeric, Regexp
220
- @found = how == :value ? options(value: str_or_rx) : []
221
- @found = options(text: str_or_rx) if @found.empty?
222
- @found = options(label: str_or_rx) if @found.empty?
223
- @found.empty? && Watir.relaxed_locate?
224
- else
225
- raise TypeError, "expected String or Regexp, got #{str_or_rx.inspect}:#{str_or_rx.class}"
226
- end
161
+ @found = how == :value ? options(value: str_or_rx) : []
162
+ @found = options(text: str_or_rx) if @found.empty?
163
+ @found = options(label: str_or_rx) if @found.empty?
164
+ @found.empty?
227
165
  end
228
- # TODO: Remove conditional when remove relaxed_locate toggle
229
- return @found unless @found.empty?
230
-
231
- raise_no_value_found(str_or_rx)
166
+ @found
232
167
  rescue Wait::TimeoutError
233
168
  raise_no_value_found(str_or_rx)
234
169
  end
@@ -241,8 +176,7 @@ module Watir
241
176
  def select_matching(elements)
242
177
  elements = [elements.first] unless multiple?
243
178
  elements.each { |e| e.click unless e.selected? }
244
- # TODO: this can go back to #exist? after `:stale_exists` deprecation removed
245
- elements.first.stale? ? '' : elements.first.text
179
+ elements.first.exists? ? elements.first.text : ''
246
180
  end
247
181
  end # Select
248
182
 
@@ -255,242 +255,242 @@ module Watir
255
255
  module Container
256
256
 
257
257
  # @return [Circle]
258
- def circle(*args)
259
- Circle.new(self, extract_selector(args).merge(tag_name: "circle"))
258
+ def circle(opts = {})
259
+ Circle.new(self, opts.merge(tag_name: "circle"))
260
260
  end
261
261
  # @return [CircleCollection]
262
- def circles(*args)
263
- CircleCollection.new(self, extract_selector(args).merge(tag_name: "circle"))
262
+ def circles(opts = {})
263
+ CircleCollection.new(self, opts.merge(tag_name: "circle"))
264
264
  end
265
265
  Watir.tag_to_class[:circle] = Circle
266
266
 
267
267
  # @return [Defs]
268
- def defs(*args)
269
- Defs.new(self, extract_selector(args).merge(tag_name: "defs"))
268
+ def defs(opts = {})
269
+ Defs.new(self, opts.merge(tag_name: "defs"))
270
270
  end
271
271
  # @return [DefsCollection]
272
- def defss(*args)
273
- DefsCollection.new(self, extract_selector(args).merge(tag_name: "defs"))
272
+ def defss(opts = {})
273
+ DefsCollection.new(self, opts.merge(tag_name: "defs"))
274
274
  end
275
275
  Watir.tag_to_class[:defs] = Defs
276
276
 
277
277
  # @return [Desc]
278
- def desc(*args)
279
- Desc.new(self, extract_selector(args).merge(tag_name: "desc"))
278
+ def desc(opts = {})
279
+ Desc.new(self, opts.merge(tag_name: "desc"))
280
280
  end
281
281
  # @return [DescCollection]
282
- def descs(*args)
283
- DescCollection.new(self, extract_selector(args).merge(tag_name: "desc"))
282
+ def descs(opts = {})
283
+ DescCollection.new(self, opts.merge(tag_name: "desc"))
284
284
  end
285
285
  Watir.tag_to_class[:desc] = Desc
286
286
 
287
287
  # @return [Ellipse]
288
- def ellipse(*args)
289
- Ellipse.new(self, extract_selector(args).merge(tag_name: "ellipse"))
288
+ def ellipse(opts = {})
289
+ Ellipse.new(self, opts.merge(tag_name: "ellipse"))
290
290
  end
291
291
  # @return [EllipseCollection]
292
- def ellipses(*args)
293
- EllipseCollection.new(self, extract_selector(args).merge(tag_name: "ellipse"))
292
+ def ellipses(opts = {})
293
+ EllipseCollection.new(self, opts.merge(tag_name: "ellipse"))
294
294
  end
295
295
  Watir.tag_to_class[:ellipse] = Ellipse
296
296
 
297
297
  # @return [ForeignObject]
298
- def foreign_object(*args)
299
- ForeignObject.new(self, extract_selector(args).merge(tag_name: "foreignObject"))
298
+ def foreign_object(opts = {})
299
+ ForeignObject.new(self, opts.merge(tag_name: "foreignObject"))
300
300
  end
301
301
  # @return [ForeignObjectCollection]
302
- def foreign_objects(*args)
303
- ForeignObjectCollection.new(self, extract_selector(args).merge(tag_name: "foreignObject"))
302
+ def foreign_objects(opts = {})
303
+ ForeignObjectCollection.new(self, opts.merge(tag_name: "foreignObject"))
304
304
  end
305
305
  Watir.tag_to_class[:foreignObject] = ForeignObject
306
306
 
307
307
  # @return [G]
308
- def g(*args)
309
- G.new(self, extract_selector(args).merge(tag_name: "g"))
308
+ def g(opts = {})
309
+ G.new(self, opts.merge(tag_name: "g"))
310
310
  end
311
311
  # @return [GCollection]
312
- def gs(*args)
313
- GCollection.new(self, extract_selector(args).merge(tag_name: "g"))
312
+ def gs(opts = {})
313
+ GCollection.new(self, opts.merge(tag_name: "g"))
314
314
  end
315
315
  Watir.tag_to_class[:g] = G
316
316
 
317
317
  # @return [Line]
318
- def line(*args)
319
- Line.new(self, extract_selector(args).merge(tag_name: "line"))
318
+ def line(opts = {})
319
+ Line.new(self, opts.merge(tag_name: "line"))
320
320
  end
321
321
  # @return [LineCollection]
322
- def lines(*args)
323
- LineCollection.new(self, extract_selector(args).merge(tag_name: "line"))
322
+ def lines(opts = {})
323
+ LineCollection.new(self, opts.merge(tag_name: "line"))
324
324
  end
325
325
  Watir.tag_to_class[:line] = Line
326
326
 
327
327
  # @return [LinearGradient]
328
- def linear_gradient(*args)
329
- LinearGradient.new(self, extract_selector(args).merge(tag_name: "linearGradient"))
328
+ def linear_gradient(opts = {})
329
+ LinearGradient.new(self, opts.merge(tag_name: "linearGradient"))
330
330
  end
331
331
  # @return [LinearGradientCollection]
332
- def linear_gradients(*args)
333
- LinearGradientCollection.new(self, extract_selector(args).merge(tag_name: "linearGradient"))
332
+ def linear_gradients(opts = {})
333
+ LinearGradientCollection.new(self, opts.merge(tag_name: "linearGradient"))
334
334
  end
335
335
  Watir.tag_to_class[:linearGradient] = LinearGradient
336
336
 
337
337
  # @return [Marker]
338
- def marker(*args)
339
- Marker.new(self, extract_selector(args).merge(tag_name: "marker"))
338
+ def marker(opts = {})
339
+ Marker.new(self, opts.merge(tag_name: "marker"))
340
340
  end
341
341
  # @return [MarkerCollection]
342
- def markers(*args)
343
- MarkerCollection.new(self, extract_selector(args).merge(tag_name: "marker"))
342
+ def markers(opts = {})
343
+ MarkerCollection.new(self, opts.merge(tag_name: "marker"))
344
344
  end
345
345
  Watir.tag_to_class[:marker] = Marker
346
346
 
347
347
  # @return [Metadata]
348
- def metadata(*args)
349
- Metadata.new(self, extract_selector(args).merge(tag_name: "metadata"))
348
+ def metadata(opts = {})
349
+ Metadata.new(self, opts.merge(tag_name: "metadata"))
350
350
  end
351
351
  # @return [MetadataCollection]
352
- def metadatas(*args)
353
- MetadataCollection.new(self, extract_selector(args).merge(tag_name: "metadata"))
352
+ def metadatas(opts = {})
353
+ MetadataCollection.new(self, opts.merge(tag_name: "metadata"))
354
354
  end
355
355
  Watir.tag_to_class[:metadata] = Metadata
356
356
 
357
357
  # @return [Path]
358
- def path(*args)
359
- Path.new(self, extract_selector(args).merge(tag_name: "path"))
358
+ def path(opts = {})
359
+ Path.new(self, opts.merge(tag_name: "path"))
360
360
  end
361
361
  # @return [PathCollection]
362
- def paths(*args)
363
- PathCollection.new(self, extract_selector(args).merge(tag_name: "path"))
362
+ def paths(opts = {})
363
+ PathCollection.new(self, opts.merge(tag_name: "path"))
364
364
  end
365
365
  Watir.tag_to_class[:path] = Path
366
366
 
367
367
  # @return [Pattern]
368
- def pattern(*args)
369
- Pattern.new(self, extract_selector(args).merge(tag_name: "pattern"))
368
+ def pattern(opts = {})
369
+ Pattern.new(self, opts.merge(tag_name: "pattern"))
370
370
  end
371
371
  # @return [PatternCollection]
372
- def patterns(*args)
373
- PatternCollection.new(self, extract_selector(args).merge(tag_name: "pattern"))
372
+ def patterns(opts = {})
373
+ PatternCollection.new(self, opts.merge(tag_name: "pattern"))
374
374
  end
375
375
  Watir.tag_to_class[:pattern] = Pattern
376
376
 
377
377
  # @return [Polygon]
378
- def polygon(*args)
379
- Polygon.new(self, extract_selector(args).merge(tag_name: "polygon"))
378
+ def polygon(opts = {})
379
+ Polygon.new(self, opts.merge(tag_name: "polygon"))
380
380
  end
381
381
  # @return [PolygonCollection]
382
- def polygons(*args)
383
- PolygonCollection.new(self, extract_selector(args).merge(tag_name: "polygon"))
382
+ def polygons(opts = {})
383
+ PolygonCollection.new(self, opts.merge(tag_name: "polygon"))
384
384
  end
385
385
  Watir.tag_to_class[:polygon] = Polygon
386
386
 
387
387
  # @return [Polyline]
388
- def polyline(*args)
389
- Polyline.new(self, extract_selector(args).merge(tag_name: "polyline"))
388
+ def polyline(opts = {})
389
+ Polyline.new(self, opts.merge(tag_name: "polyline"))
390
390
  end
391
391
  # @return [PolylineCollection]
392
- def polylines(*args)
393
- PolylineCollection.new(self, extract_selector(args).merge(tag_name: "polyline"))
392
+ def polylines(opts = {})
393
+ PolylineCollection.new(self, opts.merge(tag_name: "polyline"))
394
394
  end
395
395
  Watir.tag_to_class[:polyline] = Polyline
396
396
 
397
397
  # @return [RadialGradient]
398
- def radial_gradient(*args)
399
- RadialGradient.new(self, extract_selector(args).merge(tag_name: "radialGradient"))
398
+ def radial_gradient(opts = {})
399
+ RadialGradient.new(self, opts.merge(tag_name: "radialGradient"))
400
400
  end
401
401
  # @return [RadialGradientCollection]
402
- def radial_gradients(*args)
403
- RadialGradientCollection.new(self, extract_selector(args).merge(tag_name: "radialGradient"))
402
+ def radial_gradients(opts = {})
403
+ RadialGradientCollection.new(self, opts.merge(tag_name: "radialGradient"))
404
404
  end
405
405
  Watir.tag_to_class[:radialGradient] = RadialGradient
406
406
 
407
407
  # @return [Rect]
408
- def rect(*args)
409
- Rect.new(self, extract_selector(args).merge(tag_name: "rect"))
408
+ def rect(opts = {})
409
+ Rect.new(self, opts.merge(tag_name: "rect"))
410
410
  end
411
411
  # @return [RectCollection]
412
- def rects(*args)
413
- RectCollection.new(self, extract_selector(args).merge(tag_name: "rect"))
412
+ def rects(opts = {})
413
+ RectCollection.new(self, opts.merge(tag_name: "rect"))
414
414
  end
415
415
  Watir.tag_to_class[:rect] = Rect
416
416
 
417
417
  # @return [Stop]
418
- def stop(*args)
419
- Stop.new(self, extract_selector(args).merge(tag_name: "stop"))
418
+ def stop(opts = {})
419
+ Stop.new(self, opts.merge(tag_name: "stop"))
420
420
  end
421
421
  # @return [StopCollection]
422
- def stops(*args)
423
- StopCollection.new(self, extract_selector(args).merge(tag_name: "stop"))
422
+ def stops(opts = {})
423
+ StopCollection.new(self, opts.merge(tag_name: "stop"))
424
424
  end
425
425
  Watir.tag_to_class[:stop] = Stop
426
426
 
427
427
  # @return [SVG]
428
- def svg(*args)
429
- SVG.new(self, extract_selector(args).merge(tag_name: "svg"))
428
+ def svg(opts = {})
429
+ SVG.new(self, opts.merge(tag_name: "svg"))
430
430
  end
431
431
  # @return [SVGCollection]
432
- def svgs(*args)
433
- SVGCollection.new(self, extract_selector(args).merge(tag_name: "svg"))
432
+ def svgs(opts = {})
433
+ SVGCollection.new(self, opts.merge(tag_name: "svg"))
434
434
  end
435
435
  Watir.tag_to_class[:svg] = SVG
436
436
 
437
437
  # @return [Switch]
438
- def switch(*args)
439
- Switch.new(self, extract_selector(args).merge(tag_name: "switch"))
438
+ def switch(opts = {})
439
+ Switch.new(self, opts.merge(tag_name: "switch"))
440
440
  end
441
441
  # @return [SwitchCollection]
442
- def switches(*args)
443
- SwitchCollection.new(self, extract_selector(args).merge(tag_name: "switch"))
442
+ def switches(opts = {})
443
+ SwitchCollection.new(self, opts.merge(tag_name: "switch"))
444
444
  end
445
445
  Watir.tag_to_class[:switch] = Switch
446
446
 
447
447
  # @return [Symbol]
448
- def symbol(*args)
449
- Symbol.new(self, extract_selector(args).merge(tag_name: "symbol"))
448
+ def symbol(opts = {})
449
+ Symbol.new(self, opts.merge(tag_name: "symbol"))
450
450
  end
451
451
  # @return [SymbolCollection]
452
- def symbols(*args)
453
- SymbolCollection.new(self, extract_selector(args).merge(tag_name: "symbol"))
452
+ def symbols(opts = {})
453
+ SymbolCollection.new(self, opts.merge(tag_name: "symbol"))
454
454
  end
455
455
  Watir.tag_to_class[:symbol] = Symbol
456
456
 
457
457
  # @return [TextPath]
458
- def text_path(*args)
459
- TextPath.new(self, extract_selector(args).merge(tag_name: "textPath"))
458
+ def text_path(opts = {})
459
+ TextPath.new(self, opts.merge(tag_name: "textPath"))
460
460
  end
461
461
  # @return [TextPathCollection]
462
- def text_paths(*args)
463
- TextPathCollection.new(self, extract_selector(args).merge(tag_name: "textPath"))
462
+ def text_paths(opts = {})
463
+ TextPathCollection.new(self, opts.merge(tag_name: "textPath"))
464
464
  end
465
465
  Watir.tag_to_class[:textPath] = TextPath
466
466
 
467
467
  # @return [TSpan]
468
- def tspan(*args)
469
- TSpan.new(self, extract_selector(args).merge(tag_name: "tspan"))
468
+ def tspan(opts = {})
469
+ TSpan.new(self, opts.merge(tag_name: "tspan"))
470
470
  end
471
471
  # @return [TSpanCollection]
472
- def tspans(*args)
473
- TSpanCollection.new(self, extract_selector(args).merge(tag_name: "tspan"))
472
+ def tspans(opts = {})
473
+ TSpanCollection.new(self, opts.merge(tag_name: "tspan"))
474
474
  end
475
475
  Watir.tag_to_class[:tspan] = TSpan
476
476
 
477
477
  # @return [Use]
478
- def use(*args)
479
- Use.new(self, extract_selector(args).merge(tag_name: "use"))
478
+ def use(opts = {})
479
+ Use.new(self, opts.merge(tag_name: "use"))
480
480
  end
481
481
  # @return [UseCollection]
482
- def uses(*args)
483
- UseCollection.new(self, extract_selector(args).merge(tag_name: "use"))
482
+ def uses(opts = {})
483
+ UseCollection.new(self, opts.merge(tag_name: "use"))
484
484
  end
485
485
  Watir.tag_to_class[:use] = Use
486
486
 
487
487
  # @return [View]
488
- def view(*args)
489
- View.new(self, extract_selector(args).merge(tag_name: "view"))
488
+ def view(opts = {})
489
+ View.new(self, opts.merge(tag_name: "view"))
490
490
  end
491
491
  # @return [ViewCollection]
492
- def views(*args)
493
- ViewCollection.new(self, extract_selector(args).merge(tag_name: "view"))
492
+ def views(opts = {})
493
+ ViewCollection.new(self, opts.merge(tag_name: "view"))
494
494
  end
495
495
  Watir.tag_to_class[:view] = View
496
496
  end # Container