Sha256: 7b2759900709f7d8d58e5a2129378926fad2467cdaee95c956f99fc301ddd565

Contents?: true

Size: 989 Bytes

Versions: 3

Compression:

Stored size: 989 Bytes

Contents

# feature tests for Links with multiple attributes
# revision: $Revision: 1009 $

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

class TC_Links_Multi < Test::Unit::TestCase
  include Watir
  
  def setup
    $ie.goto $htmlRoot + 'links_multi.html'
  end
  
  def test_existing
    assert_match(/not.html/, $ie.link(:class_name, 'Papa').href)
    assert_match(/mama.html/, $ie.link(:text, 'click').href)
  end
  
  def test_class_alias
    assert_match(/not.html/, $ie.link(:class, 'Papa').href)
  end

  def test_hash_syntax
    assert_match(/not.html/, $ie.link(:class_name => 'Papa').href)
    assert_match(/mama.html/, $ie.link(:text => 'click').href)
  end
  
  def test_class_and_text
    assert_match(/papa.html/, $ie.link(:class => 'Papa', :text => 'click').href)
  end
  
  def test_class_and_index
    assert_match(/papa.html/, $ie.link(:class => 'Papa', :index => 2).href)
  end  
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

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