Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing more line endings...

  • Loading branch information...
commit 3edf44a641c2d137c5d3767173b1512e8a833f64 1 parent 97eb842
@bret bret authored
Showing with 1,819 additions and 1,819 deletions.
  1. +17 −17 .project
  2. +86 −86 Rakefile
  3. +17 −17 commonwatir/.project
  4. +5 −5 commonwatir/History.txt
  5. +14 −14 commonwatir/Manifest.txt
  6. +48 −48 commonwatir/README.txt
  7. +9 −9 commonwatir/Rakefile
  8. +3 −3 commonwatir/lib/commonwatir.rb
  9. +6 −6 commonwatir/lib/watir.rb
  10. +44 −44 commonwatir/lib/watir/assertions.rb
  11. +149 −149 commonwatir/lib/watir/browser.rb
  12. +12 −12 commonwatir/lib/watir/browsers.rb
  13. +17 −17 commonwatir/lib/watir/matches.rb
  14. +52 −52 commonwatir/lib/watir/options.rb
  15. +58 −58 commonwatir/lib/watir/testcase.rb
  16. +91 −91 commonwatir/lib/watir/waiter.rb
  17. +71 −71 commonwatir/unittests/attach_to_existing_window_test.rb
  18. +21 −21 commonwatir/unittests/form2_test.rb
  19. +61 −61 commonwatir/unittests/html/buttons2.html
  20. +612 −612 commonwatir/unittests/html/entertainment_com.html
  21. +9 −9 commonwatir/unittests/html/pass.html
  22. +90 −90 commonwatir/unittests/html/visibility.html
  23. +28 −28 commonwatir/unittests/html/whitespace.html
  24. +12 −12 commonwatir/unittests/options.yml.example
  25. +14 −14 commonwatir/unittests/setup/browser.rb
  26. +23 −23 commonwatir/unittests/setup/filter.rb
  27. +21 −21 commonwatir/unittests/setup/lib.rb
  28. +29 −29 commonwatir/unittests/setup/options.rb
  29. +8 −8 commonwatir/unittests/setup/testUnitAddons.rb
  30. +74 −74 commonwatir/unittests/setup/watir-unittest.rb
  31. +47 −47 commonwatir/unittests/visibility_test.rb
  32. +40 −40 commonwatir/unittests/whitespace_test.rb
  33. +5 −5 doc/.loadpath
  34. +17 −17 doc/.project
  35. +3 −3 doc/README
  36. +6 −6 doc/src/browserfix.css
