watir 1.7.1 → 1.8.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,15 @@
1
+ == Version X.X.X - 2011/XX/XX
2
+
3
+ === IE improvements
4
+
5
+ * Improved speed of #click_no_wait by not loading RubyGems (Jarmo Pertman)
6
+ * Added check to maxlength so we don't clobber any incoming js events. (Charley Baker)
7
+
8
+ === Firefox improvements
9
+
10
+ * Removed dependency for ActiveSupport, making it possible to use FireWatir with Rails 3 (Jarmo Pertman)
11
+ * Removed :waitTime option and try to handle better firefox startup (Jarmo Pertman)
12
+
1
13
  == Version 1.7.1 - 2011/01/10
2
14
 
3
15
  === IE improvements
@@ -18,6 +30,8 @@ Whole Changelog is available at http://github.com/bret/watir/compare/v1.7.1...v1
18
30
  * IE#wait waits now again until browser has a state of READYSTATE_COMPLETE due to strange timing issues. Closes http://jira.openqa.org/browse/WTR-466 (Jarmo Pertman)
19
31
  * Added CSS3 selectors with usage like browser.text_field(:css => "input[name='text1']") (Jonas Tingeborn)
20
32
  * Updated bundled version of AutoIt to 3.3.6.1. Closes http://jira.openqa.org/browse/WTR-440 (Jarmo Pertman)
33
+ Note: If you want to use this version of AutoIt, you'll need to manually uninstall all previously installed Watir and possibly manually installed AutoIt versions first.
34
+ When you run your Watir scripts, it will automatically install and use the new version.
21
35
 
22
36
  === Firefox improvements
23
37
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.1
1
+ 1.8.0.rc1
@@ -4,6 +4,7 @@ require 'timeout'
4
4
  require 'watir/win32ole'
5
5
 
6
6
  # these are required already in commonwatir, but not when using click_no_wait!
7
+ require 'watir/core_ext'
7
8
  require 'watir/exceptions'
8
9
  require 'watir/matches'
9
10
  require 'watir/wait'
@@ -11,7 +12,6 @@ require 'watir/wait_helper'
11
12
  require 'watir/element_extensions'
12
13
 
13
14
  require 'logger'
14
- require 'watir/core_ext'
15
15
  require 'watir/logger'
16
16
  require 'watir/container'
17
17
  require 'watir/locator'
@@ -28,4 +28,4 @@ require 'watir/image'
28
28
  require 'watir/link'
29
29
  require 'watir/html_element'
30
30
 
31
- require 'watir/module'
31
+ require 'watir/module'
@@ -236,9 +236,9 @@ module Watir
236
236
  assert_enabled
237
237
  highlight(:set)
238
238
  element = "#{self.class}.new(#{@page_container.attach_command}, :unique_number, #{self.unique_number})"
