Sha256: 91a6aeda7fbf6ea817736b8298997a118349407e2fd88add34a162c0428ef436

Contents?: true

Size: 1.32 KB

Versions: 21

Compression:

Stored size: 1.32 KB

Contents

# Unit Test for Internet Explorer

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
require 'watir/win32ole'
require 'unittests/ie_mock'
require 'test/unit'

class TC_ie < Test::Unit::TestCase
  include Watir::Exception
  
  def setup
    @faked_ie = TestIE.new
  end
  
  def test_waitForIE
    wait_time = 1
    #      @faked_ie.logger.level = Logger::DEBUG
    
    @faked_ie.setTimeToWait wait_time
    begin_time = Time.now
    @faked_ie.wait
    elapsed_time = Time.now - begin_time
    assert_in_delta(wait_time, elapsed_time, 0.5)
  end
  
  # is this correct? 
  def test_getLink_ByIndexReturnsNilOnNoLinks
    assert_nil(@faked_ie.locate_tagged_element('A', :index, 1))
    assert_nil(@faked_ie.locate_tagged_element('A', :index, 1))
  end
  
  def test_getLink_ByBadHow
    @faked_ie.addLink "foo"
    assert_raise(MissingWayOfFindingObjectException) do
      @faked_ie.locate_tagged_element('A', :no_such_mechanism, "verifying error handling")
    end
  end
  
  # is this correct? 
  def test_getLink_ByUrlReturnsNilOnNoLinks
    assert_nil(@faked_ie.locate_tagged_element('A', :url, "whatever"))
  end
  
  # is this correct? 
  def test_getLink_ByTextReturnsNilOnNoLinks
    assert_nil(@faked_ie.locate_tagged_element('A', :text, "whatever"))
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
watir-1.9.2 unittests/ie_test.rb
watir-1.9.2.rc1 unittests/ie_test.rb
watir-1.9.1 unittests/ie_test.rb
watir-1.9.1.rc1 unittests/ie_test.rb
watir-1.9.0 unittests/ie_test.rb
watir-1.9.0.rc7 unittests/ie_test.rb
watir-1.9.0.rc6 unittests/ie_test.rb
watir-1.9.0.rc5 unittests/ie_test.rb
watir-1.9.0.rc4 unittests/ie_test.rb
watir-1.9.0.rc3 unittests/ie_test.rb
watir-1.9.0.rc2 unittests/ie_test.rb
watir-1.9.0.rc1 unittests/ie_test.rb
watir-1.8.1 unittests/ie_test.rb
watir-1.8.1.rc1 unittests/ie_test.rb
watir-1.8.0 unittests/ie_test.rb
watir-1.8.0.rc1 unittests/ie_test.rb
watir-1.7.1 unittests/ie_test.rb
watir-1.7.0 unittests/ie_test.rb
watir-1.7.0.rc1 unittests/ie_test.rb
watir-1.6.7 unittests/ie_test.rb