watir 1.7.0.rc1 → 1.7.0
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/CHANGES +8 -2
- data/VERSION +1 -1
- data/lib/watir/ie-class.rb +13 -3
- data/unittests/close_all_test.rb +17 -0
- metadata +13 -17
data/CHANGES
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
== Version 1.7.0 -
|
|
1
|
+
== Version 1.7.0 - 2011/01/06
|
|
2
2
|
|
|
3
3
|
=== IE improvements
|
|
4
4
|
|
|
5
|
-
* Fixed Watir::IE#close_all. Closes http://jira.openqa.org/browse/WTR-463 (Jarmo Pertman)
|
|
5
|
+
* Fixed Watir::IE#close_all to close all IE windows, even the ones with tabs. Closes http://jira.openqa.org/browse/WTR-463 (Jarmo Pertman)
|
|
6
6
|
* 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)
|
|
7
7
|
* Added CSS3 selectors with usage like browser.text_field(:css => "input[name='text1']") (Jonas Tingeborn)
|
|
8
8
|
* Updated bundled version of AutoIt to 3.3.6.1. Closes http://jira.openqa.org/browse/WTR-440 (Jarmo Pertman)
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
* Fixed Element#exists? for cases where nested elements were used for locating (Alok Menghrajani)
|
|
13
13
|
* Ignore uppercase tags in XHTML when searching for elements (Alok Menghrajani)
|
|
14
14
|
|
|
15
|
+
=== General improvements
|
|
16
|
+
|
|
17
|
+
* Return Element#id correctly when using Element#when_present and friends methods. Closes http://jira.openqa.org/browse/WTR-469 (Jarmo Pertman)
|
|
18
|
+
|
|
19
|
+
Whole Changelog is available at http://github.com/bret/watir/compare/v1.6.7...v1.7.0
|
|
20
|
+
|
|
15
21
|
== Version 1.6.7 - 2010/10/26
|
|
16
22
|
|
|
17
23
|
=== General improvements
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.7.0
|
|
1
|
+
1.7.0
|
data/lib/watir/ie-class.rb
CHANGED
|
@@ -233,14 +233,18 @@ module Watir
|
|
|
233
233
|
# Yields successively to each IE window on the current desktop. Takes a block.
|
|
234
234
|
# This method will not work when
|
|
235
235
|
# Watir/Ruby is run under a service (instead of a user).
|
|
236
|
-
|
|
236
|
+
# Yields to the window and its hwnd.
|
|
237
237
|
def self.each
|
|
238
238
|
shell = WIN32OLE.new('Shell.Application')
|
|
239
|
+
ie_browsers = []
|
|
239
240
|
shell.Windows.each do |window|
|
|
240
241
|
next unless (window.path =~ /Internet Explorer/ rescue false)
|
|
241
242
|
next unless (hwnd = window.hwnd rescue false)
|
|
242
243
|
ie = IE.bind(window)
|
|
243
244
|
ie.hwnd = hwnd
|
|
245
|
+
ie_browsers << ie
|
|
246
|
+
end
|
|
247
|
+
ie_browsers.each do |ie|
|
|
244
248
|
yield ie
|
|
245
249
|
end
|
|
246
250
|
end
|
|
@@ -312,7 +316,7 @@ module Watir
|
|
|
312
316
|
# Are we attached to an open browser?
|
|
313
317
|
def exists?
|
|
314
318
|
begin
|
|
315
|
-
@ie.name =~ /Internet Explorer/
|
|
319
|
+
!!(@ie.name =~ /Internet Explorer/)
|
|
316
320
|
rescue WIN32OLERuntimeError
|
|
317
321
|
false
|
|
318
322
|
end
|
|
@@ -398,7 +402,13 @@ module Watir
|
|
|
398
402
|
wait rescue nil
|
|
399
403
|
chwnd = @ie.hwnd.to_i
|
|
400
404
|
@ie.quit
|
|
401
|
-
|
|
405
|
+
t = Time.now
|
|
406
|
+
while exists?
|
|
407
|
+
# just in case to avoid possible endless loop
|
|
408
|
+
if Time.now - t > 10
|
|
409
|
+
puts "Impossible to close all IE windows, continuing."
|
|
410
|
+
break
|
|
411
|
+
end
|
|
402
412
|
sleep 0.3
|
|
403
413
|
end
|
|
404
414
|
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') unless $SETUP_LOADED
|
|
2
|
+
require 'unittests/setup'
|
|
3
|
+
|
|
4
|
+
class TC_CloseAllWindows < Watir::TestCase
|
|
5
|
+
|
|
6
|
+
def setup
|
|
7
|
+
@browsers = []
|
|
8
|
+
5.times {@browsers << Watir::Browser.new}
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def test_close_all_windows
|
|
12
|
+
assert @browsers.all? {|browser| browser.exists?}
|
|
13
|
+
Watir::IE.close_all
|
|
14
|
+
assert @browsers.all? {|browser| not browser.exists?}
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: watir
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
5
|
-
prerelease:
|
|
4
|
+
hash: 11
|
|
5
|
+
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
8
|
- 7
|
|
9
9
|
- 0
|
|
10
|
-
|
|
11
|
-
version: 1.7.0.rc1
|
|
10
|
+
version: 1.7.0
|
|
12
11
|
platform: ruby
|
|
13
12
|
authors:
|
|
14
13
|
- Bret Pettichord
|
|
@@ -16,7 +15,7 @@ autorequire:
|
|
|
16
15
|
bindir: bin
|
|
17
16
|
cert_chain: []
|
|
18
17
|
|
|
19
|
-
date:
|
|
18
|
+
date: 2011-01-06 00:00:00 +02:00
|
|
20
19
|
default_executable:
|
|
21
20
|
dependencies:
|
|
22
21
|
- !ruby/object:Gem::Dependency
|
|
@@ -59,13 +58,12 @@ dependencies:
|
|
|
59
58
|
requirements:
|
|
60
59
|
- - "="
|
|
61
60
|
- !ruby/object:Gem::Version
|
|
62
|
-
hash:
|
|
61
|
+
hash: 11
|
|
63
62
|
segments:
|
|
64
63
|
- 1
|
|
65
64
|
- 7
|
|
66
65
|
- 0
|
|
67
|
-
|
|
68
|
-
version: 1.7.0.rc1
|
|
66
|
+
version: 1.7.0
|
|
69
67
|
type: :runtime
|
|
70
68
|
version_requirements: *id003
|
|
71
69
|
- !ruby/object:Gem::Dependency
|
|
@@ -76,13 +74,12 @@ dependencies:
|
|
|
76
74
|
requirements:
|
|
77
75
|
- - "="
|
|
78
76
|
- !ruby/object:Gem::Version
|
|
79
|
-
hash:
|
|
77
|
+
hash: 11
|
|
80
78
|
segments:
|
|
81
79
|
- 1
|
|
82
80
|
- 7
|
|
83
81
|
- 0
|
|
84
|
-
|
|
85
|
-
version: 1.7.0.rc1
|
|
82
|
+
version: 1.7.0
|
|
86
83
|
type: :runtime
|
|
87
84
|
version_requirements: *id004
|
|
88
85
|
- !ruby/object:Gem::Dependency
|
|
@@ -158,6 +155,7 @@ files:
|
|
|
158
155
|
- unittests/checkbox_test.rb
|
|
159
156
|
- unittests/checkbox_xpath_test.rb
|
|
160
157
|
- unittests/click_no_wait_test.rb
|
|
158
|
+
- unittests/close_all_test.rb
|
|
161
159
|
- unittests/core_tests.rb
|
|
162
160
|
- unittests/css_selector_test.rb
|
|
163
161
|
- unittests/css_test.rb
|
|
@@ -335,14 +333,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
335
333
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
336
334
|
none: false
|
|
337
335
|
requirements:
|
|
338
|
-
- - "
|
|
336
|
+
- - ">="
|
|
339
337
|
- !ruby/object:Gem::Version
|
|
340
|
-
hash:
|
|
338
|
+
hash: 3
|
|
341
339
|
segments:
|
|
342
|
-
-
|
|
343
|
-
|
|
344
|
-
- 1
|
|
345
|
-
version: 1.3.1
|
|
340
|
+
- 0
|
|
341
|
+
version: "0"
|
|
346
342
|
requirements:
|
|
347
343
|
- Microsoft Windows running Internet Explorer 5.5 or later.
|
|
348
344
|
rubyforge_project: Watir
|