Sha256: 02d7ae61660d21598470fe8957455174c46928bd3de4b80beb0e04d26f643f76

Contents?: true

Size: 1.1 KB

Versions: 20

Compression:

Stored size: 1.1 KB

Contents

# feature tests for file Fields

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

class TC_FileField < Test::Unit::TestCase
  tags :must_be_visible, :creates_windows
  include Watir
  
  def setup
    goto_page "fileupload.html"
  end
  
  def test_file_field_Exists
    # test for existance of 4 file area
    assert(browser.file_field(:name,"file1").exists?)
    assert(browser.file_field(:id,"file2").exists?)

    # test for missing 
    assert_false(browser.file_field(:name, "missing").exists?)   
    assert_false(browser.file_field(:name,"totallybogus").exists?)

    # pop one open and put something in it.
    file = $htmlRoot + "fileupload.html"
    file.gsub! 'file:///', ''
    file.gsub! '/', '\\'
    browser.file_field(:name,"file1").set(file)	
    assert_equal file, browser.file_field(:name,"file1").value

    # click the upload button
    browser.button(:name,"upload").click
    assert(browser.text.include?("PASS"))	
  end
  
  def test_iterator
    assert_equal(6, browser.file_fields.length)
  end
  
end

Version data entries

20 entries across 20 versions & 1 rubygems

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