Sha256: adfd3c08266368ae4002b0a68af4a09b86934360362b205ef87beb4af989ae76

Contents?: true

Size: 1.59 KB

Versions: 17

Compression:

Stored size: 1.59 KB

Contents

# feature tests for Pre

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
require 'unittests/setup'

class TC_Pre < Test::Unit::TestCase
  
  def setup
    goto_page "pre.html"
  end
  
  def test_Pre_Count
    assert( browser.pres.length == 3 )
  end
  
  def test_Pre_Exists
    assert_false( browser.pre( :index, 33 ).exists? )
    assert( browser.pre( :index, 3 ).exists? )
    
    assert( browser.pre( :id, '1' ).exists? )
    assert( browser.pre( :id, /[3-9]/ ).exists? )
    assert_false( browser.pre( :id, /missing_pre/ ).exists? )
    assert_false( browser.pre( :id, 'missingPre' ).exists? )
        
    assert( browser.pre( :name, '3' ).exists? )
    assert_false( browser.pre( :name, "name_missing" ).exists? )
  end
    
  def test_simple_access
    pre = browser.pre( :index, 1 )
    assert( pre.text.include?( "simple pre space" ) )
    assert_false( pre.text.include?( "A second block" ) )
    
    pre = browser.pre( :index, 2 )
    assert( pre.text.include?( "A second block" ) )
    assert_false( pre.text.include?( "this is the last block" ) )
  end

  tag_method :test_embedded_spaces, :fails_on_firefox # http://jira.openqa.org/browse/WTR-267
  def test_embedded_spaces
    pre = browser.pre( :index, 3 )
    assert( pre.text.include?( "continue    to work" ) )
    assert_false( pre.text.include?( "Pre Tag Test" ) )
  end

  tag_method :test_html, :fails_on_firefox # http://jira.openqa.org/browse/WTR-260
  def test_html
    pre = browser.pre(:index, 1)
    assert( pre.html.include?( "id=1 name=\"1\"" ) )
  end
  
end

Version data entries

17 entries across 17 versions & 1 rubygems

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