watir-webdriver 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -2
- data/lib/watir-webdriver.rb +13 -0
- data/lib/watir-webdriver/browser.rb +1 -1
- data/lib/watir-webdriver/cookies.rb +3 -3
- data/lib/watir-webdriver/elements/frame.rb +0 -10
- data/lib/watir-webdriver/elements/select.rb +1 -1
- data/lib/watir-webdriver/locators/button_locator.rb +3 -3
- data/lib/watir-webdriver/locators/child_cell_locator.rb +3 -3
- data/lib/watir-webdriver/locators/child_row_locator.rb +3 -3
- data/lib/watir-webdriver/locators/element_locator.rb +69 -15
- data/lib/watir-webdriver/locators/text_field_locator.rb +3 -3
- data/lib/watir-webdriver/version.rb +1 -1
- data/spec/element_locator_spec.rb +97 -18
- data/spec/element_spec.rb +4 -1
- data/spec/implementation.rb +43 -12
- data/spec/spec_helper.rb +5 -1
- data/spec/wait_spec.rb +101 -101
- data/support/travis.sh +1 -1
- data/watir-webdriver.gemspec +1 -1
- metadata +137 -159
data/.travis.yml
CHANGED
@@ -10,7 +10,7 @@ before_script:
|
|
10
10
|
env:
|
11
11
|
- WATIR_WEBDRIVER_BROWSER=firefox
|
12
12
|
- WATIR_WEBDRIVER_BROWSER=firefox ALWAYS_LOCATE=false
|
13
|
-
|
13
|
+
- WATIR_WEBDRIVER_BROWSER=firefox PREFER_CSS=1 SELECTOR_STATS=1
|
14
14
|
- WATIR_WEBDRIVER_BROWSER=chrome
|
15
15
|
- WATIR_WEBDRIVER_BROWSER=chrome ALWAYS_LOCATE=false
|
16
|
-
|
16
|
+
- WATIR_WEBDRIVER_BROWSER=chrome PREFER_CSS=1 SELECTOR_STATS=1
|
data/lib/watir-webdriver.rb
CHANGED
@@ -34,6 +34,19 @@ module Watir
|
|
34
34
|
@always_locate = bool
|
35
35
|
end
|
36
36
|
|
37
|
+
def prefer_css?
|
38
|
+
@prefer_css
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# Whether or not Watir should prefer CSS when translating the Watir selectors to WebDriver.
|
43
|
+
# Defaults to false.
|
44
|
+
#
|
45
|
+
|
46
|
+
def prefer_css=(bool)
|
47
|
+
@prefer_css = bool
|
48
|
+
end
|
49
|
+
|
37
50
|
#
|
38
51
|
# @api private
|
39
52
|
#
|
@@ -206,7 +206,7 @@ module Watir
|
|
206
206
|
|
207
207
|
def safe_text(element)
|
208
208
|
element.text
|
209
|
-
rescue Selenium::WebDriver::Error::ObsoleteElementError
|
209
|
+
rescue Selenium::WebDriver::Error::ObsoleteElementError, Selenium::WebDriver::Error::UnhandledAlertError
|
210
210
|
# guard for scenario where selecting the element changes the page, making our element obsolete
|
211
211
|
|
212
212
|
''
|
@@ -16,7 +16,7 @@ module Watir
|
|
16
16
|
super
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
19
|
+
def build_wd_selector(selectors)
|
20
20
|
return if selectors.values.any? { |e| e.kind_of? Regexp }
|
21
21
|
|
22
22
|
selectors.delete(:tag_name) || raise("internal error: no tag_name?!")
|
@@ -33,9 +33,9 @@ module Watir
|
|
33
33
|
xpath << " | .//input"
|
34
34
|
xpath << "[#{input_attr_exp}]"
|
35
35
|
|
36
|
-
p :
|
36
|
+
p :build_wd_selector => xpath if $DEBUG
|
37
37
|
|
38
|
-
xpath
|
38
|
+
[:xpath, xpath]
|
39
39
|
end
|
40
40
|
|
41
41
|
def lhs_for(key)
|
@@ -11,7 +11,7 @@ module Watir
|
|
11
11
|
nil
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
14
|
+
def build_wd_selector(selectors)
|
15
15
|
return if selectors.values.any? { |e| e.kind_of? Regexp }
|
16
16
|
|
17
17
|
expressions = %w[./th ./td]
|
@@ -23,9 +23,9 @@ module Watir
|
|
23
23
|
|
24
24
|
xpath = expressions.join(" | ")
|
25
25
|
|
26
|
-
p :
|
26
|
+
p :build_wd_selector => xpath if $DEBUG
|
27
27
|
|
28
|
-
xpath
|
28
|
+
[:xpath, xpath]
|
29
29
|
end
|
30
30
|
|
31
31
|
end # ChildCellLocator
|
@@ -11,7 +11,7 @@ module Watir
|
|
11
11
|
nil # avoid this
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
14
|
+
def build_wd_selector(selectors)
|
15
15
|
return if selectors.values.any? { |e| e.kind_of? Regexp }
|
16
16
|
selectors.delete(:tag_name) || raise("internal error: no tag_name?!")
|
17
17
|
|
@@ -28,9 +28,9 @@ module Watir
|
|
28
28
|
|
29
29
|
xpath = expressions.join(" | ")
|
30
30
|
|
31
|
-
p :
|
31
|
+
p :build_wd_selector => xpath if $DEBUG
|
32
32
|
|
33
|
-
xpath
|
33
|
+
[:xpath, xpath]
|
34
34
|
end
|
35
35
|
|
36
36
|
end # ChildRowLocator
|
@@ -10,7 +10,7 @@ module Watir
|
|
10
10
|
:id,
|
11
11
|
:link,
|
12
12
|
:link_text,
|
13
|
-
:name,
|
13
|
+
# :name, # deliberately excluded to be watirspec compliant
|
14
14
|
:partial_link_text,
|
15
15
|
:tag_name,
|
16
16
|
:xpath
|
@@ -75,14 +75,14 @@ module Watir
|
|
75
75
|
selector = normalized_selector
|
76
76
|
|
77
77
|
idx = selector.delete(:index)
|
78
|
-
|
78
|
+
how, what = given_xpath(selector) || build_wd_selector(selector)
|
79
79
|
|
80
|
-
if
|
80
|
+
if how
|
81
81
|
# could build xpath for selector
|
82
82
|
if idx
|
83
|
-
@wd.find_elements(
|
83
|
+
@wd.find_elements(how, what)[idx]
|
84
84
|
else
|
85
|
-
@wd.find_element(
|
85
|
+
@wd.find_element(how, what)
|
86
86
|
end
|
87
87
|
else
|
88
88
|
# can't use xpath, probably a regexp in there
|
@@ -101,9 +101,9 @@ module Watir
|
|
101
101
|
raise ArgumentError, "can't locate all elements by :index"
|
102
102
|
end
|
103
103
|
|
104
|
-
|
105
|
-
if
|
106
|
-
@wd.find_elements(
|
104
|
+
how, what = given_xpath(selector) || build_wd_selector(selector)
|
105
|
+
if how
|
106
|
+
@wd.find_elements(how, what)
|
107
107
|
else
|
108
108
|
wd_find_by_regexp_selector(selector, :select)
|
109
109
|
end
|
@@ -132,9 +132,13 @@ module Watir
|
|
132
132
|
selector[:id] = id_from_label(rx_selector.delete(:label)) || return
|
133
133
|
end
|
134
134
|
|
135
|
-
|
135
|
+
how, what = build_wd_selector(selector)
|
136
|
+
|
137
|
+
unless how
|
138
|
+
raise Error, "internal error: unable to build WebDriver selector from #{selector.inspect}"
|
139
|
+
end
|
136
140
|
|
137
|
-
elements = @wd.find_elements(
|
141
|
+
elements = @wd.find_elements(how, what)
|
138
142
|
elements.__send__(method) { |el| matches_selector?(el, rx_selector) }
|
139
143
|
end
|
140
144
|
|
@@ -264,13 +268,17 @@ module Watir
|
|
264
268
|
@selector[:tag_name] != "option"
|
265
269
|
end
|
266
270
|
|
267
|
-
def
|
268
|
-
|
271
|
+
def build_wd_selector(selectors)
|
272
|
+
unless selectors.values.any? { |e| e.kind_of? Regexp }
|
273
|
+
build_css(selectors) || build_xpath(selectors)
|
274
|
+
end
|
275
|
+
end
|
269
276
|
|
277
|
+
def build_xpath(selectors)
|
270
278
|
xpath = ".//"
|
271
279
|
xpath << (selectors.delete(:tag_name) || '*').to_s
|
272
280
|
|
273
|
-
idx = selectors.delete
|
281
|
+
idx = selectors.delete :index
|
274
282
|
|
275
283
|
# the remaining entries should be attributes
|
276
284
|
unless selectors.empty?
|
@@ -283,7 +291,49 @@ module Watir
|
|
283
291
|
|
284
292
|
p :xpath => xpath, :selectors => selectors if $DEBUG
|
285
293
|
|
286
|
-
xpath
|
294
|
+
[:xpath, xpath]
|
295
|
+
end
|
296
|
+
|
297
|
+
def build_css(selectors)
|
298
|
+
return unless use_css?(selectors)
|
299
|
+
|
300
|
+
css = ''
|
301
|
+
css << (selectors.delete(:tag_name) || '')
|
302
|
+
|
303
|
+
klass = selectors.delete(:class)
|
304
|
+
if klass
|
305
|
+
if klass.include? ' '
|
306
|
+
css << %([class="#{css_escape klass}"])
|
307
|
+
else
|
308
|
+
css << ".#{klass}"
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
href = selectors.delete(:href)
|
313
|
+
if href
|
314
|
+
css << %([href~="#{css_escape href}"])
|
315
|
+
end
|
316
|
+
|
317
|
+
selectors.each do |key, value|
|
318
|
+
key = key.to_s.gsub("_", "-")
|
319
|
+
css << %([#{key}="#{css_escape value}"]) # TODO: proper escaping
|
320
|
+
end
|
321
|
+
|
322
|
+
[:css, css]
|
323
|
+
end
|
324
|
+
|
325
|
+
def use_css?(selectors)
|
326
|
+
return false unless Watir.prefer_css?
|
327
|
+
|
328
|
+
if selectors.has_key?(:text) || selectors.has_key?(:label) || selectors.has_key?(:index)
|
329
|
+
return false
|
330
|
+
end
|
331
|
+
|
332
|
+
if selectors.has_key?(:class) && selectors[:class] !~ /^[\w-]+$/ui
|
333
|
+
return false
|
334
|
+
end
|
335
|
+
|
336
|
+
true
|
287
337
|
end
|
288
338
|
|
289
339
|
def attribute_expression(selectors)
|
@@ -296,6 +346,10 @@ module Watir
|
|
296
346
|
end.join(" and ")
|
297
347
|
end
|
298
348
|
|
349
|
+
def css_escape(str)
|
350
|
+
str.gsub('"', '\\"')
|
351
|
+
end
|
352
|
+
|
299
353
|
def equal_pair(key, value)
|
300
354
|
if key == :class
|
301
355
|
klass = XpathSupport.escape " #{value} "
|
@@ -340,7 +394,7 @@ module Watir
|
|
340
394
|
raise ArgumentError, ":xpath cannot be combined with other selectors (#{selector.inspect})"
|
341
395
|
end
|
342
396
|
|
343
|
-
xpath
|
397
|
+
[:xpath, xpath]
|
344
398
|
end
|
345
399
|
|
346
400
|
def can_be_combined_with_xpath?(selector)
|
@@ -11,7 +11,7 @@ module Watir
|
|
11
11
|
|
12
12
|
private
|
13
13
|
|
14
|
-
def
|
14
|
+
def build_wd_selector(selectors)
|
15
15
|
return if selectors.values.any? { |e| e.kind_of? Regexp }
|
16
16
|
|
17
17
|
selectors.delete(:tag_name)
|
@@ -28,9 +28,9 @@ module Watir
|
|
28
28
|
xpath << "| .//textarea"
|
29
29
|
xpath << "[#{textarea_attr_exp}]" unless textarea_attr_exp.empty?
|
30
30
|
|
31
|
-
p :
|
31
|
+
p :build_wd_selector => xpath if $DEBUG
|
32
32
|
|
33
|
-
xpath
|
33
|
+
[:xpath, xpath]
|
34
34
|
end
|
35
35
|
|
36
36
|
def lhs_for(key)
|
@@ -15,24 +15,42 @@ describe Watir::ElementLocator do
|
|
15
15
|
|
16
16
|
describe "with selectors not supported by webdriver" do
|
17
17
|
it "handles selector with tag name and a single attribute" do
|
18
|
-
|
18
|
+
if Watir.prefer_css?
|
19
|
+
expect_one :css, 'div[title="foo"]'
|
20
|
+
else
|
21
|
+
expect_one :xpath, ".//div[@title='foo']"
|
22
|
+
end
|
19
23
|
|
20
24
|
locate_one :tag_name => "div",
|
21
25
|
:title => "foo"
|
22
26
|
end
|
23
27
|
|
24
28
|
it "handles selector with no tag name and and a single attribute" do
|
25
|
-
|
29
|
+
if Watir.prefer_css?
|
30
|
+
expect_one :css, '[title="foo"]'
|
31
|
+
else
|
32
|
+
expect_one :xpath, ".//*[@title='foo']"
|
33
|
+
end
|
34
|
+
|
26
35
|
locate_one :title => "foo"
|
27
36
|
end
|
28
37
|
|
29
38
|
it "handles single quotes in the attribute string" do
|
30
|
-
|
39
|
+
if Watir.prefer_css?
|
40
|
+
expect_one :css, %{[title="foo and 'bar'"]}
|
41
|
+
else
|
42
|
+
expect_one :xpath, %{.//*[@title=concat('foo and ',"'",'bar',"'",'')]}
|
43
|
+
end
|
44
|
+
|
31
45
|
locate_one :title => "foo and 'bar'"
|
32
46
|
end
|
33
47
|
|
34
48
|
it "handles selector with tag name and multiple attributes" do
|
35
|
-
|
49
|
+
if Watir.prefer_css?
|
50
|
+
expect_one :css, 'div[title="foo"][dir="bar"]'
|
51
|
+
else
|
52
|
+
expect_one :xpath, ".//div[@title='foo' and @dir='bar']"
|
53
|
+
end
|
36
54
|
|
37
55
|
locate_one [:tag_name, "div",
|
38
56
|
:title , "foo",
|
@@ -40,7 +58,11 @@ describe Watir::ElementLocator do
|
|
40
58
|
end
|
41
59
|
|
42
60
|
it "handles selector with no tag name and multiple attributes" do
|
43
|
-
|
61
|
+
if Watir.prefer_css?
|
62
|
+
expect_one :css, '[dir="foo"][title="bar"]'
|
63
|
+
else
|
64
|
+
expect_one :xpath, ".//*[@dir='foo' and @title='bar']"
|
65
|
+
end
|
44
66
|
|
45
67
|
locate_one [:dir, "foo",
|
46
68
|
:title, "bar"]
|
@@ -63,21 +85,33 @@ describe Watir::ElementLocator do
|
|
63
85
|
end
|
64
86
|
|
65
87
|
it "translates :class_name to :class" do
|
66
|
-
|
88
|
+
if Watir.prefer_css?
|
89
|
+
expect_one :css, "div.foo"
|
90
|
+
else
|
91
|
+
expect_one :xpath, ".//div[contains(concat(' ', @class, ' '), ' foo ')]"
|
92
|
+
end
|
67
93
|
|
68
94
|
locate_one :tag_name => "div",
|
69
95
|
:class_name => "foo"
|
70
96
|
end
|
71
97
|
|
72
98
|
it "handles data-* attributes" do
|
73
|
-
|
99
|
+
if Watir.prefer_css?
|
100
|
+
expect_one :css, 'div[data-name="foo"]'
|
101
|
+
else
|
102
|
+
expect_one :xpath, ".//div[@data-name='foo']"
|
103
|
+
end
|
74
104
|
|
75
105
|
locate_one :tag_name => "div",
|
76
106
|
:data_name => "foo"
|
77
107
|
end
|
78
108
|
|
79
109
|
it "normalizes space for the :href attribute" do
|
80
|
-
|
110
|
+
if Watir.prefer_css?
|
111
|
+
expect_one :css, 'a[href~="foo"]'
|
112
|
+
else
|
113
|
+
expect_one :xpath, ".//a[normalize-space(@href)='foo']"
|
114
|
+
end
|
81
115
|
|
82
116
|
selector = {
|
83
117
|
:tag_name => "a",
|
@@ -107,7 +141,11 @@ describe Watir::ElementLocator do
|
|
107
141
|
end
|
108
142
|
|
109
143
|
it "translates ruby attribute names to content attribute names" do
|
110
|
-
|
144
|
+
if Watir.prefer_css?
|
145
|
+
expect_one :css, 'meta[http-equiv="foo"]'
|
146
|
+
else
|
147
|
+
expect_one :xpath, ".//meta[@http-equiv='foo']"
|
148
|
+
end
|
111
149
|
|
112
150
|
selector = {
|
113
151
|
:tag_name => "meta",
|
@@ -127,7 +165,12 @@ describe Watir::ElementLocator do
|
|
127
165
|
element(:tag_name => "div", :attributes => { :class => "foob"})
|
128
166
|
]
|
129
167
|
|
130
|
-
|
168
|
+
if Watir.prefer_css?
|
169
|
+
expect_all(:css, "div").and_return(elements)
|
170
|
+
else
|
171
|
+
expect_all(:xpath, ".//div").and_return(elements)
|
172
|
+
end
|
173
|
+
|
131
174
|
locate_one(:tag_name => "div", :class => /oob/).should == elements[1]
|
132
175
|
end
|
133
176
|
|
@@ -137,7 +180,11 @@ describe Watir::ElementLocator do
|
|
137
180
|
element(:tag_name => "div", :attributes => { :class => "foo" })
|
138
181
|
]
|
139
182
|
|
140
|
-
|
183
|
+
if Watir.prefer_css?
|
184
|
+
expect_all(:css, "div").and_return(elements)
|
185
|
+
else
|
186
|
+
expect_all(:xpath, ".//div").and_return(elements)
|
187
|
+
end
|
141
188
|
|
142
189
|
selector = {
|
143
190
|
:tag_name => "div",
|
@@ -154,7 +201,12 @@ describe Watir::ElementLocator do
|
|
154
201
|
element(:tag_name => "div", :attributes => { :dir => "foo", :title => "baz" })
|
155
202
|
]
|
156
203
|
|
157
|
-
|
204
|
+
if Watir.prefer_css?
|
205
|
+
expect_all(:css, 'div[dir="foo"]').and_return(elements)
|
206
|
+
else
|
207
|
+
expect_all(:xpath, ".//div[@dir='foo']").and_return(elements)
|
208
|
+
end
|
209
|
+
|
158
210
|
|
159
211
|
selector = {
|
160
212
|
:tag_name => "div",
|
@@ -173,7 +225,12 @@ describe Watir::ElementLocator do
|
|
173
225
|
div_elements = [element(:tag_name => "div")]
|
174
226
|
|
175
227
|
expect_all(:tag_name, "label").ordered.and_return(label_elements)
|
176
|
-
|
228
|
+
|
229
|
+
if Watir.prefer_css?
|
230
|
+
expect_all(:css, 'div[id="baz"]').ordered.and_return(div_elements)
|
231
|
+
else
|
232
|
+
expect_all(:xpath, ".//div[@id='baz']").ordered.and_return(div_elements)
|
233
|
+
end
|
177
234
|
|
178
235
|
locate_one(:tag_name => "div", :label => /oob/).should == div_elements.first
|
179
236
|
end
|
@@ -192,7 +249,11 @@ describe Watir::ElementLocator do
|
|
192
249
|
element(:tag_name => "div")
|
193
250
|
]
|
194
251
|
|
195
|
-
|
252
|
+
if Watir.prefer_css?
|
253
|
+
expect_all(:css, 'div[dir="foo"]').and_return(elements)
|
254
|
+
else
|
255
|
+
expect_all(:xpath, ".//div[@dir='foo']").and_return(elements)
|
256
|
+
end
|
196
257
|
|
197
258
|
selector = {
|
198
259
|
:tag_name => "div",
|
@@ -250,14 +311,22 @@ describe Watir::ElementLocator do
|
|
250
311
|
|
251
312
|
describe "with selectors not supported by webdriver" do
|
252
313
|
it "handles selector with tag name and a single attribute" do
|
253
|
-
|
314
|
+
if Watir.prefer_css?
|
315
|
+
expect_all :css, 'div[dir="foo"]'
|
316
|
+
else
|
317
|
+
expect_all :xpath, ".//div[@dir='foo']"
|
318
|
+
end
|
254
319
|
|
255
320
|
locate_all :tag_name => "div",
|
256
321
|
:dir => "foo"
|
257
322
|
end
|
258
323
|
|
259
324
|
it "handles selector with tag name and multiple attributes" do
|
260
|
-
|
325
|
+
if Watir.prefer_css?
|
326
|
+
expect_all :css, 'div[dir="foo"][title="bar"]'
|
327
|
+
else
|
328
|
+
expect_all :xpath, ".//div[@dir='foo' and @title='bar']"
|
329
|
+
end
|
261
330
|
|
262
331
|
locate_all [:tag_name, "div",
|
263
332
|
:dir , "foo",
|
@@ -274,7 +343,13 @@ describe Watir::ElementLocator do
|
|
274
343
|
element(:tag_name => "div", :attributes => { :class => "noob"})
|
275
344
|
]
|
276
345
|
|
277
|
-
|
346
|
+
if Watir.prefer_css?
|
347
|
+
expect_all(:css, "div").and_return(elements)
|
348
|
+
else
|
349
|
+
expect_all(:xpath, ".//div").and_return(elements)
|
350
|
+
end
|
351
|
+
|
352
|
+
|
278
353
|
locate_all(:tag_name => "div", :class => /oob/).should == elements.last(3)
|
279
354
|
end
|
280
355
|
|
@@ -285,7 +360,11 @@ describe Watir::ElementLocator do
|
|
285
360
|
element(:tag_name => "div", :attributes => { :dir => "foo", :title => "bazt"})
|
286
361
|
]
|
287
362
|
|
288
|
-
|
363
|
+
if Watir.prefer_css?
|
364
|
+
expect_all(:css, 'div[dir="foo"]').and_return(elements)
|
365
|
+
else
|
366
|
+
expect_all(:xpath, ".//div[@dir='foo']").and_return(elements)
|
367
|
+
end
|
289
368
|
|
290
369
|
selector = {
|
291
370
|
:tag_name => "div",
|
data/spec/element_spec.rb
CHANGED
@@ -44,7 +44,10 @@ describe Watir::Element do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
describe "#hover" do
|
47
|
-
not_compliant_on [:webdriver, :firefox, :synthesized_events],
|
47
|
+
not_compliant_on [:webdriver, :firefox, :synthesized_events],
|
48
|
+
[:webdriver, :ie],
|
49
|
+
[:webdriver, :iphone],
|
50
|
+
[:webdriver, :safari] do
|
48
51
|
it "should hover over the element" do
|
49
52
|
browser.goto WatirSpec.url_for('hover.html', :needs_server => true)
|
50
53
|
link = browser.a
|
data/spec/implementation.rb
CHANGED
@@ -11,7 +11,7 @@ class ImplementationConfig
|
|
11
11
|
set_guard_proc
|
12
12
|
add_html_routes
|
13
13
|
|
14
|
-
WatirSpec.always_use_server = mobile? || ie?
|
14
|
+
WatirSpec.always_use_server = mobile? || ie? || safari?
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
@@ -22,14 +22,22 @@ class ImplementationConfig
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def set_browser_args
|
25
|
-
case browser
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
args = case browser
|
26
|
+
when :firefox
|
27
|
+
firefox_args
|
28
|
+
when :chrome
|
29
|
+
chrome_args
|
30
|
+
else
|
31
|
+
[browser, {}]
|
32
|
+
end
|
33
|
+
|
34
|
+
if ENV['SELECTOR_STATS']
|
35
|
+
listener = SelectorListener.new
|
36
|
+
args.last.merge!(:listener => listener)
|
37
|
+
at_exit { listener.report }
|
32
38
|
end
|
39
|
+
|
40
|
+
@imp.browser_args = args
|
33
41
|
end
|
34
42
|
|
35
43
|
def mobile?
|
@@ -40,6 +48,10 @@ class ImplementationConfig
|
|
40
48
|
[:ie, :internet_explorer].include? browser
|
41
49
|
end
|
42
50
|
|
51
|
+
def safari?
|
52
|
+
browser == :safari
|
53
|
+
end
|
54
|
+
|
43
55
|
def set_guard_proc
|
44
56
|
matching_guards = [
|
45
57
|
:webdriver, # guard only applies to webdriver
|
@@ -60,14 +72,14 @@ class ImplementationConfig
|
|
60
72
|
}
|
61
73
|
end
|
62
74
|
|
63
|
-
def
|
75
|
+
def firefox_args
|
64
76
|
profile = Selenium::WebDriver::Firefox::Profile.new
|
65
77
|
profile.native_events = native_events?
|
66
78
|
|
67
|
-
|
79
|
+
[:firefox, {:profile => profile}]
|
68
80
|
end
|
69
81
|
|
70
|
-
def
|
82
|
+
def chrome_args
|
71
83
|
opts = {
|
72
84
|
:switches => ["--disable-translate"],
|
73
85
|
:native_events => native_events?
|
@@ -85,7 +97,7 @@ class ImplementationConfig
|
|
85
97
|
Selenium::WebDriver::Chrome.path = path
|
86
98
|
end
|
87
99
|
|
88
|
-
|
100
|
+
[:chrome, opts]
|
89
101
|
end
|
90
102
|
|
91
103
|
def add_html_routes
|
@@ -106,6 +118,25 @@ class ImplementationConfig
|
|
106
118
|
def native_events_by_default?
|
107
119
|
Selenium::WebDriver::Platform.windows? && [:firefox, :ie].include?(browser)
|
108
120
|
end
|
121
|
+
|
122
|
+
class SelectorListener < Selenium::WebDriver::Support::AbstractEventListener
|
123
|
+
def initialize
|
124
|
+
@counts = Hash.new(0)
|
125
|
+
end
|
126
|
+
|
127
|
+
def before_find(how, what, driver)
|
128
|
+
@counts[how] += 1
|
129
|
+
end
|
130
|
+
|
131
|
+
def report
|
132
|
+
total = @counts.values.inject(0) { |mem, var| mem + var }
|
133
|
+
puts "\nWebDriver selector stats: "
|
134
|
+
@counts.each do |how, count|
|
135
|
+
puts "\t#{how.to_s.ljust(20)}: #{count * 100 / total} (#{count})"
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
109
140
|
end
|
110
141
|
|
111
142
|
ImplementationConfig.new(WatirSpec.implementation).configure
|
data/spec/spec_helper.rb
CHANGED
@@ -21,7 +21,11 @@ if ENV['ALWAYS_LOCATE'] == "false"
|
|
21
21
|
Watir.always_locate = false
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
if ENV['PREFER_CSS']
|
25
|
+
Watir.prefer_css = true
|
26
|
+
end
|
27
|
+
|
28
|
+
WEBDRIVER_SELECTORS = [:class, :class_name, :css, :id, :tag_name, :xpath]
|
25
29
|
|
26
30
|
if ENV['TRAVIS']
|
27
31
|
ENV['DISPLAY'] = ":99.0"
|
data/spec/wait_spec.rb
CHANGED
@@ -1,118 +1,118 @@
|
|
1
1
|
require File.expand_path("watirspec/spec_helper", File.dirname(__FILE__))
|
2
2
|
|
3
|
-
|
4
|
-
describe
|
5
|
-
|
6
|
-
|
3
|
+
not_compliant_on [:webdriver, :safari] do
|
4
|
+
describe Watir::Wait do
|
5
|
+
describe "#until" do
|
6
|
+
it "waits until the block returns true" do
|
7
|
+
Wait.until(0.5) { true }.should be_true
|
8
|
+
end
|
9
|
+
|
10
|
+
it "times out" do
|
11
|
+
lambda do
|
12
|
+
Wait.until(0.5) { false }
|
13
|
+
end.should raise_error(Watir::Wait::TimeoutError)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "times out with a custom message" do
|
17
|
+
lambda do
|
18
|
+
Wait.until(0.5, "oops") { false }
|
19
|
+
end.should raise_error(Watir::Wait::TimeoutError, "timed out after 0.5 seconds, oops")
|
20
|
+
end
|
7
21
|
end
|
8
22
|
|
9
|
-
|
10
|
-
|
11
|
-
Wait.
|
12
|
-
end
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
it "times out" do
|
28
|
-
lambda do
|
29
|
-
Wait.while(0.5) { true }
|
30
|
-
end.should raise_error(Watir::Wait::TimeoutError)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "times out with a custom message" do
|
34
|
-
lambda do
|
35
|
-
Wait.while(0.5, "oops") { true }
|
36
|
-
end.should raise_error(Watir::Wait::TimeoutError, "timed out after 0.5 seconds, oops")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe Watir::Element do
|
42
|
-
|
43
|
-
before do
|
44
|
-
browser.goto WatirSpec.url_for("wait.html", :needs_server => true)
|
45
|
-
end
|
46
|
-
|
47
|
-
describe "#when_present" do
|
48
|
-
it "yields when the element becomes present" do
|
49
|
-
called = false
|
50
|
-
|
51
|
-
browser.a(:id, 'show_bar').click
|
52
|
-
browser.div(:id, 'bar').when_present(1) { called = true }
|
53
|
-
|
54
|
-
called.should be_true
|
55
|
-
end
|
56
|
-
|
57
|
-
it "invokes subsequent method calls when the element becomes present" do
|
58
|
-
browser.a(:id, 'show_bar').click
|
59
|
-
|
60
|
-
bar = browser.div(:id, 'bar')
|
61
|
-
bar.when_present(1).click
|
62
|
-
bar.text.should == "changed"
|
63
|
-
end
|
64
|
-
|
65
|
-
it "times out when given a block" do
|
66
|
-
lambda {
|
67
|
-
browser.div(:id, 'bar').when_present(1) {}
|
68
|
-
}.should raise_error(Watir::Wait::TimeoutError)
|
69
|
-
end
|
70
|
-
|
71
|
-
it "times out when not given a block" do
|
72
|
-
lambda {
|
73
|
-
browser.div(:id, 'bar').when_present(1).click
|
74
|
-
}.should raise_error(Watir::Wait::TimeoutError,
|
75
|
-
/^timed out after 1 seconds, waiting for (\{:id=>"bar", :tag_name=>"div"\}|\{:tag_name=>"div", :id=>"bar"\}) to become present$/
|
76
|
-
)
|
77
|
-
end
|
78
|
-
|
79
|
-
it "responds to Element methods" do
|
80
|
-
decorator = browser.div.when_present
|
81
|
-
|
82
|
-
decorator.should respond_to(:exist?)
|
83
|
-
decorator.should respond_to(:present?)
|
84
|
-
decorator.should respond_to(:click)
|
23
|
+
describe "#while" do
|
24
|
+
it "waits while the block returns true" do
|
25
|
+
Wait.while(0.5) { false }.should == nil
|
26
|
+
end
|
27
|
+
|
28
|
+
it "times out" do
|
29
|
+
lambda do
|
30
|
+
Wait.while(0.5) { true }
|
31
|
+
end.should raise_error(Watir::Wait::TimeoutError)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "times out with a custom message" do
|
35
|
+
lambda do
|
36
|
+
Wait.while(0.5, "oops") { true }
|
37
|
+
end.should raise_error(Watir::Wait::TimeoutError, "timed out after 0.5 seconds, oops")
|
38
|
+
end
|
85
39
|
end
|
86
40
|
end
|
87
41
|
|
88
|
-
describe
|
89
|
-
|
90
|
-
browser.
|
91
|
-
browser.div(:id, 'bar').wait_until_present(5)
|
42
|
+
describe Watir::Element do
|
43
|
+
before do
|
44
|
+
browser.goto WatirSpec.url_for("wait.html", :needs_server => true)
|
92
45
|
end
|
93
46
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
47
|
+
describe "#when_present" do
|
48
|
+
it "yields when the element becomes present" do
|
49
|
+
called = false
|
50
|
+
|
51
|
+
browser.a(:id, 'show_bar').click
|
52
|
+
browser.div(:id, 'bar').when_present(1) { called = true }
|
53
|
+
|
54
|
+
called.should be_true
|
55
|
+
end
|
56
|
+
|
57
|
+
it "invokes subsequent method calls when the element becomes present" do
|
58
|
+
browser.a(:id, 'show_bar').click
|
59
|
+
|
60
|
+
bar = browser.div(:id, 'bar')
|
61
|
+
bar.when_present(1).click
|
62
|
+
bar.text.should == "changed"
|
63
|
+
end
|
64
|
+
|
65
|
+
it "times out when given a block" do
|
66
|
+
lambda {
|
67
|
+
browser.div(:id, 'bar').when_present(1) {}
|
68
|
+
}.should raise_error(Watir::Wait::TimeoutError)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "times out when not given a block" do
|
72
|
+
lambda {
|
73
|
+
browser.div(:id, 'bar').when_present(1).click
|
74
|
+
}.should raise_error(Watir::Wait::TimeoutError,
|
75
|
+
/^timed out after 1 seconds, waiting for (\{:id=>"bar", :tag_name=>"div"\}|\{:tag_name=>"div", :id=>"bar"\}) to become present$/
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
it "responds to Element methods" do
|
80
|
+
decorator = browser.div.when_present
|
81
|
+
|
82
|
+
decorator.should respond_to(:exist?)
|
83
|
+
decorator.should respond_to(:present?)
|
84
|
+
decorator.should respond_to(:click)
|
85
|
+
end
|
100
86
|
end
|
101
|
-
end
|
102
87
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
88
|
+
describe "#wait_until_present" do
|
89
|
+
it "it waits until the element appears" do
|
90
|
+
browser.a(:id, 'show_bar').click
|
91
|
+
browser.div(:id, 'bar').wait_until_present(5)
|
92
|
+
end
|
93
|
+
|
94
|
+
it "times out if the element doesn't appear" do
|
95
|
+
lambda do
|
96
|
+
browser.div(:id, 'bar').wait_until_present(1)
|
97
|
+
end.should raise_error(Watir::Wait::TimeoutError,
|
98
|
+
/^timed out after 1 seconds, waiting for (\{:id=>"bar", :tag_name=>"div"\}|\{:tag_name=>"div", :id=>"bar"\}) to become present$/
|
99
|
+
)
|
100
|
+
end
|
107
101
|
end
|
108
102
|
|
109
|
-
|
110
|
-
|
103
|
+
describe "#wait_while_present" do
|
104
|
+
it "waits until the element disappears" do
|
105
|
+
browser.a(:id, 'hide_foo').click
|
111
106
|
browser.div(:id, 'foo').wait_while_present(1)
|
112
|
-
end
|
113
|
-
|
114
|
-
|
107
|
+
end
|
108
|
+
|
109
|
+
it "times out" do
|
110
|
+
lambda do
|
111
|
+
browser.div(:id, 'foo').wait_while_present(1)
|
112
|
+
end.should raise_error(Watir::Wait::TimeoutError,
|
113
|
+
/^timed out after 1 seconds, waiting for (\{:id=>"foo", :tag_name=>"div"\}|\{:tag_name=>"div", :id=>"foo"\}) to disappear$/
|
114
|
+
)
|
115
|
+
end
|
115
116
|
end
|
116
117
|
end
|
117
|
-
|
118
118
|
end
|
data/support/travis.sh
CHANGED
data/watir-webdriver.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_dependency "selenium-webdriver", '>= 2.
|
22
|
+
s.add_dependency "selenium-webdriver", '>= 2.18.0'
|
23
23
|
|
24
24
|
s.add_development_dependency "rspec", "~> 2.6"
|
25
25
|
s.add_development_dependency "yard", "~> 0.7.4"
|
metadata
CHANGED
@@ -1,172 +1,167 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir-webdriver
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.4
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 3
|
10
|
-
version: 0.5.3
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jari Bakken
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-03-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: selenium-webdriver
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 2
|
31
|
-
- 12
|
32
|
-
- 0
|
33
|
-
version: 2.12.0
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.18.0
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rspec
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
25
|
none: false
|
41
|
-
requirements:
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.18.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
42
35
|
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 2
|
47
|
-
- 6
|
48
|
-
version: "2.6"
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '2.6'
|
49
38
|
type: :development
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: yard
|
53
39
|
prerelease: false
|
54
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
41
|
none: false
|
56
|
-
requirements:
|
42
|
+
requirements:
|
57
43
|
- - ~>
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '2.6'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: yard
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
64
53
|
version: 0.7.4
|
65
54
|
type: :development
|
66
|
-
version_requirements: *id003
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: webidl
|
69
55
|
prerelease: false
|
70
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
57
|
none: false
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.7.4
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: webidl
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
80
69
|
version: 0.1.3
|
81
70
|
type: :development
|
82
|
-
version_requirements: *id004
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: sinatra
|
85
71
|
prerelease: false
|
86
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
87
73
|
none: false
|
88
|
-
requirements:
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.1.3
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: sinatra
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
89
83
|
- - ~>
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
|
92
|
-
segments:
|
93
|
-
- 1
|
94
|
-
- 0
|
95
|
-
version: "1.0"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '1.0'
|
96
86
|
type: :development
|
97
|
-
version_requirements: *id005
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: rake
|
100
87
|
prerelease: false
|
101
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '1.0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rake
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
102
97
|
none: false
|
103
|
-
requirements:
|
98
|
+
requirements:
|
104
99
|
- - ~>
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
hash: 63
|
107
|
-
segments:
|
108
|
-
- 0
|
109
|
-
- 9
|
110
|
-
- 2
|
100
|
+
- !ruby/object:Gem::Version
|
111
101
|
version: 0.9.2
|
112
102
|
type: :development
|
113
|
-
version_requirements: *id006
|
114
|
-
- !ruby/object:Gem::Dependency
|
115
|
-
name: fuubar
|
116
103
|
prerelease: false
|
117
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.9.2
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: fuubar
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
118
113
|
none: false
|
119
|
-
requirements:
|
114
|
+
requirements:
|
120
115
|
- - ~>
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
hash: 19
|
123
|
-
segments:
|
124
|
-
- 0
|
125
|
-
- 0
|
126
|
-
- 6
|
116
|
+
- !ruby/object:Gem::Version
|
127
117
|
version: 0.0.6
|
128
118
|
type: :development
|
129
|
-
version_requirements: *id007
|
130
|
-
- !ruby/object:Gem::Dependency
|
131
|
-
name: nokogiri
|
132
119
|
prerelease: false
|
133
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
134
121
|
none: false
|
135
|
-
requirements:
|
136
|
-
- -
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.0.6
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: nokogiri
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
142
134
|
type: :development
|
143
|
-
version_requirements: *id008
|
144
|
-
- !ruby/object:Gem::Dependency
|
145
|
-
name: activesupport
|
146
135
|
prerelease: false
|
147
|
-
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: activesupport
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
148
145
|
none: false
|
149
|
-
requirements:
|
146
|
+
requirements:
|
150
147
|
- - ~>
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
hash: 9
|
153
|
-
segments:
|
154
|
-
- 2
|
155
|
-
- 3
|
156
|
-
- 5
|
148
|
+
- !ruby/object:Gem::Version
|
157
149
|
version: 2.3.5
|
158
150
|
type: :development
|
159
|
-
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ~>
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: 2.3.5
|
160
158
|
description: WebDriver-backed Watir
|
161
|
-
email:
|
159
|
+
email:
|
162
160
|
- jari.bakken@gmail.com
|
163
161
|
executables: []
|
164
|
-
|
165
162
|
extensions: []
|
166
|
-
|
167
163
|
extra_rdoc_files: []
|
168
|
-
|
169
|
-
files:
|
164
|
+
files:
|
170
165
|
- .document
|
171
166
|
- .gitignore
|
172
167
|
- .gitmodules
|
@@ -257,55 +252,38 @@ files:
|
|
257
252
|
- watir-webdriver.gemspec
|
258
253
|
homepage: http://github.com/watir/watir-webdriver
|
259
254
|
licenses: []
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
* element_by_xpath : replaced by .element(:xpath, '...')
|
272
|
-
* elements_by_xpath : replaced by .elements(:xpath, '...')
|
273
|
-
|
274
|
-
And deprecates the following methods:
|
275
|
-
|
276
|
-
* Browser#clear_cookies - replaced by Browser#cookies API
|
277
|
-
[ https://github.com/watir/watir-webdriver/issues/24 ]
|
278
|
-
|
255
|
+
post_install_message: ! "Please note that watir-webdriver 0.5.0 brings some backwards
|
256
|
+
incompatible changes:\n\n * Watir::Select#selected_options no longer returns Array<String>,
|
257
|
+
but Array<Watir::Option>\n [ https://github.com/watir/watir-webdriver/issues/21
|
258
|
+
]\n * Finding elements by :class now matches partial class attributes.\n [
|
259
|
+
https://github.com/watir/watir-webdriver/issues/36 ]\n\nAdditionally, watir-webdriver
|
260
|
+
0.5.1 removes the following deprecated methods:\n\n * element_by_xpath : replaced
|
261
|
+
by .element(:xpath, '...')\n * elements_by_xpath : replaced by .elements(:xpath,
|
262
|
+
'...')\n\nAnd deprecates the following methods:\n\n * Browser#clear_cookies - replaced
|
263
|
+
by Browser#cookies API\n [ https://github.com/watir/watir-webdriver/issues/24
|
264
|
+
]\n\n"
|
279
265
|
rdoc_options: []
|
280
|
-
|
281
|
-
require_paths:
|
266
|
+
require_paths:
|
282
267
|
- lib
|
283
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
268
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
284
269
|
none: false
|
285
|
-
requirements:
|
286
|
-
- -
|
287
|
-
- !ruby/object:Gem::Version
|
288
|
-
|
289
|
-
|
290
|
-
- 0
|
291
|
-
version: "0"
|
292
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
|
+
requirements:
|
271
|
+
- - ! '>='
|
272
|
+
- !ruby/object:Gem::Version
|
273
|
+
version: '0'
|
274
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
293
275
|
none: false
|
294
|
-
requirements:
|
295
|
-
- -
|
296
|
-
- !ruby/object:Gem::Version
|
297
|
-
|
298
|
-
segments:
|
299
|
-
- 0
|
300
|
-
version: "0"
|
276
|
+
requirements:
|
277
|
+
- - ! '>='
|
278
|
+
- !ruby/object:Gem::Version
|
279
|
+
version: '0'
|
301
280
|
requirements: []
|
302
|
-
|
303
281
|
rubyforge_project: watir-webdriver
|
304
|
-
rubygems_version: 1.8.
|
282
|
+
rubygems_version: 1.8.20
|
305
283
|
signing_key:
|
306
284
|
specification_version: 3
|
307
285
|
summary: Watir on WebDriver
|
308
|
-
test_files:
|
286
|
+
test_files:
|
309
287
|
- spec/alert_spec.rb
|
310
288
|
- spec/browser_spec.rb
|
311
289
|
- spec/click_spec.rb
|