diff --git a/.project b/.project
index b401d3fe..d7922141 100644
--- a/.project
+++ b/.project
@@ -1,17 +1,17 @@
-
-
- watir-all
-
-
-
-
-
- org.rubypeople.rdt.core.rubybuilder
-
-
-
-
-
- org.rubypeople.rdt.core.rubynature
-
-
+
+
+ watir-all
+
+
+
+
+
+ org.rubypeople.rdt.core.rubybuilder
+
+
+
+
+
+ org.rubypeople.rdt.core.rubynature
+
+
diff --git a/Rakefile b/Rakefile
index 8217f356..2228914e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,86 +1,86 @@
-require 'rubygems'
-require 'rake/clean'
-require 'ftools'
-require 'fileutils'
-require 'rake/testtask'
-gem 'ci_reporter'
-require 'ci/reporter/rake/test_unit'
-projects = ['watir', 'firewatir', 'commonwatir']
-
-desc "Generate all the Watir gems"
-task :gems do
- projects.each do |x|
- Dir.chdir(x) {puts `rake.bat gem`}
- end
- FileUtils.makedirs 'gems'
- gems = Dir['*/pkg/*.gem']
- gems.each {|gem| FileUtils.install gem, 'gems'}
-end
-
-desc "Clean all the projects"
-task :clean_subprojects do
- projects.each do |x|
- Dir.chdir(x) {puts `rake.bat clean`}
- end
-end
-
-task :clean => [:clean_subprojects]
-CLEAN << 'gems/*'
-
-desc 'Run core_tests tests for IE'
-Rake::TestTask.new :core_tests do |t|
- t.test_files = FileList['watir/unittests/core_tests.rb']
- t.verbose = true
-end
-
-desc 'Run mozilla_all_tests for FireFox'
-Rake::TestTask.new :mozilla_all_tests do |t|
- t.test_files = FileList['firewatir/unittests/mozilla_all_tests.rb']
- t.verbose = true
-end
-
-namespace :cruise do
- def move_reports(report_dir)
- Dir[report_dir].each { |e| File::move(e, ENV['CC_BUILD_ARTIFACTS']) }
- File::copy("transform-results.xsl", ENV['CC_BUILD_ARTIFACTS'])
- add_style_sheet_to_reports(ENV['CC_BUILD_ARTIFACTS'] + '/*.xml')
- end
-
- def add_style_sheet_to_reports(report_dir)
- dir_arr = Dir[report_dir]
- return if dir_arr.empty?
- dir_arr.each do |f|
- sContent = File.readlines(f, '\n')
- sContent.each do |line|
- line.sub!(/<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>/, "\n")
- end
- File.open(f, "w+") { |file| file.puts sContent }
- end
- end
-
- task :move_reports_ie do
- move_reports "watir/test/reports/*.xml"
- end
- task :move_reports_ff do
- move_reports "firewatir/test/reports/*.xml"
- end
-
- task :ie_core_tests => ['ci:setup:testunit', :core_tests, :move_reports_ie]
- task :ff_mozilla_all_tests => ['ci:setup:testunit', :mozilla_all_tests, :move_reports_ff]
-end
-
-desc 'Build the html for the website (wtr.rubyforge.org)'
-task :website do
- Dir.chdir 'doc' do
- puts system('call webgen -V 1')
- end
-end
-
-desc 'Build and publish the html for the website at wtr.rubyforge.org'
-task :publish_website => [:website] do
- user = 'bret' # userid on rubyforge
- puts system("call pscp -v -r doc\\output\\*.* #{user}@rubyforge.org:/var/www/gforge-projects/wtr")
-end
-
-desc 'Run tests for all browser'
-task :test => [:test_ie, :test_ff]
+require 'rubygems'
+require 'rake/clean'
+require 'ftools'
+require 'fileutils'
+require 'rake/testtask'
+gem 'ci_reporter'
+require 'ci/reporter/rake/test_unit'
+projects = ['watir', 'firewatir', 'commonwatir']
+
+desc "Generate all the Watir gems"
+task :gems do
+ projects.each do |x|
+ Dir.chdir(x) {puts `rake.bat gem`}
+ end
+ FileUtils.makedirs 'gems'
+ gems = Dir['*/pkg/*.gem']
+ gems.each {|gem| FileUtils.install gem, 'gems'}
+end
+
+desc "Clean all the projects"
+task :clean_subprojects do
+ projects.each do |x|
+ Dir.chdir(x) {puts `rake.bat clean`}
+ end
+end
+
+task :clean => [:clean_subprojects]
+CLEAN << 'gems/*'
+
+desc 'Run core_tests tests for IE'
+Rake::TestTask.new :core_tests do |t|
+ t.test_files = FileList['watir/unittests/core_tests.rb']
+ t.verbose = true
+end
+
+desc 'Run mozilla_all_tests for FireFox'
+Rake::TestTask.new :mozilla_all_tests do |t|
+ t.test_files = FileList['firewatir/unittests/mozilla_all_tests.rb']
+ t.verbose = true
+end
+
+namespace :cruise do
+ def move_reports(report_dir)
+ Dir[report_dir].each { |e| File::move(e, ENV['CC_BUILD_ARTIFACTS']) }
+ File::copy("transform-results.xsl", ENV['CC_BUILD_ARTIFACTS'])
+ add_style_sheet_to_reports(ENV['CC_BUILD_ARTIFACTS'] + '/*.xml')
+ end
+
+ def add_style_sheet_to_reports(report_dir)
+ dir_arr = Dir[report_dir]
+ return if dir_arr.empty?
+ dir_arr.each do |f|
+ sContent = File.readlines(f, '\n')
+ sContent.each do |line|
+ line.sub!(/<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>/, "\n")
+ end
+ File.open(f, "w+") { |file| file.puts sContent }
+ end
+ end
+
+ task :move_reports_ie do
+ move_reports "watir/test/reports/*.xml"
+ end
+ task :move_reports_ff do
+ move_reports "firewatir/test/reports/*.xml"
+ end
+
+ task :ie_core_tests => ['ci:setup:testunit', :core_tests, :move_reports_ie]
+ task :ff_mozilla_all_tests => ['ci:setup:testunit', :mozilla_all_tests, :move_reports_ff]
+end
+
+desc 'Build the html for the website (wtr.rubyforge.org)'
+task :website do
+ Dir.chdir 'doc' do
+ puts system('call webgen -V 1')
+ end
+end
+
+desc 'Build and publish the html for the website at wtr.rubyforge.org'
+task :publish_website => [:website] do
+ user = 'bret' # userid on rubyforge
+ puts system("call pscp -v -r doc\\output\\*.* #{user}@rubyforge.org:/var/www/gforge-projects/wtr")
+end
+
+desc 'Run tests for all browser'
+task :test => [:test_ie, :test_ff]
diff --git a/commonwatir/.project b/commonwatir/.project
index 37696a7d..c41e41e7 100644
--- a/commonwatir/.project
+++ b/commonwatir/.project
@@ -1,17 +1,17 @@
-
-
- watir-common
-
-
-
-
-
- org.rubypeople.rdt.core.rubybuilder
-
-
-
-
-
- org.rubypeople.rdt.core.rubynature
-
-
+
+
+ watir-common
+
+
+
+
+
+ org.rubypeople.rdt.core.rubybuilder
+
+
+
+
+
+ org.rubypeople.rdt.core.rubynature
+
+
diff --git a/commonwatir/History.txt b/commonwatir/History.txt
index 94179b5f..04fd563d 100644
--- a/commonwatir/History.txt
+++ b/commonwatir/History.txt
@@ -1,5 +1,5 @@
-=== 0.0.1 / 2008-08-28
-
-* Created
-
-
+=== 0.0.1 / 2008-08-28
+
+* Created
+
+
diff --git a/commonwatir/Manifest.txt b/commonwatir/Manifest.txt
index 01ad32d6..2acad50b 100644
--- a/commonwatir/Manifest.txt
+++ b/commonwatir/Manifest.txt
@@ -1,14 +1,14 @@
-History.txt
-Manifest.txt
-README.txt
-Rakefile
-lib/watir.rb
-lib/commonwatir.rb
-lib/watir/assertions.rb
-lib/watir/browser.rb
-lib/watir/browsers.rb
-lib/watir/exceptions.rb
-lib/watir/matches.rb
-lib/watir/options.rb
-lib/watir/testcase.rb
-lib/watir/waiter.rb
+History.txt
+Manifest.txt
+README.txt
+Rakefile
+lib/watir.rb
+lib/commonwatir.rb
+lib/watir/assertions.rb
+lib/watir/browser.rb
+lib/watir/browsers.rb
+lib/watir/exceptions.rb
+lib/watir/matches.rb
+lib/watir/options.rb
+lib/watir/testcase.rb
+lib/watir/waiter.rb
diff --git a/commonwatir/README.txt b/commonwatir/README.txt
index a53a2c5d..3dfeffea 100644
--- a/commonwatir/README.txt
+++ b/commonwatir/README.txt
@@ -1,48 +1,48 @@
-= commonwatir
-
-* FIX (url)
-
-== DESCRIPTION:
-
-Common code used by Watir and FireWatir
-
-== FEATURES/PROBLEMS:
-
-* FIX (list of features or problems)
-
-== SYNOPSIS:
-
- FIX (code sample of usage)
-
-== REQUIREMENTS:
-
-* FIX (list of requirements)
-
-== INSTALL:
-
-* sudo gem install commonwatir
-
-== LICENSE:
-
-(The MIT License)
-
-Copyright (c) 2008 Bret Pettichord
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+= commonwatir
+
+* FIX (url)
+
+== DESCRIPTION:
+
+Common code used by Watir and FireWatir
+
+== FEATURES/PROBLEMS:
+
+* FIX (list of features or problems)
+
+== SYNOPSIS:
+
+ FIX (code sample of usage)
+
+== REQUIREMENTS:
+
+* FIX (list of requirements)
+
+== INSTALL:
+
+* sudo gem install commonwatir
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) 2008 Bret Pettichord
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/commonwatir/Rakefile b/commonwatir/Rakefile
index e25916a8..fde3b35e 100644
--- a/commonwatir/Rakefile
+++ b/commonwatir/Rakefile
@@ -1,9 +1,9 @@
-require 'rubygems'
-require 'hoe'
-require './lib/commonwatir.rb'
-
-Hoe.new('commonwatir', CommonWatir::VERSION) do |p|
- p.rubyforge_name = 'wtr'
- p.developer('Bret Pettichord', 'bret@watircraft.com')
- p.extra_deps << 'user-choices'
-end
+require 'rubygems'
+require 'hoe'
+require './lib/commonwatir.rb'
+
+Hoe.new('commonwatir', CommonWatir::VERSION) do |p|
+ p.rubyforge_name = 'wtr'
+ p.developer('Bret Pettichord', 'bret@watircraft.com')
+ p.extra_deps << 'user-choices'
+end
diff --git a/commonwatir/lib/commonwatir.rb b/commonwatir/lib/commonwatir.rb
index 08e69605..315095ae 100644
--- a/commonwatir/lib/commonwatir.rb
+++ b/commonwatir/lib/commonwatir.rb
@@ -1,3 +1,3 @@
-class CommonWatir
- VERSION = '1.6.2'
-end
+class CommonWatir
+ VERSION = '1.6.2'
+end
diff --git a/commonwatir/lib/watir.rb b/commonwatir/lib/watir.rb
index 96411e35..44222c16 100644
--- a/commonwatir/lib/watir.rb
+++ b/commonwatir/lib/watir.rb
@@ -1,6 +1,6 @@
-# The 'watir' library loads the common watir code, common to all watir
-# implementations. The 'watir/browser' library will autoload the actual
-# implementations.
-
-require 'watir/waiter'
-require 'watir/browser'
+# The 'watir' library loads the common watir code, common to all watir
+# implementations. The 'watir/browser' library will autoload the actual
+# implementations.
+
+require 'watir/waiter'
+require 'watir/browser'
diff --git a/commonwatir/lib/watir/assertions.rb b/commonwatir/lib/watir/assertions.rb
index 19c40746..0cba368c 100644
--- a/commonwatir/lib/watir/assertions.rb
+++ b/commonwatir/lib/watir/assertions.rb
@@ -1,44 +1,44 @@
-require 'test/unit/assertions'
-
-module Watir
- # Verification methods
- module Assertions
- include Test::Unit::Assertions
-
- # Log a failure if the boolean is true. The message is the failure
- # message logged.
- # Whether true or false, the assertion count is incremented.
- def verify boolean, message = 'verify failed.'
- add_assertion
- add_failure message.to_s, caller unless boolean
- end
-
- def verify_equal expected, actual, message=nil
- full_message = build_message(message, < expected but was
->.
-EOT
- verify(expected == actual, full_message)
- end
- def verify_match pattern, string, message=nil
- pattern = case(pattern)
- when String
- Regexp.new(Regexp.escape(pattern))
- else
- pattern
- end
- full_message = build_message(message, "> expected to be =~\n>.", string, pattern)
- verify(string =~ pattern, full_message)
- end
-
- end
-
-end
-module Test::Unit::Assertions
- def assert_false(boolean, message=nil)
- _wrap_assertion do
- assert_block("assert should not be called with a block.") { !block_given? }
- assert_block(build_message(message, "> is not false.", boolean)) { !boolean }
- end
- end
-end
+require 'test/unit/assertions'
+
+module Watir
+ # Verification methods
+ module Assertions
+ include Test::Unit::Assertions
+
+ # Log a failure if the boolean is true. The message is the failure
+ # message logged.
+ # Whether true or false, the assertion count is incremented.
+ def verify boolean, message = 'verify failed.'
+ add_assertion
+ add_failure message.to_s, caller unless boolean
+ end
+
+ def verify_equal expected, actual, message=nil
+ full_message = build_message(message, < expected but was
+>.
+EOT
+ verify(expected == actual, full_message)
+ end
+ def verify_match pattern, string, message=nil
+ pattern = case(pattern)
+ when String
+ Regexp.new(Regexp.escape(pattern))
+ else
+ pattern
+ end
+ full_message = build_message(message, "> expected to be =~\n>.", string, pattern)
+ verify(string =~ pattern, full_message)
+ end
+
+ end
+
+end
+module Test::Unit::Assertions
+ def assert_false(boolean, message=nil)
+ _wrap_assertion do
+ assert_block("assert should not be called with a block.") { !block_given? }
+ assert_block(build_message(message, "> is not false.", boolean)) { !boolean }
+ end
+ end
+end
diff --git a/commonwatir/lib/watir/browser.rb b/commonwatir/lib/watir/browser.rb
index 654a553e..ffa61524 100644
--- a/commonwatir/lib/watir/browser.rb
+++ b/commonwatir/lib/watir/browser.rb
@@ -1,149 +1,149 @@
-# watir/browser
-require 'watir/options'
-module Watir
-
-=begin rdoc
-
-Watir is a family of open-source drivers for automating web browsers. You
-can use it to write tests that are easy to read and maintain.
-
-Watir drives browsers the same way people do. It clicks links, fills in forms,
-presses buttons. Watir also checks results, such as whether expected text
-appears on a page.
-
-The Watir family currently includes support for Internet Explorer (on Windows),
-Firefox (on Windows, Mac and Linux) and Safari (on Mac).
-
-Project Homepage: http://wtr.rubyforge.org
-
-This Browser module provides a generic interface
-that tests can use to access any browser. The actual browser (and thus
-the actual Watir driver) is determined at runtime based on configuration
-settings.
-
- require 'watir'
- browser = Watir::Browser.new
- browser.goto 'http://google.com'
- browser.text_field(:name, 'q').set 'pickaxe'
- browser.button(:name, 'btnG').click
- if browser.text.include? 'Programming Ruby'
- puts 'Text was found'
- else
- puts 'Text was not found'
- end
-
-A comprehensive summary of the Watir API can be found here
-http://wiki.openqa.org/display/WTR/Methods+supported+by+Element
-
-There are two ways to configure the browser that will be used by your tests.
-
-One is to set the +watir_browser+ environment variable to +ie+ or +firefox+.
-(How you do this depends on your platform.)
-
-The other is to create a file that looks like this.
-
- browser: ie
-
-And then to add this line to your script, after the require statement and
-before you invoke Browser.new.
-
- Watir.options_file = 'path/to/the/file/you/just/created'
-
-=end rdoc
-
- module Browser
- @@browser_classes = {}
- @@sub_options = {}
- @@default = nil
- class << self
-
- # Create a new instance of a browser driver, as determined by the
- # configuration settings. (Don't be fooled: this is not actually
- # an instance of Browser class.)
- def new
- set_sub_options
- klass.new
- end
- # Create a new instance as with #new and start the browser on the
- # specified url.
- def start url
- set_sub_options
- klass.start url
- end
- # Attach to an existing browser.
- def attach(how, what)
- set_sub_options
- klass.attach(how, what)
- end
- def set_options options
- return unless defined?(klass.set_options)
- klass.set_options options
- end
- def options
- return {} unless defined?(klass.options)
- klass.options
- end
-
- def klass
- key = Watir.options[:browser]
- eval @@browser_classes[key] # this triggers the autoload
- end
- private :klass
- # Add support for the browser option, using the specified class,
- # provided as a string. Optionally, additional options supported by
- # the class can be specified as an array of symbols. Options specified
- # by the user and included in this list will be passed (as a hash) to
- # the set_options class method (if defined) before creating an instance.
- def support hash_args
- option = hash_args[:name]
- class_string = hash_args[:class]
- additional_options = hash_args[:options]
- library = hash_args[:library]
- gem = hash_args[:gem] || library
-
- @@browser_classes[option] = class_string
- @@sub_options[option] = additional_options
-
- autoload class_string, library
- activate_gem gem, option
- end
-
- def default
- @@default
- end
- # Specifies a default browser. Must be specified before options are parsed.
- def default= option
- @@default = option
- end
- # Returns the names of the browsers that are supported by this module.
- # These are the options for 'watir_browser' (env var) or 'browser:' (yaml).
- def browser_names
- @@browser_classes.keys
- end
-
- private
- def autoload class_string, library
- mod, klass = class_string.split('::')
- eval "module ::#{mod}; autoload :#{klass}, '#{library}'; end"
- end
- # Activate the gem (if installed). The default browser will be set
- # to the first gem that activates.
- def activate_gem gem_name, option
- begin
- gem gem_name
- @@default ||= option
- rescue Gem::LoadError
- end
- end
- def set_sub_options
- sub_options = @@sub_options[Watir.options[:browser]]
- return if sub_options.nil?
- specified_options = Watir.options.reject {|k, v| !sub_options.include? k}
- self.set_options specified_options
- end
- end
- end
-
-end
-
-require 'watir/browsers'
+# watir/browser
+require 'watir/options'
+module Watir
+
+=begin rdoc
+
+Watir is a family of open-source drivers for automating web browsers. You
+can use it to write tests that are easy to read and maintain.
+
+Watir drives browsers the same way people do. It clicks links, fills in forms,
+presses buttons. Watir also checks results, such as whether expected text
+appears on a page.
+
+The Watir family currently includes support for Internet Explorer (on Windows),
+Firefox (on Windows, Mac and Linux) and Safari (on Mac).
+
+Project Homepage: http://wtr.rubyforge.org
+
+This Browser module provides a generic interface
+that tests can use to access any browser. The actual browser (and thus
+the actual Watir driver) is determined at runtime based on configuration
+settings.
+
+ require 'watir'
+ browser = Watir::Browser.new
+ browser.goto 'http://google.com'
+ browser.text_field(:name, 'q').set 'pickaxe'
+ browser.button(:name, 'btnG').click
+ if browser.text.include? 'Programming Ruby'
+ puts 'Text was found'
+ else
+ puts 'Text was not found'
+ end
+
+A comprehensive summary of the Watir API can be found here
+http://wiki.openqa.org/display/WTR/Methods+supported+by+Element
+
+There are two ways to configure the browser that will be used by your tests.
+
+One is to set the +watir_browser+ environment variable to +ie+ or +firefox+.
+(How you do this depends on your platform.)
+
+The other is to create a file that looks like this.
+
+ browser: ie
+
+And then to add this line to your script, after the require statement and
+before you invoke Browser.new.
+
+ Watir.options_file = 'path/to/the/file/you/just/created'
+
+=end rdoc
+
+ module Browser
+ @@browser_classes = {}
+ @@sub_options = {}
+ @@default = nil
+ class << self
+
+ # Create a new instance of a browser driver, as determined by the
+ # configuration settings. (Don't be fooled: this is not actually
+ # an instance of Browser class.)
+ def new
+ set_sub_options
+ klass.new
+ end
+ # Create a new instance as with #new and start the browser on the
+ # specified url.
+ def start url
+ set_sub_options
+ klass.start url
+ end
+ # Attach to an existing browser.
+ def attach(how, what)
+ set_sub_options
+ klass.attach(how, what)
+ end
+ def set_options options
+ return unless defined?(klass.set_options)
+ klass.set_options options
+ end
+ def options
+ return {} unless defined?(klass.options)
+ klass.options
+ end
+
+ def klass
+ key = Watir.options[:browser]
+ eval @@browser_classes[key] # this triggers the autoload
+ end
+ private :klass
+ # Add support for the browser option, using the specified class,
+ # provided as a string. Optionally, additional options supported by
+ # the class can be specified as an array of symbols. Options specified
+ # by the user and included in this list will be passed (as a hash) to
+ # the set_options class method (if defined) before creating an instance.
+ def support hash_args
+ option = hash_args[:name]
+ class_string = hash_args[:class]
+ additional_options = hash_args[:options]
+ library = hash_args[:library]
+ gem = hash_args[:gem] || library
+
+ @@browser_classes[option] = class_string
+ @@sub_options[option] = additional_options
+
+ autoload class_string, library
+ activate_gem gem, option
+ end
+
+ def default
+ @@default
+ end
+ # Specifies a default browser. Must be specified before options are parsed.
+ def default= option
+ @@default = option
+ end
+ # Returns the names of the browsers that are supported by this module.
+ # These are the options for 'watir_browser' (env var) or 'browser:' (yaml).
+ def browser_names
+ @@browser_classes.keys
+ end
+
+ private
+ def autoload class_string, library
+ mod, klass = class_string.split('::')
+ eval "module ::#{mod}; autoload :#{klass}, '#{library}'; end"
+ end
+ # Activate the gem (if installed). The default browser will be set
+ # to the first gem that activates.
+ def activate_gem gem_name, option
+ begin
+ gem gem_name
+ @@default ||= option
+ rescue Gem::LoadError
+ end
+ end
+ def set_sub_options
+ sub_options = @@sub_options[Watir.options[:browser]]
+ return if sub_options.nil?
+ specified_options = Watir.options.reject {|k, v| !sub_options.include? k}
+ self.set_options specified_options
+ end
+ end
+ end
+
+end
+
+require 'watir/browsers'
diff --git a/commonwatir/lib/watir/browsers.rb b/commonwatir/lib/watir/browsers.rb
index f2d9a193..d5e03aee 100644
--- a/commonwatir/lib/watir/browsers.rb
+++ b/commonwatir/lib/watir/browsers.rb
@@ -1,12 +1,12 @@
-# watir/browsers
-# Define browsers supported by Watir
-
-Watir::Browser.support :name => 'ie', :class => 'Watir::IE',
- :library => 'watir/ie', :gem => 'watir',
- :options => [:speed, :visible]
-
-Watir::Browser.support :name => 'firefox', :class => 'FireWatir::Firefox',
- :library => 'firewatir'
-
-Watir::Browser.support :name => 'safari', :class => 'Watir::Safari',
- :library => 'safariwatir'
+# watir/browsers
+# Define browsers supported by Watir
+
+Watir::Browser.support :name => 'ie', :class => 'Watir::IE',
+ :library => 'watir/ie', :gem => 'watir',
+ :options => [:speed, :visible]
+
+Watir::Browser.support :name => 'firefox', :class => 'FireWatir::Firefox',
+ :library => 'firewatir'
+
+Watir::Browser.support :name => 'safari', :class => 'Watir::Safari',
+ :library => 'safariwatir'
diff --git a/commonwatir/lib/watir/matches.rb b/commonwatir/lib/watir/matches.rb
index 7903743f..b839eb4f 100644
--- a/commonwatir/lib/watir/matches.rb
+++ b/commonwatir/lib/watir/matches.rb
@@ -1,17 +1,17 @@
-class String
- def matches(x)
- return self == x
- end
-end
-
-class Regexp
- def matches(x)
- return self.match(x)
- end
-end
-
-class Integer
- def matches(x)
- return self == x
- end
-end
+class String
+ def matches(x)
+ return self == x
+ end
+end
+
+class Regexp
+ def matches(x)
+ return self.match(x)
+ end
+end
+
+class Integer
+ def matches(x)
+ return self == x
+ end
+end
diff --git a/commonwatir/lib/watir/options.rb b/commonwatir/lib/watir/options.rb
index 113b09d8..d8b466f4 100644
--- a/commonwatir/lib/watir/options.rb
+++ b/commonwatir/lib/watir/options.rb
@@ -1,52 +1,52 @@
-# watir/options
-require 'rubygems'
-
-require 'user-choices'
-
-module Watir
- @@options_file = nil
- @@options = nil
- class << self
- # Specify the location of a yaml file containing Watir options. Must be
- # specified before the options are parsed.
- def options_file= file
- @@options_file = file
- end
- def options_file
- @@options_file
- end
- def options= x
- @@options = x
- end
- # Return the Watir options, as a hash. If they haven't been parsed yet,
- # they will be now.
- def options
- @@options ||= Watir::Options.new.execute
- end
- end
-
- class Options < UserChoices::Command
- include UserChoices
- def add_sources builder
- builder.add_source EnvironmentSource, :with_prefix, 'watir_'
- if Watir.options_file
- builder.add_source YamlConfigFileSource, :from_complete_path,
- Watir.options_file
- end
- end
- def add_choices builder
- builder.add_choice :browser,
- :type => Watir::Browser.browser_names,
- :default => Watir::Browser.default
- builder.add_choice :speed,
- :type => ['slow', 'fast', 'zippy'],
- :default => 'fast'
- builder.add_choice :visible,
- :type => :boolean
- end
- def execute
- @user_choices[:speed] = @user_choices[:speed].to_sym
- @user_choices
- end
- end
-end
+# watir/options
+require 'rubygems'
+
+require 'user-choices'
+
+module Watir
+ @@options_file = nil
+ @@options = nil
+ class << self
+ # Specify the location of a yaml file containing Watir options. Must be
+ # specified before the options are parsed.
+ def options_file= file
+ @@options_file = file
+ end
+ def options_file
+ @@options_file
+ end
+ def options= x
+ @@options = x
+ end
+ # Return the Watir options, as a hash. If they haven't been parsed yet,
+ # they will be now.
+ def options
+ @@options ||= Watir::Options.new.execute
+ end
+ end
+
+ class Options < UserChoices::Command
+ include UserChoices
+ def add_sources builder
+ builder.add_source EnvironmentSource, :with_prefix, 'watir_'
+ if Watir.options_file
+ builder.add_source YamlConfigFileSource, :from_complete_path,
+ Watir.options_file
+ end
+ end
+ def add_choices builder
+ builder.add_choice :browser,
+ :type => Watir::Browser.browser_names,
+ :default => Watir::Browser.default
+ builder.add_choice :speed,
+ :type => ['slow', 'fast', 'zippy'],
+ :default => 'fast'
+ builder.add_choice :visible,
+ :type => :boolean
+ end
+ def execute
+ @user_choices[:speed] = @user_choices[:speed].to_sym
+ @user_choices
+ end
+ end
+end
diff --git a/commonwatir/lib/watir/testcase.rb b/commonwatir/lib/watir/testcase.rb
index e622bf1d..f1c0c389 100644
--- a/commonwatir/lib/watir/testcase.rb
+++ b/commonwatir/lib/watir/testcase.rb
@@ -1,58 +1,58 @@
-require 'test/unit'
-require 'watir/assertions'
-
-module Watir
-
- class TestCase < Test::Unit::TestCase
- include Watir::Assertions
- @@order = :sequentially
- def initialize name
- throw :invalid_test if name == :default_test && self.class == Watir::TestCase
- super
- end
- class << self
- attr_accessor :test_methods, :order
- def test_methods
- @test_methods ||= []
- end
- def order
- @order || @@order
- end
- def default_order= order
- @@order = order
- end
- def sorted_test_methods
- case order
- when :alphabetically then test_methods.sort
- when :sequentially then test_methods
- when :reversed_sequentially then test_methods.reverse
- when :reversed_alphabetically then test_methods.sort.reverse
- else raise ArgumentError, "Execute option not supported: #{@order}"
- end
- end
- def suite
- suite = Test::Unit::TestSuite.new(name)
- sorted_test_methods.each do |test|
- catch :invalid_test do
- suite << new(test)
- end
- end
- if (suite.empty?)
- catch :invalid_test do
- suite << new(:default_test)
- end
- end
- return suite
- end
- def method_added id
- name = id.id2name
- test_methods << name if name =~ /^test./
- end
- def execute order
- @order = order
- end
- end
- public :add_assertion
- end
-
-end
+require 'test/unit'
+require 'watir/assertions'
+
+module Watir
+
+ class TestCase < Test::Unit::TestCase
+ include Watir::Assertions
+ @@order = :sequentially
+ def initialize name
+ throw :invalid_test if name == :default_test && self.class == Watir::TestCase
+ super
+ end
+ class << self
+ attr_accessor :test_methods, :order
+ def test_methods
+ @test_methods ||= []
+ end
+ def order
+ @order || @@order
+ end
+ def default_order= order
+ @@order = order
+ end
+ def sorted_test_methods
+ case order
+ when :alphabetically then test_methods.sort
+ when :sequentially then test_methods
+ when :reversed_sequentially then test_methods.reverse
+ when :reversed_alphabetically then test_methods.sort.reverse
+ else raise ArgumentError, "Execute option not supported: #{@order}"
+ end
+ end
+ def suite
+ suite = Test::Unit::TestSuite.new(name)
+ sorted_test_methods.each do |test|
+ catch :invalid_test do
+ suite << new(test)
+ end
+ end
+ if (suite.empty?)
+ catch :invalid_test do
+ suite << new(:default_test)
+ end
+ end
+ return suite
+ end
+ def method_added id
+ name = id.id2name
+ test_methods << name if name =~ /^test./
+ end
+ def execute order
+ @order = order
+ end
+ end
+ public :add_assertion
+ end
+
+end
diff --git a/commonwatir/lib/watir/waiter.rb b/commonwatir/lib/watir/waiter.rb
index 9e2a48fb..99e26021 100644
--- a/commonwatir/lib/watir/waiter.rb
+++ b/commonwatir/lib/watir/waiter.rb
@@ -1,92 +1,92 @@
-require 'watir/exceptions'
-
-module Watir
-
- def wait_until(*args)
- Waiter.wait_until(*args) {yield}
- end
-
-class TimeKeeper
- attr_reader :sleep_time
- def initialize
- @sleep_time = 0.0
- end
- def sleep seconds
- @sleep_time += Kernel.sleep seconds
- end
- def now
- Time.now
- end
-end
-
-class Waiter
- # This is an interface to a TimeKeeper which proxies
- # calls to "sleep" and "Time.now".
- # Useful for unit testing Waiter.
- attr_accessor :timer
-
- # How long to wait between each iteration through the wait_until
- # loop. In seconds.
- attr_accessor :polling_interval
-
- # Timeout for wait_until.
- attr_accessor :timeout
-
- @@default_polling_interval = 0.5
- @@default_timeout = 60.0
-
- def initialize(timeout=@@default_timeout,
- polling_interval=@@default_polling_interval)
- @timeout = timeout
- @polling_interval = polling_interval
- @timer = TimeKeeper.new
- end
-
- # Execute the provided block until either (1) it returns true, or
- # (2) the timeout (in seconds) has been reached. If the timeout is reached,
- # a TimeOutException will be raised. The block will always
- # execute at least once.
- #
- # waiter = Waiter.new(5)
- # waiter.wait_until {puts 'hello'}
- #
- # This code will print out "hello" for five seconds, and then raise a
- # Watir::TimeOutException.
- def wait_until # block
- start_time = now
- until yield do
- if (duration = now - start_time) > @timeout
- raise Watir::Exception::TimeOutException.new(duration, @timeout),
- "Timed out after #{duration} seconds."
- end
- sleep @polling_interval
- end
- end
-
- # Execute the provided block until either (1) it returns true, or
- # (2) the timeout (in seconds) has been reached. If the timeout is reached,
- # a TimeOutException will be raised. The block will always
- # execute at least once.
- #
- # Waiter.wait_until(5) {puts 'hello'}
- #
- # This code will print out "hello" for five seconds, and then raise a
- # Watir::TimeOutException.
-
- # IDEA: wait_until: remove defaults from Waiter.wait_until
- def self.wait_until(timeout=@@default_timeout,
- polling_interval=@@default_polling_interval)
- waiter = new(timeout, polling_interval)
- waiter.wait_until { yield }
- end
-
- private
- def sleep seconds
- @timer.sleep seconds
- end
- def now
- @timer.now
- end
-end
-
+require 'watir/exceptions'
+
+module Watir
+
+ def wait_until(*args)
+ Waiter.wait_until(*args) {yield}
+ end
+
+class TimeKeeper
+ attr_reader :sleep_time
+ def initialize
+ @sleep_time = 0.0
+ end
+ def sleep seconds
+ @sleep_time += Kernel.sleep seconds
+ end
+ def now
+ Time.now
+ end
+end
+
+class Waiter
+ # This is an interface to a TimeKeeper which proxies
+ # calls to "sleep" and "Time.now".
+ # Useful for unit testing Waiter.
+ attr_accessor :timer
+
+ # How long to wait between each iteration through the wait_until
+ # loop. In seconds.
+ attr_accessor :polling_interval
+
+ # Timeout for wait_until.
+ attr_accessor :timeout
+
+ @@default_polling_interval = 0.5
+ @@default_timeout = 60.0
+
+ def initialize(timeout=@@default_timeout,
+ polling_interval=@@default_polling_interval)
+ @timeout = timeout
+ @polling_interval = polling_interval
+ @timer = TimeKeeper.new
+ end
+
+ # Execute the provided block until either (1) it returns true, or
+ # (2) the timeout (in seconds) has been reached. If the timeout is reached,
+ # a TimeOutException will be raised. The block will always
+ # execute at least once.
+ #
+ # waiter = Waiter.new(5)
+ # waiter.wait_until {puts 'hello'}
+ #
+ # This code will print out "hello" for five seconds, and then raise a
+ # Watir::TimeOutException.
+ def wait_until # block
+ start_time = now
+ until yield do
+ if (duration = now - start_time) > @timeout
+ raise Watir::Exception::TimeOutException.new(duration, @timeout),
+ "Timed out after #{duration} seconds."
+ end
+ sleep @polling_interval
+ end
+ end
+
+ # Execute the provided block until either (1) it returns true, or
+ # (2) the timeout (in seconds) has been reached. If the timeout is reached,
+ # a TimeOutException will be raised. The block will always
+ # execute at least once.
+ #
+ # Waiter.wait_until(5) {puts 'hello'}
+ #
+ # This code will print out "hello" for five seconds, and then raise a
+ # Watir::TimeOutException.
+
+ # IDEA: wait_until: remove defaults from Waiter.wait_until
+ def self.wait_until(timeout=@@default_timeout,
+ polling_interval=@@default_polling_interval)
+ waiter = new(timeout, polling_interval)
+ waiter.wait_until { yield }
+ end
+
+ private
+ def sleep seconds
+ @timer.sleep seconds
+ end
+ def now
+ @timer.now
+ end
+end
+
end # module
\ No newline at end of file
diff --git a/commonwatir/unittests/attach_to_existing_window_test.rb b/commonwatir/unittests/attach_to_existing_window_test.rb
index 1abb1ef0..d4123354 100644
--- a/commonwatir/unittests/attach_to_existing_window_test.rb
+++ b/commonwatir/unittests/attach_to_existing_window_test.rb
@@ -1,71 +1,71 @@
-# feature tests for attaching to existing IE windows
-# revision: $Revision: 1417 $
-
-$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
-require 'unittests/setup'
-
-class TC_ExistingWindow < Test::Unit::TestCase
- location __FILE__
- include Watir
-
- def setup
- @original_timeout = Browser.options[:attach_timeout]
- @browsers = []
- uses_page "pass.html"
- end
-
- def teardown
- Browser.set_options :attach_timeout => @original_timeout
- @browsers.each {|x| x.close}
- end
-
- def test_missing_window
- Browser.set_options :attach_timeout => 0.1
- assert_raises(NoMatchingWindowFoundException) { Browser.attach(:title, "missing") }
- assert_raises(NoMatchingWindowFoundException) { Browser.attach(:title, /missing/) }
- assert_raises(NoMatchingWindowFoundException) { Browser.attach(:url, "missing") }
- assert_raises(NoMatchingWindowFoundException) { Browser.attach(:url, /missing/) }
- end
-
- # Open a few browsers so that the test has a few windows to choose
- # from. The test harness has already opened a window that we won't
- # use.
- def open_several_windows
- ["buttons1.html", "whitespace.html"].each do |file|
- @browsers << Browser.start(self.class.html_root + file)
- end
- end
-
- def test_existing_window
- open_several_windows
-
- b1 = Browser.attach(:title , /buttons/i)
- assert_equal("Test page for buttons", b1.title)
-
- b2 = Browser.attach(:title , "Test page for buttons")
- assert_equal("Test page for buttons", b2.title)
-
- b3 = Browser.attach(:url, /buttons1.html/)
- assert_equal("Test page for buttons", b3.title)
- end
-
- def test_title_and_url_are_correct_after_reload
- uses_page "whitespace.html"
- assert_equal 'Test page for whitespace', browser.title
- assert_match /whitespace.html/, browser.url
- browser.link(:text, 'Login').click
- assert_equal 'Pass Page', browser.title
- assert_match /pass.html/, browser.url
- end
-
- tag_method :test_working_back_and_forth, :fails_on_firefox
- def test_working_back_and_forth
- open_several_windows
- buttons = Browser.attach(:url, /buttons1.html/)
- whitespace = Browser.attach(:url, /whitespace.html/)
- assert_match /This button is a submit/, buttons.text
- whitespace.link(:text, 'Login').click
- assert_match /pass/i, whitespace.text
- end
-end
-
+# feature tests for attaching to existing IE windows
+# revision: $Revision: 1417 $
+
+$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
+require 'unittests/setup'
+
+class TC_ExistingWindow < Test::Unit::TestCase
+ location __FILE__
+ include Watir
+
+ def setup
+ @original_timeout = Browser.options[:attach_timeout]
+ @browsers = []
+ uses_page "pass.html"
+ end
+
+ def teardown
+ Browser.set_options :attach_timeout => @original_timeout
+ @browsers.each {|x| x.close}
+ end
+
+ def test_missing_window
+ Browser.set_options :attach_timeout => 0.1
+ assert_raises(NoMatchingWindowFoundException) { Browser.attach(:title, "missing") }
+ assert_raises(NoMatchingWindowFoundException) { Browser.attach(:title, /missing/) }
+ assert_raises(NoMatchingWindowFoundException) { Browser.attach(:url, "missing") }
+ assert_raises(NoMatchingWindowFoundException) { Browser.attach(:url, /missing/) }
+ end
+
+ # Open a few browsers so that the test has a few windows to choose
+ # from. The test harness has already opened a window that we won't
+ # use.
+ def open_several_windows
+ ["buttons1.html", "whitespace.html"].each do |file|
+ @browsers << Browser.start(self.class.html_root + file)
+ end
+ end
+
+ def test_existing_window
+ open_several_windows
+
+ b1 = Browser.attach(:title , /buttons/i)
+ assert_equal("Test page for buttons", b1.title)
+
+ b2 = Browser.attach(:title , "Test page for buttons")
+ assert_equal("Test page for buttons", b2.title)
+
+ b3 = Browser.attach(:url, /buttons1.html/)
+ assert_equal("Test page for buttons", b3.title)
+ end
+
+ def test_title_and_url_are_correct_after_reload
+ uses_page "whitespace.html"
+ assert_equal 'Test page for whitespace', browser.title
+ assert_match /whitespace.html/, browser.url
+ browser.link(:text, 'Login').click
+ assert_equal 'Pass Page', browser.title
+ assert_match /pass.html/, browser.url
+ end
+
+ tag_method :test_working_back_and_forth, :fails_on_firefox
+ def test_working_back_and_forth
+ open_several_windows
+ buttons = Browser.attach(:url, /buttons1.html/)
+ whitespace = Browser.attach(:url, /whitespace.html/)
+ assert_match /This button is a submit/, buttons.text
+ whitespace.link(:text, 'Login').click
+ assert_match /pass/i, whitespace.text
+ end
+end
+
diff --git a/commonwatir/unittests/form2_test.rb b/commonwatir/unittests/form2_test.rb
index 65b38717..e974cb26 100644
--- a/commonwatir/unittests/form2_test.rb
+++ b/commonwatir/unittests/form2_test.rb
@@ -1,22 +1,22 @@
-$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
-require 'unittests/setup'
-
-class TC_Form_Entertainment < Test::Unit::TestCase
- location __FILE__
- def setup
- uses_page "entertainment_com.html"
- end
- def test_bare_button
- assert_nothing_raised do
- browser.button(:src, Regexp.new('/images/button_continue.gif')).click
- end
- end
-
- # http://jira.openqa.org/browse/WTR-80
- tag_method :test_button_in_form, :fails_on_ie
- def test_button_in_form
- assert_nothing_raised do
- browser.form(:name, 'shipaddress').button(:src, Regexp.new('/images/button_continue.gif')).click
- end
- end
+$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
+require 'unittests/setup'
+
+class TC_Form_Entertainment < Test::Unit::TestCase
+ location __FILE__
+ def setup
+ uses_page "entertainment_com.html"
+ end
+ def test_bare_button
+ assert_nothing_raised do
+ browser.button(:src, Regexp.new('/images/button_continue.gif')).click
+ end
+ end
+
+ # http://jira.openqa.org/browse/WTR-80
+ tag_method :test_button_in_form, :fails_on_ie
+ def test_button_in_form
+ assert_nothing_raised do
+ browser.form(:name, 'shipaddress').button(:src, Regexp.new('/images/button_continue.gif')).click
+ end
+ end
end
\ No newline at end of file
diff --git a/commonwatir/unittests/html/buttons2.html b/commonwatir/unittests/html/buttons2.html
index aab37cf9..a74ff434 100644
--- a/commonwatir/unittests/html/buttons2.html
+++ b/commonwatir/unittests/html/buttons2.html
@@ -1,61 +1,61 @@
-
-
-
-Test page for buttons
-
-
-
-
-CVS Revision: $Revision: 1.0 $
-
-
-
-
-
-
-
-
The top button is for testing buttons with names
- The second button is used for testing disabled buttons
-
-
-
-
-
-
-
-
This button is a submit ( the others are buttons)
-
-
-
-
-
-
-
This button is an image. It should behave the same as a submit
-
-
-
-
-
-
-
-
The top button is for testing buttons with names
- The second button is used for testing disabled buttons
-