Sha256: b28456960fbadd159e49d472511c3865fffc7cd1b54ac8e83f1921f0e9aa3e82
Contents?: true
Size: 974 Bytes
Versions: 33
Compression:
Stored size: 974 Bytes
Contents
# feature tests for Goto $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED require 'unittests/setup' class TC_error_checker < Test::Unit::TestCase def test_simple_checker button_checker = Proc.new do |ie| raise RuntimeError, "text 'buttons' is missing" if ! ie.contains_text(/buttons/) end browser.add_checker button_checker assert_raises( RuntimeError ) { goto_page('forms3.html') } assert_nothing_raised { goto_page('buttons1.html') } ensure browser.disable_checker button_checker assert_nothing_raised { goto_page('forms3.html') } end def test_browser_close_with_failing_checker failing_checker = lambda {|ie| raise "Browser should be closed without throwing this exception!"} ie = Watir::IE.new ie.add_checker failing_checker assert_nothing_raised {ie.close} ensure ie.disable_checker failing_checker ie.close if ie.exists? end end
Version data entries
33 entries across 33 versions & 2 rubygems