Sha256: 91753fdab530cebad65cd48fa6884afb650a119a8d82f1f76e80fd5235397df6

Contents?: true

Size: 1.12 KB

Versions: 24

Compression:

Stored size: 1.12 KB

Contents

# feature tests for TextArea Fields

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
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(browser.file_field(:xpath, "//input[@name='file1']/").exists?)
    assert(browser.file_field(:xpath, "//input[@id='file2']/").exists?)
    #test for missing 
    assert_false(browser.file_field(:xpath, "//input[@name='missing']/").exists?)   
    assert_false(browser.file_field(:xpath, "//input[@name='totallybogus']/").exists?)
    #pop one open and put something in it.
    file = $htmlRoot + "fileupload.html"
    file.gsub! 'file:///', ''
    file.gsub! '/', '\\'
    browser.file_field(:xpath, "//input[@name='file1']/").set(file)
    #click the upload button
    browser.button(:xpath, "//input[@name='upload']/").click
    
    assert(browser.text.include?("PASS"))	
  end
  
  def test_iterator
    assert_equal(6, browser.file_fields.length)
  end
  
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
watir-classic-3.0.0 unittests/filefield_xpath_test.rb
watir-3.0.0.rc3 unittests/filefield_xpath_test.rb
watir-3.0.0.rc2 unittests/filefield_xpath_test.rb
watir-3.0.0.rc1 unittests/filefield_xpath_test.rb
watir-2.0.4 unittests/filefield_xpath_test.rb
watir-2.0.3 unittests/filefield_xpath_test.rb
watir-2.0.2 unittests/filefield_xpath_test.rb
watir-2.0.2.rc1 unittests/filefield_xpath_test.rb
watir-2.0.1 unittests/filefield_xpath_test.rb
watir-2.0.0 unittests/filefield_xpath_test.rb
watir-2.0.0.rc3 unittests/filefield_xpath_test.rb
watir-2.0.0.rc2 unittests/filefield_xpath_test.rb
watir-1.9.2 unittests/filefield_xpath_test.rb
watir-1.9.2.rc1 unittests/filefield_xpath_test.rb
watir-1.9.1 unittests/filefield_xpath_test.rb
watir-1.9.1.rc1 unittests/filefield_xpath_test.rb
watir-1.9.0 unittests/filefield_xpath_test.rb
watir-1.9.0.rc7 unittests/filefield_xpath_test.rb
watir-1.9.0.rc6 unittests/filefield_xpath_test.rb
watir-1.9.0.rc5 unittests/filefield_xpath_test.rb