From 3b4d8ef95ad92fd487179036242f13f5ed72ebc6 Mon Sep 17 00:00:00 2001 From: Balint Erdi Date: Tue, 24 Mar 2009 00:33:16 +0100 Subject: [PATCH] bugfix: selenium's wait_for_element method takes the number of seconds before timing out from an option hash Signed-off-by: Balint Erdi --- lib/webrat/selenium/selenium_session.rb | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/webrat/selenium/selenium_session.rb b/lib/webrat/selenium/selenium_session.rb index 6880957..46d190d 100644 --- a/lib/webrat/selenium/selenium_session.rb +++ b/lib/webrat/selenium/selenium_session.rb @@ -39,7 +39,7 @@ module Webrat def fill_in(field_identifier, options) locator = "webrat=#{Regexp.escape(field_identifier)}" - selenium.wait_for_element locator, 5 + selenium.wait_for_element locator, :timeout_in_seconds => 5 selenium.type(locator, "#{options[:with]}") end @@ -62,7 +62,7 @@ module Webrat pattern ||= '*' locator = "button=#{pattern}" - selenium.wait_for_element locator, 5 + selenium.wait_for_element locator, :timeout_in_seconds => 5 selenium.click locator end @@ -71,7 +71,7 @@ module Webrat def click_link(link_text_or_regexp, options = {}) pattern = adjust_if_regexp(link_text_or_regexp) locator = "webratlink=#{pattern}" - selenium.wait_for_element locator, 5 + selenium.wait_for_element locator, :timeout_in_seconds => 5 selenium.click locator end @@ -79,7 +79,7 @@ module Webrat def click_link_within(selector, link_text, options = {}) locator = "webratlinkwithin=#{selector}|#{link_text}" - selenium.wait_for_element locator, 5 + selenium.wait_for_element locator, :timeout_in_seconds => 5 selenium.click locator end @@ -94,7 +94,7 @@ module Webrat select_locator = "webratselectwithoption=#{option_text}" end - selenium.wait_for_element select_locator, 5 + selenium.wait_for_element select_locator, :timeout_in_seconds => 5 selenium.select(select_locator, option_text) end @@ -102,7 +102,7 @@ module Webrat def choose(label_text) locator = "webrat=#{label_text}" - selenium.wait_for_element locator, 5 + selenium.wait_for_element locator, :timeout_in_seconds => 5 selenium.click locator end @@ -110,7 +110,7 @@ module Webrat def check(label_text) locator = "webrat=#{label_text}" - selenium.wait_for_element locator, 5 + selenium.wait_for_element locator, :timeout_in_seconds => 5 selenium.click locator end alias_method :uncheck, :check -- 1.5.5