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 CHANGED
@@ -1 +1 @@
1
- 0.0.1.dev2
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
- # TODO: do this properly
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
- execute_script 'location.reload(true)'
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
- it "fires the onfocus event for the given element" do
34
- tf = browser.text_field(:id, "new_user_occupation")
35
- tf.value.should == "Developer"
36
- tf.focus
37
- browser.div(:id, "onfocus_test").text.should == "changed by onfocus event"
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.dev2
4
+ version: 0.0.1.dev3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jari Bakken