watir 6.4.2 → 6.4.3
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 -1
- data/lib/watir/browser.rb +2 -2
- data/lib/watir/element_collection.rb +15 -4
- data/spec/watirspec/elements/collections_spec.rb +8 -0
- data/watir.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02350fa770d3f560edf82f8fdb3efb33667b5c79
|
4
|
+
data.tar.gz: f25ed98f3c07012a3e7e6f940939872bd08e0a7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62938c328cc2a16ac0d4ba6c48aa2bc09f0ac155a73adcd1bf63449120ed49139ecdba3cda0a4eab39e7eb4d6cde1e598e0a023f867be83aca6813336b5b4f94
|
7
|
+
data.tar.gz: 7b206faceabf70654fb6217fdcd7bb2be3f2ba9096c13dcbf97aaf68c5ea1af09e3d959b1c069397bf46caa7e5d990feae92fe77e7ced866df13c95e95ae5667
|
data/CHANGES.md
CHANGED
data/lib/watir/browser.rb
CHANGED
@@ -102,9 +102,9 @@ module Watir
|
|
102
102
|
# Returns URL of current page.
|
103
103
|
#
|
104
104
|
# @example
|
105
|
-
# browser.goto "watir.
|
105
|
+
# browser.goto "watir.com"
|
106
106
|
# browser.url
|
107
|
-
# #=> "http://watir.
|
107
|
+
# #=> "http://watir.com/"
|
108
108
|
#
|
109
109
|
# @return [String]
|
110
110
|
#
|
@@ -80,10 +80,21 @@ module Watir
|
|
80
80
|
#
|
81
81
|
|
82
82
|
def to_a
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
83
|
+
hash = {}
|
84
|
+
@to_a ||=
|
85
|
+
elements.map.with_index do |e, idx|
|
86
|
+
element = element_class.new(@query_scope, @selector.merge(element: e, index: idx))
|
87
|
+
if [Watir::HTMLElement, Watir::Input].include? element.class
|
88
|
+
element = element.to_subtype
|
89
|
+
hash[element.class] ||= []
|
90
|
+
hash[element.class] << element
|
91
|
+
element.class.new(@query_scope, @selector.merge(element: e,
|
92
|
+
tag_name: element.tag_name,
|
93
|
+
index: hash[element.class].size - 1))
|
94
|
+
else
|
95
|
+
element
|
96
|
+
end
|
97
|
+
end
|
87
98
|
end
|
88
99
|
|
89
100
|
#
|
@@ -24,4 +24,12 @@ describe "Collections" do
|
|
24
24
|
expect(collection.any? { |el| el.is_a? Watir::Span}).to eq true
|
25
25
|
expect(collection.any? { |el| el.is_a? Watir::Div}).to eq true
|
26
26
|
end
|
27
|
+
|
28
|
+
it "relocates the same element" do
|
29
|
+
browser.goto(WatirSpec.url_for("nested_elements.html"))
|
30
|
+
collection = browser.div(id: "parent").children
|
31
|
+
tag = collection[3].tag_name
|
32
|
+
browser.refresh
|
33
|
+
expect(collection[3].tag_name).to eq tag
|
34
|
+
end
|
27
35
|
end
|
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.4.
|
4
|
+
version: 6.4.3
|
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: 2017-07-
|
12
|
+
date: 2017-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|