Added key_down and key_up wrapper in Selenium session

This commit is contained in:
Nando 2008-08-11 20:58:01 +02:00 committed by Bryan Helmkamp
parent db81a97e42
commit 92b4814392

View File

@ -115,6 +115,16 @@ module Webrat
@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: