watir-webdriver 0.0.1.dev2 → 0.0.1.dev3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/watir-webdriver/base_element.rb +6 -0
- data/lib/watir-webdriver/browser.rb +2 -7
- data/spec/watirspec/element_spec.rb +7 -5
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.1.
|
1
|
+
0.0.1.dev3
|
@@ -230,6 +230,12 @@ module Watir
|
|
230
230
|
browserbot('getOuterHTML', @element).strip
|
231
231
|
end
|
232
232
|
|
233
|
+
#
|
234
|
+
# Note: Firefox queues focus events until the window actually has focus.
|
235
|
+
#
|
236
|
+
# See http://code.google.com/p/selenium/issues/detail?id=157
|
237
|
+
#
|
238
|
+
|
233
239
|
def focus
|
234
240
|
assert_exists
|
235
241
|
driver.execute_script "return arguments[0].focus()", @element
|
@@ -71,12 +71,7 @@ module Watir
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def text
|
74
|
-
|
75
|
-
if @driver.bridge.browser == :firefox
|
76
|
-
browserbot 'getVisibleText'
|
77
|
-
else
|
78
|
-
@driver.find_element(:tag_name, "body").text
|
79
|
-
end
|
74
|
+
@driver.find_element(:tag_name, "body").text
|
80
75
|
end
|
81
76
|
|
82
77
|
def html
|
@@ -84,7 +79,7 @@ module Watir
|
|
84
79
|
end
|
85
80
|
|
86
81
|
def refresh
|
87
|
-
|
82
|
+
@driver.navigate.refresh
|
88
83
|
end
|
89
84
|
|
90
85
|
def exist?
|
@@ -30,11 +30,13 @@ describe "Element" do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
describe "#focus" do
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
bug "http://code.google.com/p/selenium/issues/detail?id=157", :webdriver do
|
34
|
+
it "fires the onfocus event for the given element" do
|
35
|
+
tf = browser.text_field(:id, "new_user_occupation")
|
36
|
+
tf.value.should == "Developer"
|
37
|
+
tf.focus
|
38
|
+
browser.div(:id, "onfocus_test").text.should == "changed by onfocus event"
|
39
|
+
end
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|