unittests/setup.rb in watir-1.4.1 vs unittests/setup.rb in watir-1.5.2
- old
+ new
@@ -1,47 +1,51 @@
-END {$ie.close if $ie} # close ie at completion of the tests
-
# libraries used by feature tests
require 'watir'
+END {$ie.close if $ie && $ie.exists?; Watir::IE.quit} # close ie at completion of the tests
+
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'watir/testUnitAddons'
+require 'watir/testcase'
topdir = File.join(File.dirname(__FILE__), '..')
Dir.chdir topdir do
$all_tests = Dir["unittests/*_test.rb"]
+ $xpath_tests = Dir["unittests/*_xpath_test.rb"]
end
+$window_tests =
+ ['js_events', # is always visible
+ 'modal_dialog', # modal is visible
+ 'attach_to_existing_window', # could actually run robustly as part of the core suite!
+ 'attach_to_new_window', # creates new window
+ 'jscript',
+ 'send_keys', # visible
+ 'iedialog', # visible
+ 'close_window', # creates new window
+ 'frame_links', # visible
+ 'open_close',
+ ].collect {|x| "unittests/windows/#{x}_test.rb"}
+
$non_core_tests =
['popups', # has problems when run in a suite (is ok when run alone);
# must be visible
# will be revised to use autoit
# takes 15 seconds to run
- 'images', # failing tests; also assumes working dir is unittests
- 'screen_capture', # is always visible; takes 25 secons
+ 'images', # save file must must be visible
+ 'screen_capture', # is always visible; takes 25 seconds
'filefield', # is always visible; takes 40 seconds
- 'jscript',
- 'js_events', # is always visible
'minmax', # becomes visible
- 'send_keys' # uses autoit
+ 'dialog' # visible
].collect {|x| "unittests/#{x}_test.rb"}
-$core_tests = $all_tests - $non_core_tests
+$core_tests = $all_tests - $non_core_tests - $window_tests - $xpath_tests
-def start_ie_with_logger
- $ie = Watir::IE.new()
-# $ie.logger = Watir::WatirLogger.new( 'debug.txt', 4, 10000 )
- $ie.set_fast_speed
-end
+$ie = Watir::IE.new
+$ie.set_fast_speed
-def set_local_dir
- $myDir = File.expand_path(File.dirname(__FILE__))
- $myDir.sub!( %r{/cygdrive/(\w)/}, '\1:/' ) # convert from cygwin to dos
- # if you run the unit tests form a local file system use this line
- $htmlRoot = "file://#{$myDir}/html/"
- # if you run the unit tests from a web server use this line
- # $htmlRoot = "http://localhost:8080/watir/html/"
-end
-
-start_ie_with_logger
-set_local_dir
-
+$myDir = File.expand_path(File.dirname(__FILE__))
+$myDir.sub!( %r{/cygdrive/(\w)/}, '\1:/' ) # convert from cygwin to dos
+# if you run the unit tests form a local file system use this line
+$htmlRoot = "file://#{$myDir}/html/"
+# if you run the unit tests from a web server use this line
+# $htmlRoot = "http://localhost:8080/watir/html/"