watir-webdriver 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/watir-webdriver/elements/element.rb +1 -5
- data/lib/watir-webdriver/version.rb +1 -1
- data/spec/element_spec.rb +10 -0
- metadata +1 -1
@@ -21,10 +21,6 @@ module Watir
|
|
21
21
|
unless @selector.kind_of? Hash
|
22
22
|
raise ArgumentError, "invalid argument: #{selector.inspect}"
|
23
23
|
end
|
24
|
-
|
25
|
-
if @selector.has_key?(:element)
|
26
|
-
@element = @selector[:element]
|
27
|
-
end
|
28
24
|
end
|
29
25
|
|
30
26
|
def exists?
|
@@ -250,7 +246,7 @@ module Watir
|
|
250
246
|
protected
|
251
247
|
|
252
248
|
def assert_exists
|
253
|
-
@element ||= locate
|
249
|
+
@element ||= (@selector[:element] || locate)
|
254
250
|
|
255
251
|
unless @element
|
256
252
|
raise UnknownObjectException, "unable to locate element, using #{selector_string}"
|
data/spec/element_spec.rb
CHANGED
@@ -63,4 +63,14 @@ describe Watir::Element do
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
+
describe "#reset!" do
|
67
|
+
it "successfully relocates collection elements after a reset!" do
|
68
|
+
element = browser.divs(:id, 'foo').to_a.first
|
69
|
+
element.should_not be_nil
|
70
|
+
|
71
|
+
element.send :reset!
|
72
|
+
element.should exist
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
66
76
|
end
|