Sha256: 5b72ec0e71b98c0a98e859a965cfca6aeeeb1d89b0935084dd45507464c8d43f

Contents?: true

Size: 730 Bytes

Versions: 4

Compression:

Stored size: 730 Bytes

Contents

# feature tests for JavaScript events

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

class TC_JSEvents < Test::Unit::TestCase
  def setup
    goto_page "javascriptevents.html"
  end

  def test_keyboard_event
    browser.text_field(:index, 0).fire_event("onkeyup")
    assert(browser.div(:id, 'event_name').text == 'onkeyup')
  end

  def test_mouse_event
    browser.text_field(:index, 0).fire_event("onmouseup")
    assert(browser.div(:id, 'event_name').text == 'onmouseup')
  end

  def test_html_event
    browser.select_list(:index, 0).fire_event("onchange")
    assert(browser.div(:id, 'event_name').text == 'onchange')
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
watir-2.0.1 unittests/js_events_test.rb
watir-2.0.0 unittests/js_events_test.rb
watir-2.0.0.rc3 unittests/js_events_test.rb
watir-2.0.0.rc2 unittests/js_events_test.rb