239
- ruby_code = "require 'rubygems';" <<
240
- "require '#{File.expand_path(File.dirname(__FILE__))}/core';" <<
241
- "#{element}.click!"
239
+ # fill the $LOAD_PATH in spawned process
240
+ ruby_code = "$:.unshift(#{$LOAD_PATH.grep(%r{watir(-.*?)?/lib}).map {|p| "'#{p}'" }.join(").unshift(")});" <<
241
+ "require '#{File.expand_path(File.dirname(__FILE__))}/core';#{element}.click!"
242
242
  system(spawned_click_no_wait_command(ruby_code))
243
243
  highlight(:clear)
244
244
  end
@@ -245,7 +245,7 @@ module Watir
245
245
 
246
246
  # return number of maxlength attribute
247
247
  def maxlength
248
- assert_exists
248
+ assert_exists unless @o
249
249
  begin
250
250
  ole_object.invoke('maxlength').to_i
251
251
  rescue WIN32OLERuntimeError
@@ -3,12 +3,12 @@ require 'unittests/setup'
3
3
 
4
4
  class TC_CloseAllWindows < Watir::TestCase
5
5
 
6
- def setup
6
+ def xsetup
7
7
  @browsers = []
8
8
  5.times {@browsers << Watir::Browser.new}
9
9
  end
10
10
 
11
- def test_close_all_windows
11
+ def xtest_close_all_windows
12
12
  assert @browsers.all? {|browser| browser.exists?}
13
13
  Watir::IE.close_all
14
14
  assert @browsers.all? {|browser| not browser.exists?}
@@ -9,6 +9,16 @@ Test page for Text Fields
9
9
  function addEvent(e) {
10
10
  document.all.events_text.value = document.all.events_text.value + "\n" + e
11
11
  }
12
+ function handle_focus(obj) {
13
+ if (obj.value == "foo") {
14
+ obj.value = "";
15
+ }
16
+ }
17
+ function handle_blur(obj) {
18
+ if (obj.value == "") {
19
+ obj.value = "foo";
20
+ }
21
+ }
12
22
  </script>
13
23
 
14
24
 
@@ -73,6 +83,9 @@ This Field has javascript events in it
73
83
  <textarea name = events_text cols = 20 rows = 10 ></textarea>
74
84
  <input type=button onClick='document.all.events_text.value=""' value="Clear Events Box">
75
85
 
86
+ Handle text field with focus and blur events for maxlength issue.
87
+ <input type="text" value="foo" onfocus="handle_focus(this);" onblur="handle_blur(this);">
88
+
76
89
 
77
90
  <br>
78
91
  Password Fields
@@ -23,6 +23,7 @@ class TC_Fields < Test::Unit::TestCase
23
23
 
24
24
  assert(browser.text_field(:beforeText, /after/i).exists? )
25
25
  assert(browser.text_field(:afterText, /before/i).exists? )
26
+ assert(browser.text_field(:value, 'foo').exists?)
26
27
  end
27
28
 
28
29
  tag_method :test_text_field_dragContentsTo, :fails_on_firefox
@@ -136,7 +137,7 @@ class TC_Fields < Test::Unit::TestCase
136
137
  end
137
138
 
138
139
  def test_text_field_iterators
139
- assert_equal(13, browser.text_fields.length)
140
+ assert_equal(14, browser.text_fields.length)
140
141
 
141
142
  # watir is 1 based, so this is the first text field
142
143
  assert_equal("Hello World", browser.text_fields[1].value)
@@ -215,4 +216,9 @@ class TC_Fields < Test::Unit::TestCase
215
216
  def test_max_length
216
217
  assert_equal(20, browser.text_field(:name, 'text1').maxlength)
217
218
  end
219
+
220
+ def test_additional_events
221
+ browser.text_field(:value, 'foo').set 'bar'
222
+ assert(browser.text_field(:value, 'bar').exists?)
223
+ end
218
224
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease: false
4
+ hash: 977940510
5
+ prerelease: true
6
6
  segments:
7
7
  - 1
8
- - 7
9
- - 1
10
- version: 1.7.1
8
+ - 8
9
+ - 0
10
+ - rc1
11
+ version: 1.8.0.rc1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Bret Pettichord
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2011-01-10 00:00:00 +02:00
19
+ date: 2011-02-25 00:00:00 -07:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
@@ -58,12 +59,13 @@ dependencies:
58
59
  requirements:
59
60
  - - "="
60
61
  - !ruby/object:Gem::Version
61
- hash: 9
62
+ hash: 977940510
62
63
  segments:
63
64
  - 1
64
- - 7
65
- - 1
66
- version: 1.7.1
65
+ - 8
66
+ - 0
67
+ - rc1
68
+ version: 1.8.0.rc1
67
69
  type: :runtime
68
70
  version_requirements: *id003
69
71
  - !ruby/object:Gem::Dependency
@@ -74,12 +76,13 @@ dependencies:
74
76
  requirements:
75
77
  - - "="
76
78
  - !ruby/object:Gem::Version
77
- hash: 9
79
+ hash: 977940510
78
80
  segments:
79
81
  - 1
80
- - 7
81
- - 1
82
- version: 1.7.1
82
+ - 8
83
+ - 0
84
+ - rc1
85
+ version: 1.8.0.rc1
83
86
  type: :runtime
84
87
  version_requirements: *id004
85
88
  - !ruby/object:Gem::Dependency
@@ -119,7 +122,6 @@ files:
119
122
  - lib/watir/container.rb
120
123
  - lib/watir/cookiemanager.rb
121
124
  - lib/watir/core.rb
122
- - lib/watir/core_ext.rb
123
125
  - lib/watir/dialog.rb
124
126
  - lib/watir/element.rb
125
127
  - lib/watir/element_collections.rb
@@ -333,12 +335,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
333
335
  required_rubygems_version: !ruby/object:Gem::Requirement
334
336
  none: false
335
337
  requirements:
336
- - - ">="
338
+ - - ">"
337
339
  - !ruby/object:Gem::Version
338
- hash: 3
340
+ hash: 25
339
341
  segments:
340
- - 0
341
- version: "0"
342
+ - 1
343
+ - 3
344
+ - 1
345
+ version: 1.3.1
342
346
  requirements:
343
347
  - Microsoft Windows running Internet Explorer 5.5 or later.
344
348
  rubyforge_project: Watir
@@ -1,18 +0,0 @@
1
- class String
2
-
3
- #
4
- # "Watir::Span" => "Span"
5
- #
6
-
7
- def demodulize
8
- gsub(/^.*::/, '')
9
- end
10
-
11
- #
12
- # "FooBar" => "foo_bar"
13
- #
14
-
15
- def underscore
16
- gsub(/\B[A-Z][^A-Z]/, '_\&').downcase.gsub(' ', '_')
17
- end
18
- end