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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82e0a1f0202b470c924e61682c83185857184d45
4
- data.tar.gz: 62bf58042ab3107d7dfa66310db75328d2a6f361
3
+ metadata.gz: 02350fa770d3f560edf82f8fdb3efb33667b5c79
4
+ data.tar.gz: f25ed98f3c07012a3e7e6f940939872bd08e0a7b
5
5
  SHA512:
6
- metadata.gz: 433a40d59782c7f1444c95a995b9b3bffdea122f22c21a680f2c552bd5926b4bd9d97587dc4255f432b8fa673a2e24a7cad46c92b7941b5bc2afeeb5c7ac38ce
7
- data.tar.gz: 4c91feef374e9cece2aa66f889880579183cbfe058a3aa183db016e9be5325e4a8c8b369553c2dacacbbd7adffea430554929f400c7f56a9ad832851e2d60b78
6
+ metadata.gz: 62938c328cc2a16ac0d4ba6c48aa2bc09f0ac155a73adcd1bf63449120ed49139ecdba3cda0a4eab39e7eb4d6cde1e598e0a023f867be83aca6813336b5b4f94
7
+ data.tar.gz: 7b206faceabf70654fb6217fdcd7bb2be3f2ba9096c13dcbf97aaf68c5ea1af09e3d959b1c069397bf46caa7e5d990feae92fe77e7ced866df13c95e95ae5667
data/CHANGES.md CHANGED
@@ -1,6 +1,10 @@
1
+ ### 6.4.3 (2017-07-19)
2
+
3
+ * Fix bug with element relocation from ElementCollection
4
+
1
5
  ### 6.4.2 (2017-07-14)
2
6
 
3
- * Fix bug with element relocation from ElementCollection (#571)
7
+ * No changes
4
8
 
5
9
  ### 6.4.1 (2017-07-13)
6
10
 
@@ -102,9 +102,9 @@ module Watir
102
102
  # Returns URL of current page.
103
103
  #
104
104
  # @example
105
- # browser.goto "watir.github.io"
105
+ # browser.goto "watir.com"
106
106
  # browser.url
107
- # #=> "http://watir.github.io/"
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
- @to_a ||= elements.map.with_index do |e, idx|
84
- element = element_class.new(@query_scope, @selector.merge(element: e, index: idx))
85
- element_class == Watir::HTMLElement ? element.to_subtype : element
86
- end
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'watir'
5
- s.version = '6.4.2'
5
+ s.version = '6.4.3'
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.authors = ['Alex Rodionov', 'Titus Fortner']
8
8
  s.email = ['p0deje@gmail.com', 'titusfortner@gmail.com']
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.2
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-14 00:00:00.000000000 Z
12
+ date: 2017-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver