Sha256: aeef006088e2d1e09283c4a1b317bce5fbb0af73e8676abcadce43ec1948c4a8

Contents?: true

Size: 649 Bytes

Versions: 1

Compression:

Stored size: 649 Bytes

Contents

# feature tests for Goto
# revision: $Revision$

$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') }
    
    browser.disable_checker button_checker
    assert_nothing_raised { goto_page('forms3.html') }
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-1.6.5 unittests/errorchecker_test.rb