Sha256: 251e1c8544952b4e546af21f01d98c30f91d6a8bdd52469d5ab2e5d9253b30a8

Contents?: true

Size: 680 Bytes

Versions: 2

Compression:

Stored size: 680 Bytes

Contents

# feature tests for Goto
# revision: $Revision: 1348 $

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
require 'unittests/setup'

class TC_error_checker < Test::Unit::TestCase
    
  def test_simple_checker
    button_checker = Proc.new{
      |ie|  raise RuntimeError, "text 'buttons' was missing"  if !ie.pageContainsText(/buttons/)
    }
    
    $ie.add_checker(button_checker )
    assert_raises( RuntimeError ) { goto_page('forms3.html') }
    assert_nothing_raised { goto_page('buttons1.html') }
    
    $ie.disable_checker( button_checker )
    assert_nothing_raised { goto_page('forms3.html') }
    
  end
  
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watir-1.5.5 unittests/errorchecker_test.rb
watir-1.5.6 unittests/errorchecker_test.rb