watir 6.11.0.beta2 → 6.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/lib/watir/element_collection.rb +17 -3
- data/lib/watir/elements/element.rb +1 -0
- data/lib/watir/elements/select.rb +1 -1
- data/spec/watirspec/adjacent_spec.rb +3 -1
- data/spec/watirspec/html/wait.html +1 -0
- data/spec/watirspec/wait_spec.rb +5 -1
- data/watir.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8eaa5c46491ba52da6c95709e75cc9759e51de70b8a5687c2d44668c1bcd7bee
|
4
|
+
data.tar.gz: e66fd1830e0442e4165476ecdca900ec5aaf0aa7879f8006c223402d9442ad0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3492caa375debcda81ccc04efec7d2c34af1caa9689ad66e6d60d44bc23f51c103a60070e493d0d1e54255fc77837f10e5aa54054dd66ae1c794546f6ec29ceb
|
7
|
+
data.tar.gz: d27c43b7e043a1f2602959bc48be08efe4d4a12fa6ce5f353c1ea38f4b629452153c5232a393510dbed4608fd18fd8f69fbf7a08c573036ee3017d163d781e82
|
data/CHANGES.md
CHANGED
@@ -37,15 +37,29 @@ module Watir
|
|
37
37
|
#
|
38
38
|
# Get the element at the given index.
|
39
39
|
#
|
40
|
-
#
|
41
|
-
#
|
40
|
+
# Any call to an ElementCollection including an adjacent selector
|
41
|
+
# can not be lazy loaded because it must store correct type
|
42
42
|
#
|
43
43
|
# @param [Integer] idx Index of wanted element, 0-indexed
|
44
44
|
# @return [Watir::Element] Returns an instance of a Watir::Element subclass
|
45
45
|
#
|
46
46
|
|
47
47
|
def [](idx)
|
48
|
-
|
48
|
+
if @selector.key? :adjacent
|
49
|
+
to_a[idx] || element_class.new(@query_scope, {invalid_locator: true})
|
50
|
+
else
|
51
|
+
element_class.new(@query_scope, @selector.merge(index: idx))
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# First element of the collection
|
57
|
+
#
|
58
|
+
# @return [Watir::Element] Returns an instance of a Watir::Element subclass
|
59
|
+
#
|
60
|
+
|
61
|
+
def first
|
62
|
+
self[0]
|
49
63
|
end
|
50
64
|
|
51
65
|
#
|
@@ -53,6 +53,8 @@ describe "Adjacent Elements" do
|
|
53
53
|
|
54
54
|
it "accepts a class_name argument" do
|
55
55
|
siblings = browser.div(id: "second_sibling").siblings(class_name: 'b')
|
56
|
+
expect(siblings.first).to be_a Watir::Div
|
57
|
+
expect(siblings[0]).to be_a Watir::Div
|
56
58
|
expect(siblings.size).to eq 2
|
57
59
|
expect(siblings.all? { |sib| sib.is_a? Watir::Div }).to eq true
|
58
60
|
end
|
@@ -111,7 +113,7 @@ describe "Adjacent Elements" do
|
|
111
113
|
expect(browser.div(id: "second_sibling").following_siblings(tag_name: :div).first).to be_a Watir::Div
|
112
114
|
end
|
113
115
|
|
114
|
-
it "accepts class_name argument" do
|
116
|
+
it "accepts class_name argument for single class" do
|
115
117
|
expect(browser.div(id: "second_sibling").following_siblings(class_name: 'b').size).to eq 1
|
116
118
|
expect(browser.div(id: "second_sibling").following_siblings(class_name: 'b').first).to be_a Watir::Div
|
117
119
|
end
|
@@ -54,6 +54,7 @@
|
|
54
54
|
<a id="hide_foo" href="#" onclick="setTimeoutDisplay('foo', 'none', 500);">hide foo</a>
|
55
55
|
<a id="remove_foo" href="#" onclick="setTimeoutRemove('foo', 1000);">remove foo</a>
|
56
56
|
<a id="add_foobar" href="#" onclick="setTimeoutAddDisplay('foobar', 'bar', 1000);">add foobar</a>
|
57
|
+
<a id="readd_bar" href="#" onclick="setTimeoutRemove('bar', 500); setTimeoutAddDisplay('bar', 'foo', 1000);">re-add bar</a>
|
57
58
|
<div id="buttons">
|
58
59
|
<button id="btn" type="button" onclick="setDisabled('btn', true, 0)" disabled>Click To Disable!</button>
|
59
60
|
<a id="enable_btn" href="#" onclick="setDisabled('btn', false, 500);">enable btn</a>
|
data/spec/watirspec/wait_spec.rb
CHANGED
@@ -204,6 +204,11 @@ describe Watir::Element do
|
|
204
204
|
expect { browser.div(id: 'bar').wait_until_present(timeout: 5) }.to_not raise_exception
|
205
205
|
end
|
206
206
|
|
207
|
+
it "waits until the element re-appears" do
|
208
|
+
browser.link(id: 'readd_bar').click
|
209
|
+
expect { browser.div(id: 'bar').wait_until_present }.to_not raise_exception
|
210
|
+
end
|
211
|
+
|
207
212
|
it "times out if the element doesn't appear" do
|
208
213
|
inspected = '#<Watir::Div: located: false; {:id=>"bar", :tag_name=>"div"}>'
|
209
214
|
error = Watir::Wait::TimeoutError
|
@@ -259,7 +264,6 @@ describe Watir::Element do
|
|
259
264
|
Watir.default_timeout = 1
|
260
265
|
element = browser.link(name: 'add_select').wait_until(&:exists?)
|
261
266
|
begin
|
262
|
-
start_time = ::Time.now
|
263
267
|
browser.link(id: 'change_select').click
|
264
268
|
expect { element.wait_while_present }.not_to raise_error
|
265
269
|
ensure
|
data/watir.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.11.0
|
4
|
+
version: 6.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Rodionov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-05-
|
12
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|
@@ -520,9 +520,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
520
520
|
version: '0'
|
521
521
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
522
522
|
requirements:
|
523
|
-
- - "
|
523
|
+
- - ">="
|
524
524
|
- !ruby/object:Gem::Version
|
525
|
-
version:
|
525
|
+
version: '0'
|
526
526
|
requirements: []
|
527
527
|
rubyforge_project: watir
|
528
528
|
rubygems_version: 2.7.3
|