Sha256: 6d7198b907ab45f05b181e50194d49451089fbb4a918db0c43088c4a388a2667

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, 1).fire_event("onkeyup")
    assert(browser.div(:id, 'event_name').text == 'onkeyup')
  end

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

  def test_html_event
    browser.select_list(:index, 1).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-1.9.2 unittests/js_events_test.rb
watir-1.9.2.rc1 unittests/js_events_test.rb
watir-1.9.1 unittests/js_events_test.rb
watir-1.9.1.rc1 unittests/js_events_test.rb