Sha256: db81596c79af1af30359739bba85d1411e3d8d80d38dfd32dc2747fe6da1892c

Contents?: true

Size: 959 Bytes

Versions: 9

Compression:

Stored size: 959 Bytes

Contents

# feature tests for IE#send_keys

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

class TC_SendKeys < Test::Unit::TestCase
  def setup
    goto_page "textfields1.html"
  end
  
  def test_tabbing
    browser.text_field(:name, 'text1').focus
    browser.send_keys('{tab}')
    browser.send_keys('Scooby')
    assert('Scooby', browser.text_field(:name, 'beforetest').value)
  end
  
  def test_enter
    browser.text_field(:name, 'text1').focus
    browser.send_keys('{tab}{tab}{tab}{tab}{tab}')
    browser.send_keys('Dooby{enter}')
    sleep 0.2
    assert(browser.text.include?('PASS'))
  end
  
  tag_method :test_autoregistration, :fails_on_ie
  def test_autoregistration
    Watir::_unregister('AutoItX3.dll')
    assert_raises(WIN32OLERuntimeError) { WIN32OLE.new('AutoItX3.Control') }
    assert_nothing_raised { browser.send_keys('{tab}') }
  end    
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
watir-1.8.1 unittests/windows/send_keys_test.rb
watir-1.8.1.rc1 unittests/windows/send_keys_test.rb
watir-1.8.0 unittests/windows/send_keys_test.rb
watir-1.8.0.rc1 unittests/windows/send_keys_test.rb
watir-1.7.1 unittests/windows/send_keys_test.rb
watir-1.7.0 unittests/windows/send_keys_test.rb
watir-1.7.0.rc1 unittests/windows/send_keys_test.rb
watir-1.6.7 unittests/windows/send_keys_test.rb
watir-1.6.7.rc1 unittests/windows/send_keys_test.rb