watir 1.6.6.rc1 → 1.6.6.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -1
- data/VERSION +1 -1
- data/lib/watir/core.rb +1 -0
- data/lib/watir/element.rb +18 -2
- data/lib/watir/ie-class.rb +4 -0
- data/lib/watir/page-container.rb +0 -20
- data/rakefile.rb +6 -0
- data/unittests/click_no_wait_test.rb +1 -1
- data/unittests/form_test.rb +14 -3
- data/unittests/setup.rb +11 -15
- data/watir-rdoc.rb +7 -0
- data/watir.gemspec +56 -0
- metadata +12 -10
data/CHANGES
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
* Added an optional numeric parameter max_depth for Table#to_a and TableRow#to_a for getting text values for nested tables. Closes http://jira.openqa.org/browse/WTR-445 (Jarmo Pertman)
|
11
11
|
* #close will close the browser even if #wait raises an Exception. Closes http://jira.openqa.org/browse/WTR-443 (Jarmo Pertman)
|
12
12
|
* Added #element and #elements methods for locating non-specific elements. Closes http://jira.openqa.org/browse/WTR-103 (Hugh McGowan)
|
13
|
-
* #click_no_wait fixes and improvements. Closes http://jira.openqa.org/browse/WTR-449 (Jarmo Pertman)
|
13
|
+
* #click_no_wait fixes and improvements. Closes http://jira.openqa.org/browse/WTR-320 and http://jira.openqa.org/browse/WTR-449 (Jarmo Pertman)
|
14
14
|
* #wait will raise a Timeout::Error if page hasn't been loaded within 5 minutes. Closes http://jira.openqa.org/browse/WTR-452 (Bret)
|
15
15
|
* Fixed a problem when #wait blocked forever. Closes http://jira.openqa.org/browse/WTR-446 (Jarmo Pertman)
|
16
16
|
|
@@ -26,6 +26,12 @@
|
|
26
26
|
|
27
27
|
* Some rdoc cleanup (marekj)
|
28
28
|
* Removed Watir::Utils (Jarmo Pertman)
|
29
|
+
* It is now possible to execute unit-tests within gems with `rake test` (Jarmo Pertman)
|
30
|
+
* Don't output unnecessary information to stdout in FireWatir unit-tests (Željko Filipin)
|
31
|
+
|
32
|
+
|
33
|
+
Whole Changelog is available at http://github.com/bret/watir/compare/v1.6.5...v1.6.6
|
34
|
+
|
29
35
|
|
30
36
|
== Version 1.6.5
|
31
37
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.6.
|
1
|
+
1.6.6.rc2
|
data/lib/watir/core.rb
CHANGED
data/lib/watir/element.rb
CHANGED
@@ -232,13 +232,29 @@ module Watir
|
|
232
232
|
|
233
233
|
def click_no_wait
|
234
234
|
assert_enabled
|
235
|
-
|
236
235
|
highlight(:set)
|
237
236
|
element = "#{self.class}.new(#{@page_container.attach_command}, :unique_number, #{self.unique_number})"
|
238
|
-
|
237
|
+
ruby_code = "require 'rubygems';" <<
|
238
|
+
"require '#{File.expand_path(File.dirname(__FILE__))}/core';" <<
|
239
|
+
"#{element}.click!"
|
240
|
+
system(spawned_click_no_wait_command(ruby_code))
|
239
241
|
highlight(:clear)
|
240
242
|
end
|
241
243
|
|
244
|
+
def spawned_click_no_wait_command(command)
|
245
|
+
command = "-e #{command.inspect}"
|
246
|
+
unless $DEBUG
|
247
|
+
"start rubyw #{command}"
|
248
|
+
else
|
249
|
+
puts "#click_no_wait command:"
|
250
|
+
command = "ruby #{command}"
|
251
|
+
puts command
|
252
|
+
command
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
private :spawned_click_no_wait_command
|
257
|
+
|
242
258
|
def click!
|
243
259
|
assert_enabled
|
244
260
|
|
data/lib/watir/ie-class.rb
CHANGED
data/lib/watir/page-container.rb
CHANGED
@@ -48,26 +48,6 @@ module Watir
|
|
48
48
|
page.innertext.strip
|
49
49
|
end
|
50
50
|
|
51
|
-
def click_no_wait(element)
|
52
|
-
ruby_code = "require 'rubygems';" <<
|
53
|
-
"require '#{File.expand_path(File.dirname(__FILE__))}/core';" <<
|
54
|
-
"#{element}.click!"
|
55
|
-
system(spawned_click_no_wait_command(ruby_code))
|
56
|
-
end
|
57
|
-
|
58
|
-
def spawned_click_no_wait_command(command)
|
59
|
-
unless $DEBUG
|
60
|
-
"start rubyw -e #{command.inspect}"
|
61
|
-
else
|
62
|
-
puts "#click_no_wait command:"
|
63
|
-
command = "ruby -e #{command.inspect}"
|
64
|
-
puts command
|
65
|
-
command
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
private :spawned_click_no_wait_command
|
70
|
-
|
71
51
|
def set_container container
|
72
52
|
@container = container
|
73
53
|
@page_container = self
|
data/rakefile.rb
CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'rake/clean'
|
4
4
|
require 'rake/packagetask'
|
5
|
+
require 'rake/testtask'
|
5
6
|
require 'rake/rdoctask'
|
6
7
|
require 'rake/gempackagetask'
|
7
8
|
|
@@ -21,6 +22,11 @@ Rake::RDocTask.new('rdoc') do |rdoc|
|
|
21
22
|
rdoc.rdoc_files.exclude('lib/watir/camel_case.rb')
|
22
23
|
end
|
23
24
|
|
25
|
+
Rake::TestTask.new do |t|
|
26
|
+
t.test_files = FileList['unittests/core_tests.rb']
|
27
|
+
t.verbose = true
|
28
|
+
end
|
29
|
+
|
24
30
|
CLEAN << 'pkg' << 'rdoc'
|
25
31
|
|
26
32
|
task :default => :package
|
@@ -15,7 +15,7 @@ class ClickNoWait_Tests < Watir::TestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_spawned_click_no_wait_command
|
18
|
-
assert_equal("start rubyw -e \"some command\"", browser.
|
18
|
+
assert_equal("start rubyw -e \"some command\"", browser.link(:id => 'link1').send(:__spawned_click_no_wait_command, "some command"))
|
19
19
|
end
|
20
20
|
|
21
21
|
end
|
data/unittests/form_test.rb
CHANGED
@@ -36,12 +36,23 @@ class TC_Forms2 < Test::Unit::TestCase # Note: there is no TC_Forms1
|
|
36
36
|
assert_equal('Click Me', browser.form(:index, 1).button(:name, 'b1').value)
|
37
37
|
end
|
38
38
|
|
39
|
-
# The following tests form bug 2261
|
39
|
+
# The following tests form bug 2261
|
40
40
|
tag_method :test_form_outer_html, :fails_on_firefox
|
41
|
-
|
41
|
+
|
42
|
+
def test_form_outer_html
|
42
43
|
expected = "\r\n<FORM id=f2 name=test2 action=pass2.html method=get><BR><INPUT type=submit value=Submit> </FORM>"
|
43
|
-
|
44
|
+
actual = browser.form(:name, 'test2').html
|
45
|
+
|
46
|
+
# ignore attributes order by sorting them
|
47
|
+
sorted_expected, sorted_actual = [expected, actual].map! do |html|
|
48
|
+
html.strip.downcase.scan(%r{<form (.*)><br><(.*)> </form>}).flatten.
|
49
|
+
map {|part| part.split(" ").sort.join(" ")}.join("><br><")
|
50
|
+
end
|
51
|
+
assert_not_equal("", sorted_expected)
|
52
|
+
assert_not_equal("", sorted_actual)
|
53
|
+
assert_equal(sorted_expected, sorted_actual)
|
44
54
|
end
|
55
|
+
|
45
56
|
tag_method :test_form_inner_html, :fails_on_ie
|
46
57
|
def test_form_inner_html
|
47
58
|
expected = "\n<br><input value=\"Submit\" type=\"submit\">\n"
|
data/unittests/setup.rb
CHANGED
@@ -10,9 +10,11 @@ end
|
|
10
10
|
topdir = File.join(File.dirname(__FILE__), '..')
|
11
11
|
$firewatir_dev_lib = File.join(topdir, '..', 'firewatir', 'lib')
|
12
12
|
$watir_dev_lib = File.join(topdir, 'lib')
|
13
|
+
commonwatir_dir = "commonwatir-#{File.read("VERSION").strip}" rescue "commonwatir"
|
14
|
+
commonwatir_absolute_dir = File.join(topdir, '..', commonwatir_dir)
|
13
15
|
libs = []
|
14
|
-
libs << File.join(
|
15
|
-
libs <<
|
16
|
+
libs << File.join(commonwatir_absolute_dir, 'lib')
|
17
|
+
libs << commonwatir_absolute_dir # for the unit tests
|
16
18
|
libs.each { |lib| append_to_load_path(lib) }
|
17
19
|
|
18
20
|
require 'watir/browser'
|
@@ -31,15 +33,10 @@ Test Suites
|
|
31
33
|
* window_tests -- window intensive tests
|
32
34
|
=end
|
33
35
|
|
34
|
-
tiptopdir = File.join topdir, '..'
|
35
|
-
commondir = File.join topdir, '..', 'commonwatir'
|
36
|
-
append_to_load_path tiptopdir
|
37
36
|
$all_tests = []
|
38
|
-
Dir.
|
39
|
-
|
40
|
-
|
41
|
-
Dir.chdir tiptopdir do
|
42
|
-
$all_tests += Dir["commonwatir/unittests/*_test.rb"]
|
37
|
+
$all_tests += Dir["unittests/*_test.rb"]
|
38
|
+
Dir.chdir commonwatir_absolute_dir do
|
39
|
+
$all_tests += Dir["unittests/*_test.rb"]
|
43
40
|
end
|
44
41
|
|
45
42
|
# These tests won't load unless Watir is in the path
|
@@ -48,7 +45,7 @@ $watir_only_tests = [
|
|
48
45
|
"images_test.rb",
|
49
46
|
"dialog_test.rb",
|
50
47
|
"ie_test.rb"
|
51
|
-
].map {|file| "
|
48
|
+
].map {|file| "unittests/#{file}"}
|
52
49
|
|
53
50
|
if Watir::UnitTest.options[:browser] != 'ie'
|
54
51
|
$all_tests -= $watir_only_tests
|
@@ -69,12 +66,11 @@ end
|
|
69
66
|
'open_close',
|
70
67
|
'send_keys', # visible
|
71
68
|
=end
|
72
|
-
|
73
|
-
|
74
|
-
end
|
69
|
+
|
70
|
+
$window_tests = Dir["unittests/windows/*_test.rb"] - ["unittests/windows/ie-each_test.rb"]
|
75
71
|
|
76
72
|
# load development libs also in #click_no_wait processes
|
77
|
-
Watir::
|
73
|
+
Watir::Element.class_eval do
|
78
74
|
alias_method :__spawned_click_no_wait_command, :spawned_click_no_wait_command
|
79
75
|
|
80
76
|
def spawned_click_no_wait_command(command)
|
data/watir-rdoc.rb
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
$WATIR_RDOC_OPTIONS = [] <<
|
2
|
+
'--title' << 'Watir API Reference' <<
|
3
|
+
'--accessor' << 'def_wrap=R,def_wrap_guard=R,def_creator=R,def_creator_with_default=R' <<
|
4
|
+
'--main' << 'Watir::IE' <<
|
5
|
+
'--exclude' << 'unittests|camel_case.rb'
|
6
|
+
$WATIR_EXTRA_RDOC_FILES = ['lib/readme.rb', 'lib/changes.rb', 'lib/license.rb']
|
7
|
+
|
data/watir.gemspec
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'watir-rdoc'
|
2
|
+
|
3
|
+
$__watir_source_patterns = [
|
4
|
+
'CHANGES', 'rakefile.rb', 'VERSION', 'watir.gemspec', 'watir-rdoc.rb',
|
5
|
+
'lib/watir/*.rb', 'lib/watir/AutoItX3.dll',
|
6
|
+
'unittests/*.rb', 'unittests/html/*.html', 'unittests/html/images/*.*',
|
7
|
+
'unittests/other/*.rb', 'unittests/testcase/*.rb', 'unittests/windows/*.rb',
|
8
|
+
'lib/watir/IEDialog/Release/IEDialog.dll', 'lib/watir/win32ole/win32ole.so',
|
9
|
+
'lib/watir/contrib/*.rb'] +
|
10
|
+
$WATIR_EXTRA_RDOC_FILES
|
11
|
+
|
12
|
+
spec = Gem::Specification.new do |s|
|
13
|
+
version = File.read("VERSION").strip rescue "0.0.0"
|
14
|
+
s.name = 'watir'
|
15
|
+
s.version = version
|
16
|
+
s.summary = 'Automated testing tool for web applications.'
|
17
|
+
s.description = <<-EOF
|
18
|
+
WATIR is "Web Application Testing in Ruby". Watir (pronounced water) is a free,
|
19
|
+
open-source functional testing tool for automating browser-based tests of web applications.
|
20
|
+
It works with applications written in any language.
|
21
|
+
Watir drives the Internet Explorer browser the same way an end user would.
|
22
|
+
It clicks links, fills in forms, presses buttons.
|
23
|
+
Watir also checks results, such as whether expected text appears on the
|
24
|
+
page, or whether a control is enabled.
|
25
|
+
Watir can test web applications written in any language.
|
26
|
+
Watir is a Ruby library that works with Internet Explorer on Windows.
|
27
|
+
EOF
|
28
|
+
s.author = 'Bret Pettichord'
|
29
|
+
s.email = 'watir-general@groups.google.com'
|
30
|
+
s.rubyforge_project = 'Watir'
|
31
|
+
s.homepage = 'http://www.watir.com/'
|
32
|
+
|
33
|
+
s.platform = Gem::Platform::RUBY
|
34
|
+
s.requirements << 'Microsoft Windows running Internet Explorer 5.5 or later.'
|
35
|
+
s.require_path = 'lib'
|
36
|
+
|
37
|
+
s.add_dependency 'win32-process', '>= 0.5.5'
|
38
|
+
s.add_dependency 'windows-pr', '>= 0.6.6'
|
39
|
+
s.add_dependency 'commonwatir', '= ' + version
|
40
|
+
s.add_dependency 'firewatir', '= ' + version
|
41
|
+
s.add_dependency 'nokogiri'
|
42
|
+
|
43
|
+
s.has_rdoc = true
|
44
|
+
s.rdoc_options += $WATIR_RDOC_OPTIONS
|
45
|
+
s.executables << 'watir-console'
|
46
|
+
|
47
|
+
# s.test_file = 'unittests/core_tests.rb'
|
48
|
+
|
49
|
+
s.files = $__watir_source_patterns.inject([]) { |list, glob|
|
50
|
+
list << Dir[glob].delete_if { |path|
|
51
|
+
File.directory?(path) or
|
52
|
+
path.include?('CVS')
|
53
|
+
}
|
54
|
+
}.flatten
|
55
|
+
|
56
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 977940599
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 6
|
9
9
|
- 6
|
10
|
-
-
|
11
|
-
version: 1.6.6.
|
10
|
+
- rc2
|
11
|
+
version: 1.6.6.rc2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Bret Pettichord
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-09-
|
19
|
+
date: 2010-09-30 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -59,13 +59,13 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
hash:
|
62
|
+
hash: 977940599
|
63
63
|
segments:
|
64
64
|
- 1
|
65
65
|
- 6
|
66
66
|
- 6
|
67
|
-
-
|
68
|
-
version: 1.6.6.
|
67
|
+
- rc2
|
68
|
+
version: 1.6.6.rc2
|
69
69
|
type: :runtime
|
70
70
|
version_requirements: *id003
|
71
71
|
- !ruby/object:Gem::Dependency
|
@@ -76,13 +76,13 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - "="
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
hash:
|
79
|
+
hash: 977940599
|
80
80
|
segments:
|
81
81
|
- 1
|
82
82
|
- 6
|
83
83
|
- 6
|
84
|
-
-
|
85
|
-
version: 1.6.6.
|
84
|
+
- rc2
|
85
|
+
version: 1.6.6.rc2
|
86
86
|
type: :runtime
|
87
87
|
version_requirements: *id004
|
88
88
|
- !ruby/object:Gem::Dependency
|
@@ -111,6 +111,8 @@ files:
|
|
111
111
|
- CHANGES
|
112
112
|
- rakefile.rb
|
113
113
|
- VERSION
|
114
|
+
- watir.gemspec
|
115
|
+
- watir-rdoc.rb
|
114
116
|
- lib/watir/camel_case.rb
|
115
117
|
- lib/watir/clickJSDialog.rb
|
116
118
|
- lib/watir/close_all.rb
|