View
34 .project
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>watir-all</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.rubypeople.rdt.core.rubybuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.rubypeople.rdt.core.rubynature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>watir-all</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.rubypeople.rdt.core.rubybuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.rubypeople.rdt.core.rubynature</nature>
+ </natures>
+</projectDescription>
View
172 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\"\?>/, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?xml-stylesheet type=\"text\/xsl\" href=\"transform-results.xsl\"?>")
- 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\"\?>/, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?xml-stylesheet type=\"text\/xsl\" href=\"transform-results.xsl\"?>")
+ 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]
View
34 commonwatir/.project
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>watir-common</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.rubypeople.rdt.core.rubybuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.rubypeople.rdt.core.rubynature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>watir-common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.rubypeople.rdt.core.rubybuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.rubypeople.rdt.core.rubynature</nature>
+ </natures>
+</projectDescription>
View
10 commonwatir/History.txt
@@ -1,5 +1,5 @@
-=== 0.0.1 / 2008-08-28
-
-* Created
-
-
+=== 0.0.1 / 2008-08-28
+
+* Created
+
+
View
28 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
View
96 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.
View
18 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
View
6 commonwatir/lib/commonwatir.rb
@@ -1,3 +1,3 @@
-class CommonWatir
- VERSION = '1.6.2'
-end
+class CommonWatir
+ VERSION = '1.6.2'
+end
View
12 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'
View
88 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, <<EOT, expected, actual)
-<?> 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, <<EOT, expected, actual)
+<?> 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
View
298 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'
View
24 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'
View
34 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
View
104 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
View
116 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
View
182 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
View
142 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
+
View
42 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
View
122 commonwatir/unittests/html/buttons2.html
@@ -1,61 +1,61 @@
-<html>
-<head>
-<title>
-Test page for buttons
-</title>
- <link rel="stylesheet" type="text/css" href="watir_unit_tests.css">
-</head>
-<body>
-CVS Revision: $Revision: 1.0 $
-<br>
-<br>
-<table>
-<tr>
-<td>
-<form name = test1 method = get action = pass.html>
-
-<input type = button class="italic_button" name = b1 id = b2 value = "Click Me" onClick="javascript:document.location='pass.html';" title = "this is button1">
-<br><input type = button name = b4 id=b5 value = "Disabled Button" onClick="javascript:document.location='fail.html';" disabled>
-<input type=text id="text_id" value="OldValue" size="20"/>
-</form>
-</td>
-<td> The top button is for testing buttons with names
-<br> The second button is used for testing disabled buttons
-</td>
-</tr>
-
-<tr>
-<td>
-<form name = test2 method = get action = pass2.html>
-<br><input type = submit value=Submit>
-</form>
-</td>
-<td> This button is a submit ( the others are buttons)
-</td>
-</tr>
-<tr>
-<td>
-<form name = test3 method = get action = pass3.html>
-<br><input type = image src=images/button.jpg name =sub3>
-</form>
-</td>
-<td> This button is an image. It should behave the same as a submit
-
-</td>
-</tr>
-<tr>
-<td>
-<form name = test1 method = get action = pass.html>
-
-<button class="italic_button" name=b6 id = b7 value="Click Me2" onClick="javascript:document.location='pass.html';" title="this is button2">Click Me2</button>
-<br><button name = b8 id=b9 value ="Disabled Button2" onClick="javascript:document.location='fail.html';" disabled>Disabled Button2</button>
-<button>Sign In</button>
-</td>
-</form>
-<td> The top button is for testing buttons with names
-<br> The second button is used for testing disabled buttons
-</td>
-</tr>
-</table>
-</body>
-</html>
+<html>
+<head>
+<title>
+Test page for buttons
+</title>
+ <link rel="stylesheet" type="text/css" href="watir_unit_tests.css">
+</head>
+<body>
+CVS Revision: $Revision: 1.0 $
+<br>
+<br>
+<table>
+<tr>
+<td>
+<form name = test1 method = get action = pass.html>
+
+<input type = button class="italic_button" name = b1 id = b2 value = "Click Me" onClick="javascript:document.location='pass.html';" title = "this is button1">
+<br><input type = button name = b4 id=b5 value = "Disabled Button" onClick="javascript:document.location='fail.html';" disabled>
+<input type=text id="text_id" value="OldValue" size="20"/>
+</form>
+</td>
+<td> The top button is for testing buttons with names
+<br> The second button is used for testing disabled buttons
+</td>
+</tr>
+
+<tr>
+<td>
+<form name = test2 method = get action = pass2.html>
+<br><input type = submit value=Submit>
+</form>
+</td>
+<td> This button is a submit ( the others are buttons)
+</td>
+</tr>
+<tr>
+<td>
+<form name = test3 method = get action = pass3.html>
+<br><input type = image src=images/button.jpg name =sub3>
+</form>
+</td>
+<td> This button is an image. It should behave the same as a submit
+
+</td>
+</tr>
+<tr>
+<td>
+<form name = test1 method = get action = pass.html>
+
+<button class="italic_button" name=b6 id = b7 value="Click Me2" onClick="javascript:document.location='pass.html';" title="this is button2">Click Me2</button>
+<br><button name = b8 id=b9 value ="Disabled Button2" onClick="javascript:document.location='fail.html';" disabled>Disabled Button2</button>
+<button>Sign In</button>
+</td>
+</form>
+<td> The top button is for testing buttons with names
+<br> The second button is used for testing disabled buttons
+</td>
+</tr>
+</table>
+</body>
+</html>
View
1,224 commonwatir/unittests/html/entertainment_com.html
@@ -1,11 +1,11 @@
-
-
-<html>
-<head>
-<title>Entertainment.com</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-
-
+
+
+<html>
+<head>
+<title>Entertainment.com</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+
+
<!-- fuseaction to shopcart step mapping -->
@@ -17,50 +17,50 @@
<!-- if not in reg module exit -->
-
+
<meta name="WT.cg_n" content="shopcart">
<meta name="WT.cg_s" content="viewcart">
<meta name="WT.ti" content="dsp_viewcart.cfm">
-
-
-
-
-<link rel="stylesheet" href="/consumer_site_styles.css" type="text/css" />
-<script language="JavaScript" src="/html/functions.js"></script>
-
-<script language="JavaScript">
- function careers_popup() {
- Win = window.open("http://career.pereless.com/index.cfm?CID=75018&open=Employment&top=info&menuitem=","thewindow","toolbar=no,width=800,height=550,status=no,scrollbars=yes,resize=yes,menubar=no");
- Win.focus();
- Win.moveTo(250,250);
- }
-</script>
-
-</head>
-<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
-
-
-<MAP Name="HeaderMap">
- <AREA
- Shape="rect"
- Coords="5,5,200,60"
- Href="http://www.entertainment.com/">
-</MAP>
-
-<table cellpadding="0" cellspacing="0" width="760">
- <tr>
- <td><img src="https://media.entertainment.com/images/06/shopcart/ShopCart_MemNotIn_2of5.gif" usemap="#HeaderMap"></td>
- </tr>
-</table>
-
-
-
- <table border="0" cellpadding="0" cellspacing="0" width="760">
- <tr>
- <td valign="top">
-
-
+
+
+
+
+<link rel="stylesheet" href="/consumer_site_styles.css" type="text/css" />
+<script language="JavaScript" src="/html/functions.js"></script>
+
+<script language="JavaScript">
+ function careers_popup() {
+ Win = window.open("http://career.pereless.com/index.cfm?CID=75018&open=Employment&top=info&menuitem=","thewindow","toolbar=no,width=800,height=550,status=no,scrollbars=yes,resize=yes,menubar=no");
+ Win.focus();
+ Win.moveTo(250,250);
+ }
+</script>
+
+</head>
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
+
+
+<MAP Name="HeaderMap">
+ <AREA
+ Shape="rect"
+ Coords="5,5,200,60"
+ Href="http://www.entertainment.com/">
+</MAP>
+
+<table cellpadding="0" cellspacing="0" width="760">
+ <tr>
+ <td><img src="https://media.entertainment.com/images/06/shopcart/ShopCart_MemNotIn_2of5.gif" usemap="#HeaderMap"></td>
+ </tr>
+</table>
+
+
+
+ <table border="0" cellpadding="0" cellspacing="0" width="760">
+ <tr>
+ <td valign="top">
+
+
@@ -75,561 +75,561 @@
<input type="hidden" name="module" value="shopcart">
-
-
- <br>
- <table width="517" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td class="bg18"><img src="../images/corner_grey_tl.gif" width="13" height="13"></td>
- <td class="bg18"><img src="../images/spacer.gif" width="1" height="1"></td>
- <td class="bg18"><img src="../images/corner_grey_tr.gif" width="13" height="13"></td>
- </tr>
- <tr>
- <td class="bg18"><img src="../images/spacer.gif" width="1" height="1"></td>
- <td class="bg18">
-
-
-
- <!-- main body start -->
- <table width="491" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td colspan="2"><div class="txt6Bold">Billing Information<br><img src="../images/spacer.gif" width="1" height="2"></div></td>
- </tr>
- <!-- ********* dk grey line **************-->
- <tr>
- <td width="491" colspan="2" class="bg17"><img src="../images/spacer.gif" width="1" height="1"></td>
- </tr>
- <tr><td colspan="2">
- <!-- ---------Billing information--------- -->
- <table width="491" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td colspan="3" class="bg18"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
-
- <tr>
- <td width="215" align="right">*First Name:</td>
- <td width="5"><img src="../images/spacer.gif" width="5" height="2"></td>
- <td width="271"><input type="text" name="firstname" value="" size="22"></td>
- </tr>
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">*Last Name:</td>
- <td>&nbsp;</td>
- <td><input type="text" name="lastname" value="" size="22"></td>
- </tr>
-
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">*Phone:</td>
- <td>&nbsp;</td>
- <td><input type="text" name="dayphone" value="" size="18"></td>
- </tr>
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">*Street Address 1:</td>
- <td>&nbsp;</td>
- <td><input type="text" name="address" value="" size="22"></td>
- </tr>
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">Street Address 2:</td>
- <td>&nbsp;</td>
- <td><input type="text" name="address2" value="" size="22"></td>
- </tr>
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">*City:</td>
- <td>&nbsp;</td>
- <td><input type="text" name="city" value="" size="22"></td>
- </tr>
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">*State/Province:</td>
- <td>&nbsp;</td>
- <td><input type="text" size="4" maxlength="2" name="state" VALUE=""></td>
- </tr>
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">*Country:</td>
- <td>&nbsp;</td>
- <td>
- <SELECT NAME="country">
- <OPTION VALUE="999COU00000001">United States of America</OPTION>
-
- <OPTION VALUE="999COU00000067"
- >Andorra
-
- <OPTION VALUE="999COU00000011"
- >Anguilla
-
- <OPTION VALUE="999COU00000012"
- >Antigua/Barbuda
-
- <OPTION VALUE="999COU00000058"
- >Argentina
-
- <OPTION VALUE="999COU00000118"
- >Armenia
-
- <OPTION VALUE="999COU00000013"
- >Aruba
-
- <OPTION VALUE="999COU00000004"
- >Australia
-
- <OPTION VALUE="999COU00000068"
- >Austria
-
- <OPTION VALUE="999COU00000009"
- >Bahamas
-
- <OPTION VALUE="999COU00000032"
- >Bahamas
-
- <OPTION VALUE="999COU00000095"
- >Bahrain
-
- <OPTION VALUE="999COU00000014"
- >Barbados
-
- <OPTION VALUE="999COU00000069"
- >Belarus
-
- <OPTION VALUE="999COU00000070"
- >Belgium
-
- <OPTION VALUE="999COU00000055"
- >Belize
-
- <OPTION VALUE="999COU00000036"
- >Bermuda
-
- <OPTION VALUE="999COU00000037"
- >Botswana
-
- <OPTION VALUE="999COU00000059"
- >Brazil
-
- <OPTION VALUE="999COU00000015"
- >British Virgin Islands
-
- <OPTION VALUE="999COU00000071"
- >Bulgaria
-
- <OPTION VALUE="999COU00000065"
- >Burma/Myanmar
-
- <OPTION VALUE="999COU00000002"
- >Canada
-
- <OPTION VALUE="999COU00000016"
- >Cayman Islands
-
- <OPTION VALUE="999COU00000060"
- >Chile
-
- <OPTION VALUE="999COU00000114"
- >China
-
- <OPTION VALUE="999COU00000061"
- >Colombia
-
- <OPTION VALUE="999COU00000056"
- >Costa Rica
-
- <OPTION VALUE="999COU00000017"
- >Cuba
-
- <OPTION VALUE="999COU00000096"
- >Cyprus
-
- <OPTION VALUE="999COU00000072"
- >Czech Republic
-
- <OPTION VALUE="999COU00000073"
- >Denmark
-
- <OPTION VALUE="999COU00000018"
- >Dominica
-
- <OPTION VALUE="999COU00000019"
- >Dominican Republic
-
- <OPTION VALUE="999COU00000062"
- >Ecuador
-
- <OPTION VALUE="999COU00000097"
- >Egypt
-
- <OPTION VALUE="999COU00000057"
- >El Salvador
-
- <OPTION VALUE="999COU00000005"
- >England
-
- <OPTION VALUE="999COU00000074"
- >Finland
-
- <OPTION VALUE="999COU00000007"
- >France
-
- <OPTION VALUE="999COU00000075"
- >France
-
- <OPTION VALUE="999COU00000076"
- >Germany
-
- <OPTION VALUE="999COU00000077"
- >Greece
-
- <OPTION VALUE="999COU00000020"
- >Grenada
-
- <OPTION VALUE="999COU00000021"
- >Guadeloupe
-
- <OPTION VALUE="999COU00000110"
- >Guam
-
- <OPTION VALUE="999COU00000022"
- >Haiti
-
- <OPTION VALUE="999COU00000008"
- >Holland
-
- <OPTION VALUE="999COU00000106"
- >Honduras
-
- <OPTION VALUE="999COU00000111"
- >Hong Kong
-
- <OPTION VALUE="999COU00000078"
- >Hungary
-
- <OPTION VALUE="999COU00000115"
- >Iceland
-
- <OPTION VALUE="999COU00000044"
- >India
-
- <OPTION VALUE="999COU00000045"
- >Indonesia
-
- <OPTION VALUE="999COU00000079"
- >Ireland
-
- <OPTION VALUE="999COU00000098"
- >Israel
-
- <OPTION VALUE="999COU00000080"
- >Italy
-
- <OPTION VALUE="999COU00000023"
- >Jamaica
-
- <OPTION VALUE="999COU00000046"
- >Japan
-
- <OPTION VALUE="999COU00000104"
- >Korea
-
- <OPTION VALUE="999COU00000109"
- >Lebanon
-
- <OPTION VALUE="999COU00000081"
- >Luxembourg
-
- <OPTION VALUE="999COU00000047"
- >Malaysia
-
- <OPTION VALUE="999COU00000082"
- >Malta
-
- <OPTION VALUE="999COU00000024"
- >Martinique
-
- <OPTION VALUE="999COU00000003"
- >Mexico
-
- <OPTION VALUE="999COU00000025"
- >Montserrat
-
- <OPTION VALUE="999COU00000038"
- >Morocco
-
- <OPTION VALUE="999COU00000039"
- >Mozambique
-
- <OPTION VALUE="999COU00000040"
- >Namibia
-
- <OPTION VALUE="999COU00000026"
- >Navassa Island
-
- <OPTION VALUE="999COU00000048"
- >Nepal
-
- <OPTION VALUE="999COU00000083"
- >Netherlands
-
- <OPTION VALUE="999COU00000027"
- >Netherlands Antilles
-
- <OPTION VALUE="999COU00000066"
- >New Zealand
-
- <OPTION VALUE="999COU00000100"
- >Northern Ireland
-
- <OPTION VALUE="999COU00000084"
- >Norway
-
- <OPTION VALUE="999COU00000119"
- >Pakistan
-
- <OPTION VALUE="999COU00000049"
- >People's Republic of China
-
- <OPTION VALUE="999COU00000063"
- >Peru
-
- <OPTION VALUE="999COU00000050"
- >Philippines
-
- <OPTION VALUE="999COU00000085"
- >Poland
-
- <OPTION VALUE="999COU00000086"
- >Portugal
-
- <OPTION VALUE="999COU00000028"
- >Puerto Rico
-
- <OPTION VALUE="999COU00000107"
- >Qatar
-
- <OPTION VALUE="999COU00000051"
- >Republic of Maldives
-
- <OPTION VALUE="999COU00000087"
- >Romania
-
- <OPTION VALUE="999COU00000088"
- >Russia
-
- <OPTION VALUE="999COU00000029"
- >Saint Kitts & Nevis
-
- <OPTION VALUE="999COU00000030"
- >Saint Lucia
-
- <OPTION VALUE="999COU00000113"
- >Saint Maarten/St. Martin
-
- <OPTION VALUE="999COU00000031"
- >Saint Vincent & Grenadines
-
- <OPTION VALUE="999COU00000103"
- >Saipan
-
- <OPTION VALUE="999COU00000117"
- >Saudi Arabia
-
- <OPTION VALUE="999COU00000101"
- >Scotland
-
- <OPTION VALUE="999COU00000052"
- >Singapore
-
- <OPTION VALUE="999COU00000089"
- >Slovakia
-
- <OPTION VALUE="999COU00000090"
- >Slovenia
-
- <OPTION VALUE="999COU00000041"
- >South Africa
-
- <OPTION VALUE="999COU00000108"
- >South Korea
-
- <OPTION VALUE="999COU00000091"
- >Spain
-
- <OPTION VALUE="999COU00000053"
- >Sri Lanka
-
- <OPTION VALUE="999COU00000092"
- >Sweden
-
- <OPTION VALUE="999COU00000093"
- >Switzerland
-
- <OPTION VALUE="999COU00000112"
- >Taiwan
-
- <OPTION VALUE="999COU00000042"
- >Tanzania
-
- <OPTION VALUE="999COU00000054"
- >Thailand
-
- <OPTION VALUE="999COU00000116"
- >Thailand
-
- <OPTION VALUE="999COU00000033"
- >Trinidad & Tobago
-
- <OPTION VALUE="999COU00000094"
- >Turkey
-
- <OPTION VALUE="999COU00000034"
- >Turks & Caicos Islands
-
- <OPTION VALUE="999COU00000099"
- >United Arab Emirates
-
- <OPTION VALUE="999COU00000006"
- >United Kingdom
-
- <OPTION VALUE="999COU00000001"
- >United States of America
-
- <OPTION VALUE="999COU00000064"
- >Venezuela
-
- <OPTION VALUE="999COU00000105"
- >Vietnam
-
- <OPTION VALUE="999COU00000035"
- >Virgin Islands
-
- <OPTION VALUE="999COU00000102"
- >Wales
-
- <OPTION VALUE="999COU00000010"
- >West Indies
-
- <OPTION VALUE="999COU00000043"
- >Zimbabwe
-
- </SELECT>
- </td>
- </tr>
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">*Zip/Postal Code:</td>
- <td>&nbsp;</td>
- <td><input type="text" name="zip" value="" size="16"></td>
- </tr>
-
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">*E-mail Address:</td>
- <td>&nbsp;</td>
- <td><input type="text" name="email" value="" size="16"></td>
- </tr>
-
- <tr>
- <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
- </tr>
- <tr>
- <td align="right">*Confirm E-mail Address:</td>
- <td>&nbsp;</td>
- <td><input type="text" name="confirmemail" value="" size="16"></td>
- </tr>
-
- <tr>
- <td align="right">&nbsp;</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- </tr>
-
- <tr>
- <td colspan="3" class="bg17"><img src="../images/spacer.gif" width="1" height="1"></td>
- </tr>
- <tr>
- <td colspan="3">&nbsp;</td>
- </tr>
- <tr>
- <td colspan="3">
- <table align="center">
- <tr>
- <td align="right" valign="top"><span class="txt4Bold">Where do you want to <br>
- ship your order?</span></td>
- <td>&nbsp;</td>
- <td>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="radio" name="shipto" value="1" checked></td>
- <td>&nbsp;Billing Address</td>
- </tr>
- <tr>
- <td><input type="radio" name="shipto" value="2" ></td>
- <td>&nbsp;Different Address</td>
- </tr>
-
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td colspan="3" class="bg18">
-
- </td>
- </tr>
-
- <tr>
- <td colspan="3" class="bg18"><img src="../images/spacer.gif" width="1" height="10"></td>
- </tr>
- <tr align="right">
- <td colspan="3" class="bg18"><input type="Image" src="../images/button_continue.gif" width="122" height="29"></td>
- </tr>
- <tr>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- </tr>
- <tr>
- <td colspan="3" valign="top"><span class="txt2">*Required Field. Customer order information is processed on a secure server.<br>
- See <a href="http://www.entertainment.com/jsp/consumer/help/safety_privacy_legal/publications_privacy_policy.jsp" class="link2" target="_blank">Privacy Policy</a>.</span></td>
- </tr>
-
- </table>
- </td></tr>
- </table>
- <!-- main body end -->
- </td>
- <td class="bg18"><img src="../images/spacer.gif" width="1" height="1"></td>
- </tr>
- <tr>
- <td class="bg18"><img src="../images/corner_grey_bl.gif" width="13" height="13"></td>
- <td class="bg18"><img src="../images/spacer.gif" width="1" height="1"></td>
- <td class="bg18"><img src="../images/corner_grey_br.gif" width="13" height="13"></td>
- </tr>
- <tr>
- <td colspan="3">
- <br>
+
+
+ <br>
+ <table width="517" border="0" align="center" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="bg18"><img src="../images/corner_grey_tl.gif" width="13" height="13"></td>
+ <td class="bg18"><img src="../images/spacer.gif" width="1" height="1"></td>
+ <td class="bg18"><img src="../images/corner_grey_tr.gif" width="13" height="13"></td>
+ </tr>
+ <tr>
+ <td class="bg18"><img src="../images/spacer.gif" width="1" height="1"></td>
+ <td class="bg18">
+
+
+
+ <!-- main body start -->
+ <table width="491" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="2"><div class="txt6Bold">Billing Information<br><img src="../images/spacer.gif" width="1" height="2"></div></td>
+ </tr>
+ <!-- ********* dk grey line **************-->
+ <tr>
+ <td width="491" colspan="2" class="bg17"><img src="../images/spacer.gif" width="1" height="1"></td>
+ </tr>
+ <tr><td colspan="2">
+ <!-- ---------Billing information--------- -->
+ <table width="491" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td colspan="3" class="bg18"><img src="../images/spacer.gif" width="1" height="5"></td>
+ </tr>
+
+ <tr>
+ <td width="215" align="right">*First Name:</td>
+ <td width="5"><img src="../images/spacer.gif" width="5" height="2"></td>
+ <td width="271"><input type="text" name="firstname" value="" size="22"></td>
+ </tr>
+ <tr>
+ <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
+ </tr>
+ <tr>
+ <td align="right">*Last Name:</td>
+ <td>&nbsp;</td>
+ <td><input type="text" name="lastname" value="" size="22"></td>
+ </tr>
+
+ <tr>
+ <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
+ </tr>
+ <tr>
+ <td align="right">*Phone:</td>
+ <td>&nbsp;</td>
+ <td><input type="text" name="dayphone" value="" size="18"></td>
+ </tr>
+ <tr>
+ <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
+ </tr>
+ <tr>
+ <td align="right">*Street Address 1:</td>
+ <td>&nbsp;</td>
+ <td><input type="text" name="address" value="" size="22"></td>
+ </tr>
+ <tr>
+ <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
+ </tr>
+ <tr>
+ <td align="right">Street Address 2:</td>
+ <td>&nbsp;</td>
+ <td><input type="text" name="address2" value="" size="22"></td>
+ </tr>
+ <tr>
+ <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
+ </tr>
+ <tr>
+ <td align="right">*City:</td>
+ <td>&nbsp;</td>
+ <td><input type="text" name="city" value="" size="22"></td>
+ </tr>
+ <tr>
+ <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
+ </tr>
+ <tr>
+ <td align="right">*State/Province:</td>
+ <td>&nbsp;</td>
+ <td><input type="text" size="4" maxlength="2" name="state" VALUE=""></td>
+ </tr>
+ <tr>
+ <td colspan="3"><img src="../images/spacer.gif" width="1" height="5"></td>
+ </tr>
+ <tr>
+ <td align="right">*Country:</td>
+ <td>&nbsp;</td>
+ <td>
+ <SELECT NAME="country">
+ <OPTION VALUE="999COU00000001">United States of America</OPTION>
+
+ <OPTION VALUE="999COU00000067"
+ >Andorra
+
+ <OPTION VALUE="999COU00000011"
+ >Anguilla
+
+ <OPTION VALUE="999COU00000012"
+ >Antigua/Barbuda
+
+ <OPTION VALUE="999COU00000058"
+ >Argentina
+
+ <OPTION VALUE="999COU00000118"
+ >Armenia
+
+ <OPTION VALUE="999COU00000013"
+ >Aruba
+
+ <OPTION VALUE="999COU00000004"
+ >Australia
+
+ <OPTION VALUE="999COU00000068"
+ >Austria
+
+ <OPTION VALUE="999COU00000009"
+ >Bahamas
+
+ <OPTION VALUE="999COU00000032"
+ >Bahamas
+
+ <OPTION VALUE="999COU00000095"
+ >Bahrain
+
+ <OPTION VALUE="999COU00000014"
+ >Barbados
+
+ <OPTION VALUE="999COU00000069"
+ >Belarus
+
+ <OPTION VALUE="999COU00000070"
+ >Belgium
+
+ <OPTION VALUE="999COU00000055"
+ >Belize
+
+ <OPTION VALUE="999COU00000036"
+ >Bermuda
+
+ <OPTION VALUE="999COU00000037"
+ >Botswana
+
+ <OPTION VALUE="999COU00000059"
+ >Brazil
+
+ <OPTION VALUE="999COU00000015"
+ >British Virgin Islands
+
+ <OPTION VALUE="999COU00000071"
+ >Bulgaria
+
+ <OPTION VALUE="999COU00000065"
+ >Burma/Myanmar
+
+ <OPTION VALUE="999COU00000002"
+ >Canada
+
+ <OPTION VALUE="999COU00000016"
+ >Cayman Islands
+
+ <OPTION VALUE="999COU00000060"
+ >Chile
+
+ <OPTION VALUE="999COU00000114"
+ >China
+
+ <OPTION VALUE="999COU00000061"
+ >Col