Sha256: d61501b51dd0e51c500f910cdbd7956dc3e86a8f1e966f2ce15714e6cdf490ed

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# feature tests for TextArea Fields
# revision: $Revision: 1348 $

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

class TC_FileField_XPath < Test::Unit::TestCase
  include Watir
  
  def setup
    goto_page "fileupload.html"
  end
  
  def test_file_field_Exists
    #test for existance of 4 file area
    assert($ie.file_field(:xpath, "//input[@name='file1']/").exists?)
    assert($ie.file_field(:xpath, "//input[@id='file2']/").exists?)
    #test for missing 
    assert(!$ie.file_field(:xpath, "//input[@name='missing']/").exists?)   
    assert(!$ie.file_field(:xpath, "//input[@name='totallybogus']/").exists?)
    #pop one open and put something in it.
    $ie.file_field(:xpath, "//input[@name='file1']/").set($htmlRoot + "fileupload.html")	
    #click the upload button
    $ie.button(:xpath, "//input[@name='upload']/").click
    
    assert($ie.text.include?("PASS"))	
  end
  
  def test_iterator
    assert_equal(6, $ie.file_fields.length)
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

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