Sha256: 6c08c807e8ab97b9cd35f578885419d061e6cd6bf080abf9031e1660a0721900

Contents?: true

Size: 759 Bytes

Versions: 3

Compression:

Stored size: 759 Bytes

Contents

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

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

class TC_error_checker< Test::Unit::TestCase
  include Watir
  
  def goto_page(page)
    $ie.goto($htmlRoot + page)
  end
  
  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

3 entries across 3 versions & 1 rubygems

Version Path
watir-1.5.4 unittests/errorchecker_test.rb
watir-1.5.3 unittests/errorchecker_test.rb
watir-1.5.2 unittests/errorchecker_test.rb