From cd49c2d9392df7489653e4819700e910a33e4377 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 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/webrat/selenium/selenium_session.rb b/lib/webrat/selenium/selenium_session.rb index 68809572..46d190d4 100644 --- a/lib/webrat/selenium/selenium_session.rb +++ b/lib/webrat/selenium/selenium_session.rb @@ -39,7 +39,7 @@ def visit(url) 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 @@ def click_button(button_text_or_regexp = nil, options = {}) 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 @@ def click_button(button_text_or_regexp = nil, options = {}) 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 @@ def click_link(link_text_or_regexp, options = {}) 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 @@ def select(option_text, options = {}) 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 @@ def select(option_text, options = {}) 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 @@ def choose(label_text) 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