Skip to content

Commit

Permalink
Added key_down and key_up wrapper in Selenium session
Browse files Browse the repository at this point in the history
  • Loading branch information
nando authored and brynary committed Nov 14, 2008
1 parent db81a97 commit 92b4814
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/webrat/selenium/selenium_session.rb
Expand Up @@ -115,6 +115,16 @@ def fire_event(field_identifier, event)
@selenium.fire_event(locator, "#{event}")
end

def key_down(field_identifier, key_code)
locator = "webrat=#{Regexp.escape(field_identifier)}"
@selenium.key_down(locator, key_code)
end

def key_up(field_identifier, key_code)
locator = "webrat=#{Regexp.escape(field_identifier)}"
@selenium.key_up(locator, key_code)
end

protected

def adjust_if_regexp(text_or_regexp) #:nodoc:
Expand Down

0 comments on commit 92b4814

Please sign in to comment.