Skip to content

Commit

Permalink
bugfix: selenium's wait_for_element method takes the number of second…
Browse files Browse the repository at this point in the history
…s before timing out from an option hash

Signed-off-by: Balint Erdi <balint.erdi@gmail.com>
  • Loading branch information
balinterdi authored and brynary committed Mar 29, 2009
1 parent e2a672a commit cd49c2d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/webrat/selenium/selenium_session.rb
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -71,15 +71,15 @@ 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

webrat_deprecate :clicks_link, :click_link

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

Expand All @@ -94,23 +94,23 @@ 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

webrat_deprecate :selects, :select

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

webrat_deprecate :chooses, :choose

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
Expand Down

0 comments on commit cd49c2d

Please sign in to comment.