watir 6.17.0 → 7.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/actions/enable-safari/action.yml +11 -0
- data/.github/actions/install-chrome/action.yml +12 -0
- data/.github/actions/setup-linux/action.yml +8 -0
- data/.github/workflows/tests.yml +104 -0
- data/.rubocop.yml +2 -7
- data/.rubocop_todo.yml +36 -0
- data/CHANGES.md +59 -0
- data/LICENSE +2 -2
- data/README.md +6 -10
- data/Rakefile +2 -2
- data/lib/watir.rb +4 -45
- data/lib/watir/adjacent.rb +1 -1
- data/lib/watir/alert.rb +4 -8
- data/lib/watir/attribute_helper.rb +2 -0
- data/lib/watir/browser.rb +20 -6
- data/lib/watir/capabilities.rb +79 -110
- data/lib/watir/cell_container.rb +4 -4
- data/lib/watir/container.rb +4 -26
- data/lib/watir/cookies.rb +2 -0
- data/lib/watir/element_collection.rb +21 -6
- data/lib/watir/elements/checkbox.rb +4 -4
- data/lib/watir/elements/date_field.rb +4 -4
- data/lib/watir/elements/date_time_field.rb +4 -4
- data/lib/watir/elements/element.rb +51 -59
- data/lib/watir/elements/file_field.rb +4 -4
- data/lib/watir/elements/font.rb +5 -4
- data/lib/watir/elements/hidden.rb +4 -4
- data/lib/watir/elements/html_elements.rb +444 -446
- data/lib/watir/elements/iframe.rb +6 -6
- data/lib/watir/elements/radio.rb +6 -6
- data/lib/watir/elements/select.rb +62 -90
- data/lib/watir/elements/svg_elements.rb +96 -96
- data/lib/watir/elements/text_field.rb +4 -4
- data/lib/watir/generator/base/generator.rb +4 -4
- data/lib/watir/generator/base/visitor.rb +0 -29
- data/lib/watir/generator/html/generator.rb +2 -1
- data/lib/watir/has_window.rb +22 -18
- data/lib/watir/http_client.rb +9 -0
- data/lib/watir/js_execution.rb +2 -2
- data/lib/watir/js_snippets.rb +2 -2
- data/lib/watir/locators.rb +6 -8
- data/lib/watir/locators/button/matcher.rb +0 -23
- data/lib/watir/locators/button/selector_builder/xpath.rb +4 -15
- data/lib/watir/locators/element/matcher.rb +4 -19
- data/lib/watir/locators/element/selector_builder.rb +3 -41
- data/lib/watir/locators/element/selector_builder/xpath.rb +34 -41
- data/lib/watir/locators/option/matcher.rb +24 -0
- data/lib/watir/locators/option/selector_builder.rb +8 -0
- data/lib/watir/locators/option/selector_builder/xpath.rb +37 -0
- data/lib/watir/logger.rb +4 -91
- data/lib/watir/radio_set.rb +5 -4
- data/lib/watir/row_container.rb +4 -4
- data/lib/watir/screenshot.rb +2 -8
- data/lib/watir/user_editable.rb +13 -2
- data/lib/watir/version.rb +1 -1
- data/lib/watir/wait.rb +6 -74
- data/lib/watir/wait/timer.rb +1 -1
- data/lib/watir/window.rb +24 -25
- data/lib/watir/window_collection.rb +79 -0
- data/lib/watirspec.rb +5 -2
- data/lib/watirspec/guards.rb +1 -1
- data/lib/watirspec/implementation.rb +7 -5
- data/lib/watirspec/runner.rb +2 -2
- data/lib/watirspec/server.rb +2 -2
- data/spec/spec_helper.rb +1 -21
- data/spec/unit/capabilities_spec.rb +504 -21
- data/spec/unit/match_elements/button_spec.rb +0 -13
- data/spec/unit/match_elements/element_spec.rb +55 -51
- data/spec/unit/match_elements/text_field_spec.rb +6 -6
- data/spec/unit/selector_builder/element_spec.rb +6 -23
- data/spec/unit/selector_builder/text_field_spec.rb +6 -7
- data/spec/unit/unit_helper.rb +2 -4
- data/spec/watirspec/after_hooks_spec.rb +23 -42
- data/spec/watirspec/alert_spec.rb +4 -21
- data/spec/watirspec/browser_spec.rb +186 -206
- data/spec/watirspec/cookies_spec.rb +47 -52
- data/spec/watirspec/drag_and_drop_spec.rb +5 -7
- data/spec/watirspec/elements/area_spec.rb +1 -5
- data/spec/watirspec/elements/button_spec.rb +4 -18
- data/spec/watirspec/elements/checkbox_spec.rb +10 -24
- data/spec/watirspec/elements/date_field_spec.rb +13 -16
- data/spec/watirspec/elements/date_time_field_spec.rb +14 -13
- data/spec/watirspec/elements/dd_spec.rb +3 -4
- data/spec/watirspec/elements/del_spec.rb +10 -12
- data/spec/watirspec/elements/div_spec.rb +45 -84
- data/spec/watirspec/elements/divs_spec.rb +2 -2
- data/spec/watirspec/elements/dl_spec.rb +4 -12
- data/spec/watirspec/elements/element_spec.rb +204 -181
- data/spec/watirspec/elements/elements_spec.rb +8 -9
- data/spec/watirspec/elements/filefield_spec.rb +5 -7
- data/spec/watirspec/elements/form_spec.rb +3 -5
- data/spec/watirspec/elements/forms_spec.rb +3 -5
- data/spec/watirspec/elements/frame_spec.rb +17 -22
- data/spec/watirspec/elements/iframe_spec.rb +25 -33
- data/spec/watirspec/elements/ins_spec.rb +10 -12
- data/spec/watirspec/elements/link_spec.rb +23 -23
- data/spec/watirspec/elements/links_spec.rb +8 -9
- data/spec/watirspec/elements/radio_spec.rb +11 -14
- data/spec/watirspec/elements/select_list_spec.rb +358 -209
- data/spec/watirspec/elements/span_spec.rb +12 -14
- data/spec/watirspec/elements/spans_spec.rb +1 -1
- data/spec/watirspec/elements/strong_spec.rb +1 -1
- data/spec/watirspec/elements/table_nesting_spec.rb +31 -34
- data/spec/watirspec/elements/table_spec.rb +11 -13
- data/spec/watirspec/elements/tbody_spec.rb +10 -12
- data/spec/watirspec/elements/td_spec.rb +4 -6
- data/spec/watirspec/elements/text_field_spec.rb +10 -12
- data/spec/watirspec/elements/tr_spec.rb +5 -7
- data/spec/watirspec/html/non_control_elements.html +8 -3
- data/spec/watirspec/html/special_chars.html +3 -0
- data/spec/watirspec/html/wait.html +5 -5
- data/spec/watirspec/html/window_switching.html +10 -0
- data/spec/watirspec/special_chars_spec.rb +10 -0
- data/spec/watirspec/support/rspec_matchers.rb +11 -24
- data/spec/watirspec/user_editable_spec.rb +26 -28
- data/spec/watirspec/wait_spec.rb +154 -201
- data/spec/watirspec/window_switching_spec.rb +359 -270
- data/spec/watirspec_helper.rb +52 -49
- data/support/doctest_helper.rb +0 -2
- data/watir.gemspec +4 -5
- metadata +30 -39
- data/.travis.yml +0 -87
- data/appveyor.yml +0 -13
- data/lib/watir/legacy_wait.rb +0 -123
- data/spec/implementation_spec.rb +0 -24
- data/spec/unit/container_spec.rb +0 -35
- data/spec/unit/logger_spec.rb +0 -81
- data/spec/watirspec/relaxed_locate_spec.rb +0 -109
@@ -44,8 +44,9 @@ module Watir
|
|
44
44
|
# @see Watir::Browser#execute_script
|
45
45
|
#
|
46
46
|
|
47
|
-
def execute_script(script, *args)
|
47
|
+
def execute_script(script, *args, function_name: nil)
|
48
48
|
args.map! do |e|
|
49
|
+
Watir.logger.info "Executing Script on Frame: #{function_name}" if function_name
|
49
50
|
e.is_a?(Element) ? e.wait_until(&:exists?).wd : e
|
50
51
|
end
|
51
52
|
returned = driver.execute_script(script, *args)
|
@@ -90,12 +91,12 @@ module Watir
|
|
90
91
|
end # FrameCollection
|
91
92
|
|
92
93
|
module Container
|
93
|
-
def frame(
|
94
|
-
Frame.new(self,
|
94
|
+
def frame(opts = {})
|
95
|
+
Frame.new(self, opts.merge(tag_name: 'frame'))
|
95
96
|
end
|
96
97
|
|
97
|
-
def frames(
|
98
|
-
FrameCollection.new(self,
|
98
|
+
def frames(opts = {})
|
99
|
+
FrameCollection.new(self, opts.merge(tag_name: 'frame'))
|
99
100
|
end
|
100
101
|
end # Container
|
101
102
|
|
@@ -125,7 +126,6 @@ module Watir
|
|
125
126
|
def switch!
|
126
127
|
@driver.switch_to.frame @element
|
127
128
|
@browser.default_context = false
|
128
|
-
@browser.after_hooks.run
|
129
129
|
rescue Selenium::WebDriver::Error::NoSuchFrameError => e
|
130
130
|
raise UnknownFrameException, e.message
|
131
131
|
end
|
data/lib/watir/elements/radio.rb
CHANGED
@@ -9,8 +9,8 @@ module Watir
|
|
9
9
|
# Selects this radio button.
|
10
10
|
#
|
11
11
|
|
12
|
-
def set
|
13
|
-
click
|
12
|
+
def set(bool = true)
|
13
|
+
click if bool && !set?
|
14
14
|
end
|
15
15
|
alias select set
|
16
16
|
|
@@ -39,12 +39,12 @@ module Watir
|
|
39
39
|
end # Radio
|
40
40
|
|
41
41
|
module Container
|
42
|
-
def radio(
|
43
|
-
Radio.new(self,
|
42
|
+
def radio(opts = {})
|
43
|
+
Radio.new(self, opts.merge(tag_name: 'input', type: 'radio'))
|
44
44
|
end
|
45
45
|
|
46
|
-
def radios(
|
47
|
-
RadioCollection.new(self,
|
46
|
+
def radios(opts = {})
|
47
|
+
RadioCollection.new(self, opts.merge(tag_name: 'input', type: 'radio'))
|
48
48
|
end
|
49
49
|
end # Container
|
50
50
|
|
@@ -5,7 +5,7 @@ module Watir
|
|
5
5
|
#
|
6
6
|
|
7
7
|
def clear
|
8
|
-
raise Exception::Error, 'you can only clear multi-selects' unless
|
8
|
+
raise Exception::Error, 'you can only clear multi-selects' unless multiple_select_list?
|
9
9
|
|
10
10
|
selected_options.each(&:click)
|
11
11
|
end
|
@@ -18,7 +18,7 @@ module Watir
|
|
18
18
|
#
|
19
19
|
|
20
20
|
def include?(str_or_rx)
|
21
|
-
option(text: str_or_rx).exist? || option(label: str_or_rx).exist?
|
21
|
+
option(text: str_or_rx).exist? || option(label: str_or_rx).exist? || option(value: str_or_rx).exist?
|
22
22
|
end
|
23
23
|
|
24
24
|
#
|
@@ -29,23 +29,16 @@ module Watir
|
|
29
29
|
# @return [String] The text of the option selected. If multiple options match, returns the first match.
|
30
30
|
#
|
31
31
|
|
32
|
-
def select(*str_or_rx)
|
33
|
-
|
34
|
-
results.first
|
35
|
-
end
|
32
|
+
def select(*str_or_rx, text: nil, value: nil, label: nil)
|
33
|
+
key, value = parse_select_args(str_or_rx, text, value, label)
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
# @return [String] The text of the first option selected.
|
43
|
-
#
|
44
|
-
|
45
|
-
def select_all(*str_or_rx)
|
46
|
-
results = str_or_rx.flatten.map { |v| select_all_by v }
|
47
|
-
results.first
|
35
|
+
if value.size > 1 || value.first.is_a?(Array)
|
36
|
+
value.flatten.map { |v| select_all_by key, v }.first
|
37
|
+
else
|
38
|
+
select_matching([find_option(key, value.flatten.first)])
|
39
|
+
end
|
48
40
|
end
|
41
|
+
alias set select
|
49
42
|
|
50
43
|
#
|
51
44
|
# Uses JavaScript to select the option whose text matches the given string.
|
@@ -54,36 +47,14 @@ module Watir
|
|
54
47
|
# @raise [Watir::Exception::NoValueFoundException] if the value does not exist.
|
55
48
|
#
|
56
49
|
|
57
|
-
def select!(*str_or_rx)
|
58
|
-
|
59
|
-
results.first
|
60
|
-
end
|
61
|
-
|
62
|
-
#
|
63
|
-
# Uses JavaScript to select all options whose text matches the given string.
|
64
|
-
#
|
65
|
-
# @param [String, Regexp] str_or_rx
|
66
|
-
# @raise [Watir::Exception::NoValueFoundException] if the value does not exist.
|
67
|
-
#
|
68
|
-
|
69
|
-
def select_all!(*str_or_rx)
|
70
|
-
results = str_or_rx.flatten.map { |v| select_by!(v, :multiple) }
|
71
|
-
results.first
|
72
|
-
end
|
50
|
+
def select!(*str_or_rx, text: nil, value: nil, label: nil)
|
51
|
+
key, value = parse_select_args(str_or_rx, text, value, label)
|
73
52
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
# @param [String, Regexp] str_or_rx
|
80
|
-
# @raise [Watir::Exception::NoValueFoundException] if the value does not exist.
|
81
|
-
# @return [String] The option selected. If multiple options match, returns the first match
|
82
|
-
#
|
83
|
-
|
84
|
-
def select_value(str_or_rx)
|
85
|
-
Watir.logger.deprecate '#select_value', '#select', ids: [:select_value]
|
86
|
-
select_by str_or_rx
|
53
|
+
if value.size > 1 || value.first.is_a?(Array)
|
54
|
+
value.flatten.map { |v| select_by! key, v, :multiple }.first
|
55
|
+
else
|
56
|
+
value.flatten.map { |v| select_by! key, v, :single }.first
|
57
|
+
end
|
87
58
|
end
|
88
59
|
|
89
60
|
#
|
@@ -94,16 +65,10 @@ module Watir
|
|
94
65
|
# @return [Boolean]
|
95
66
|
#
|
96
67
|
|
97
|
-
def selected?(str_or_rx)
|
98
|
-
|
99
|
-
return true if by_text.find(&:selected?)
|
100
|
-
|
101
|
-
by_label = options(label: str_or_rx)
|
102
|
-
return true if by_label.find(&:selected?)
|
68
|
+
def selected?(*str_or_rx, text: nil, value: nil, label: nil)
|
69
|
+
key, value = parse_select_args(str_or_rx, text, value, label)
|
103
70
|
|
104
|
-
|
105
|
-
|
106
|
-
raise(UnknownObjectException, "Unable to locate option matching #{str_or_rx.inspect}")
|
71
|
+
find_option(key, value.first).selected?
|
107
72
|
end
|
108
73
|
|
109
74
|
#
|
@@ -114,8 +79,7 @@ module Watir
|
|
114
79
|
#
|
115
80
|
|
116
81
|
def value
|
117
|
-
|
118
|
-
option&.value
|
82
|
+
selected_options.first&.value
|
119
83
|
end
|
120
84
|
|
121
85
|
#
|
@@ -125,9 +89,9 @@ module Watir
|
|
125
89
|
# @return [String, nil]
|
126
90
|
#
|
127
91
|
|
92
|
+
# TODO: What is default behavior without #first ?
|
128
93
|
def text
|
129
|
-
|
130
|
-
option&.text
|
94
|
+
selected_options.first&.text
|
131
95
|
end
|
132
96
|
|
133
97
|
# Returns an array of currently selected options.
|
@@ -141,20 +105,29 @@ module Watir
|
|
141
105
|
|
142
106
|
private
|
143
107
|
|
144
|
-
def
|
145
|
-
|
108
|
+
def multiple_select_list?
|
109
|
+
@multiple_select = @multiple_select.nil? ? multiple? : @multiple_select
|
110
|
+
end
|
146
111
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
112
|
+
def parse_select_args(str_or_rx, text, value, label)
|
113
|
+
selectors = {}
|
114
|
+
selectors[:any] = str_or_rx unless str_or_rx.empty?
|
115
|
+
selectors[:text] = Array[text] if text
|
116
|
+
selectors[:value] = Array[value] if value
|
117
|
+
selectors[:label] = Array[label] if label
|
118
|
+
|
119
|
+
raise ArgumentError, "too many arguments used for Select#select: #{selectors}" if selectors.size > 1
|
120
|
+
|
121
|
+
selectors.first
|
152
122
|
end
|
153
123
|
|
154
|
-
def select_by!(str_or_rx, number)
|
124
|
+
def select_by!(key, str_or_rx, number)
|
125
|
+
str_or_rx = type_check(str_or_rx)
|
126
|
+
|
155
127
|
js_rx = process_str_or_rx(str_or_rx)
|
128
|
+
approaches = key == :any ? %w[Text Label Value] : [key.to_s.capitalize]
|
156
129
|
|
157
|
-
|
130
|
+
approaches.each do |approach|
|
158
131
|
element_call { execute_js("selectOptions#{approach}", self, js_rx, number.to_s) }
|
159
132
|
return selected_options.first.text if matching_option?(approach.downcase, str_or_rx)
|
160
133
|
end
|
@@ -190,44 +163,43 @@ module Watir
|
|
190
163
|
false
|
191
164
|
end
|
192
165
|
|
193
|
-
def select_all_by(str_or_rx)
|
194
|
-
raise Error, 'you can only use #select_all on multi-selects' unless
|
195
|
-
|
196
|
-
found = find_options :text, str_or_rx
|
166
|
+
def select_all_by(key, str_or_rx)
|
167
|
+
raise Error, 'you can only use #select_all on multi-selects' unless multiple_select_list?
|
197
168
|
|
198
|
-
select_matching(
|
169
|
+
select_matching(find_options(key, str_or_rx))
|
199
170
|
end
|
200
171
|
|
201
|
-
def
|
202
|
-
|
203
|
-
case str_or_rx
|
204
|
-
when String, Numeric, Regexp
|
205
|
-
@found = how == :value ? options(value: str_or_rx) : []
|
206
|
-
@found = options(text: str_or_rx) if @found.empty?
|
207
|
-
@found = options(label: str_or_rx) if @found.empty?
|
208
|
-
@found.empty? && Watir.relaxed_locate?
|
209
|
-
else
|
210
|
-
raise TypeError, "expected String or Regexp, got #{str_or_rx.inspect}:#{str_or_rx.class}"
|
211
|
-
end
|
212
|
-
end
|
213
|
-
# TODO: Remove conditional when remove relaxed_locate toggle
|
214
|
-
return @found unless @found.empty?
|
172
|
+
def find_option(key, str_or_rx)
|
173
|
+
val = type_check(str_or_rx)
|
215
174
|
|
175
|
+
option(key => val).wait_until(&:exists?)
|
176
|
+
rescue Wait::TimeoutError
|
216
177
|
raise_no_value_found(str_or_rx)
|
178
|
+
end
|
179
|
+
|
180
|
+
def find_options(key, str_or_rx)
|
181
|
+
val = type_check(str_or_rx)
|
182
|
+
|
183
|
+
options(key => val).wait_until(&:exists?)
|
217
184
|
rescue Wait::TimeoutError
|
218
185
|
raise_no_value_found(str_or_rx)
|
219
186
|
end
|
220
187
|
|
188
|
+
def type_check(str_or_rx)
|
189
|
+
str_or_rx = str_or_rx.to_s if str_or_rx.is_a?(Numeric)
|
190
|
+
return str_or_rx if [String, Regexp].any? { |k| str_or_rx.is_a?(k) }
|
191
|
+
|
192
|
+
raise TypeError, "expected String, Numeric or Regexp, got #{str_or_rx.inspect}:#{str_or_rx.class}"
|
193
|
+
end
|
194
|
+
|
221
195
|
# TODO: Consider locating the Select List before throwing the exception
|
222
196
|
def raise_no_value_found(str_or_rx)
|
223
197
|
raise NoValueFoundException, "#{str_or_rx.inspect} not found in #{inspect}"
|
224
198
|
end
|
225
199
|
|
226
200
|
def select_matching(elements)
|
227
|
-
elements = [elements.first] unless multiple?
|
228
201
|
elements.each { |e| e.click unless e.selected? }
|
229
|
-
|
230
|
-
elements.first.stale? ? '' : elements.first.text
|
202
|
+
elements.first.exists? ? elements.first.text : ''
|
231
203
|
end
|
232
204
|
end # Select
|
233
205
|
|
@@ -255,242 +255,242 @@ module Watir
|
|
255
255
|
module Container
|
256
256
|
|
257
257
|
# @return [Circle]
|
258
|
-
def circle(
|
259
|
-
Circle.new(self,
|
258
|
+
def circle(opts = {})
|
259
|
+
Circle.new(self, opts.merge(tag_name: "circle"))
|
260
260
|
end
|
261
261
|
# @return [CircleCollection]
|
262
|
-
def circles(
|
263
|
-
CircleCollection.new(self,
|
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(
|
269
|
-
Defs.new(self,
|
268
|
+
def defs(opts = {})
|
269
|
+
Defs.new(self, opts.merge(tag_name: "defs"))
|
270
270
|
end
|
271
271
|
# @return [DefsCollection]
|
272
|
-
def defss(
|
273
|
-
DefsCollection.new(self,
|
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(
|
279
|
-
Desc.new(self,
|
278
|
+
def desc(opts = {})
|
279
|
+
Desc.new(self, opts.merge(tag_name: "desc"))
|
280
280
|
end
|
281
281
|
# @return [DescCollection]
|
282
|
-
def descs(
|
283
|
-
DescCollection.new(self,
|
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(
|
289
|
-
Ellipse.new(self,
|
288
|
+
def ellipse(opts = {})
|
289
|
+
Ellipse.new(self, opts.merge(tag_name: "ellipse"))
|
290
290
|
end
|
291
291
|
# @return [EllipseCollection]
|
292
|
-
def ellipses(
|
293
|
-
EllipseCollection.new(self,
|
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(
|
299
|
-
ForeignObject.new(self,
|
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(
|
303
|
-
ForeignObjectCollection.new(self,
|
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(
|
309
|
-
G.new(self,
|
308
|
+
def g(opts = {})
|
309
|
+
G.new(self, opts.merge(tag_name: "g"))
|
310
310
|
end
|
311
311
|
# @return [GCollection]
|
312
|
-
def gs(
|
313
|
-
GCollection.new(self,
|
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(
|
319
|
-
Line.new(self,
|
318
|
+
def line(opts = {})
|
319
|
+
Line.new(self, opts.merge(tag_name: "line"))
|
320
320
|
end
|
321
321
|
# @return [LineCollection]
|
322
|
-
def lines(
|
323
|
-
LineCollection.new(self,
|
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(
|
329
|
-
LinearGradient.new(self,
|
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(
|
333
|
-
LinearGradientCollection.new(self,
|
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(
|
339
|
-
Marker.new(self,
|
338
|
+
def marker(opts = {})
|
339
|
+
Marker.new(self, opts.merge(tag_name: "marker"))
|
340
340
|
end
|
341
341
|
# @return [MarkerCollection]
|
342
|
-
def markers(
|
343
|
-
MarkerCollection.new(self,
|
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(
|
349
|
-
Metadata.new(self,
|
348
|
+
def metadata(opts = {})
|
349
|
+
Metadata.new(self, opts.merge(tag_name: "metadata"))
|
350
350
|
end
|
351
351
|
# @return [MetadataCollection]
|
352
|
-
def metadatas(
|
353
|
-
MetadataCollection.new(self,
|
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(
|
359
|
-
Path.new(self,
|
358
|
+
def path(opts = {})
|
359
|
+
Path.new(self, opts.merge(tag_name: "path"))
|
360
360
|
end
|
361
361
|
# @return [PathCollection]
|
362
|
-
def paths(
|
363
|
-
PathCollection.new(self,
|
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(
|
369
|
-
Pattern.new(self,
|
368
|
+
def pattern(opts = {})
|
369
|
+
Pattern.new(self, opts.merge(tag_name: "pattern"))
|
370
370
|
end
|
371
371
|
# @return [PatternCollection]
|
372
|
-
def patterns(
|
373
|
-
PatternCollection.new(self,
|
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(
|
379
|
-
Polygon.new(self,
|
378
|
+
def polygon(opts = {})
|
379
|
+
Polygon.new(self, opts.merge(tag_name: "polygon"))
|
380
380
|
end
|
381
381
|
# @return [PolygonCollection]
|
382
|
-
def polygons(
|
383
|
-
PolygonCollection.new(self,
|
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(
|
389
|
-
Polyline.new(self,
|
388
|
+
def polyline(opts = {})
|
389
|
+
Polyline.new(self, opts.merge(tag_name: "polyline"))
|
390
390
|
end
|
391
391
|
# @return [PolylineCollection]
|
392
|
-
def polylines(
|
393
|
-
PolylineCollection.new(self,
|
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(
|
399
|
-
RadialGradient.new(self,
|
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(
|
403
|
-
RadialGradientCollection.new(self,
|
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(
|
409
|
-
Rect.new(self,
|
408
|
+
def rect(opts = {})
|
409
|
+
Rect.new(self, opts.merge(tag_name: "rect"))
|
410
410
|
end
|
411
411
|
# @return [RectCollection]
|
412
|
-
def rects(
|
413
|
-
RectCollection.new(self,
|
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(
|
419
|
-
Stop.new(self,
|
418
|
+
def stop(opts = {})
|
419
|
+
Stop.new(self, opts.merge(tag_name: "stop"))
|
420
420
|
end
|
421
421
|
# @return [StopCollection]
|
422
|
-
def stops(
|
423
|
-
StopCollection.new(self,
|
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(
|
429
|
-
SVG.new(self,
|
428
|
+
def svg(opts = {})
|
429
|
+
SVG.new(self, opts.merge(tag_name: "svg"))
|
430
430
|
end
|
431
431
|
# @return [SVGCollection]
|
432
|
-
def svgs(
|
433
|
-
SVGCollection.new(self,
|
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(
|
439
|
-
Switch.new(self,
|
438
|
+
def switch(opts = {})
|
439
|
+
Switch.new(self, opts.merge(tag_name: "switch"))
|
440
440
|
end
|
441
441
|
# @return [SwitchCollection]
|
442
|
-
def switches(
|
443
|
-
SwitchCollection.new(self,
|
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(
|
449
|
-
Symbol.new(self,
|
448
|
+
def symbol(opts = {})
|
449
|
+
Symbol.new(self, opts.merge(tag_name: "symbol"))
|
450
450
|
end
|
451
451
|
# @return [SymbolCollection]
|
452
|
-
def symbols(
|
453
|
-
SymbolCollection.new(self,
|
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(
|
459
|
-
TextPath.new(self,
|
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(
|
463
|
-
TextPathCollection.new(self,
|
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(
|
469
|
-
TSpan.new(self,
|
468
|
+
def tspan(opts = {})
|
469
|
+
TSpan.new(self, opts.merge(tag_name: "tspan"))
|
470
470
|
end
|
471
471
|
# @return [TSpanCollection]
|
472
|
-
def tspans(
|
473
|
-
TSpanCollection.new(self,
|
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(
|
479
|
-
Use.new(self,
|
478
|
+
def use(opts = {})
|
479
|
+
Use.new(self, opts.merge(tag_name: "use"))
|
480
480
|
end
|
481
481
|
# @return [UseCollection]
|
482
|
-
def uses(
|
483
|
-
UseCollection.new(self,
|
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(
|
489
|
-
View.new(self,
|
488
|
+
def view(opts = {})
|
489
|
+
View.new(self, opts.merge(tag_name: "view"))
|
490
490
|
end
|
491
491
|
# @return [ViewCollection]
|
492
|
-
def views(
|
493
|
-
ViewCollection.new(self,
|
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
|