bugfix: selenium's wait_for_element method takes the number of seconds before timing out from an option hash
Signed-off-by: Balint Erdi <balint.erdi@gmail.com>
This commit is contained in:
parent
e2a672a767
commit
cd49c2d939
|
@ -39,7 +39,7 @@ module Webrat
|
||||||
|
|
||||||
def fill_in(field_identifier, options)
|
def fill_in(field_identifier, options)
|
||||||
locator = "webrat=#{Regexp.escape(field_identifier)}"
|
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]}")
|
selenium.type(locator, "#{options[:with]}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ module Webrat
|
||||||
pattern ||= '*'
|
pattern ||= '*'
|
||||||
locator = "button=#{pattern}"
|
locator = "button=#{pattern}"
|
||||||
|
|
||||||
selenium.wait_for_element locator, 5
|
selenium.wait_for_element locator, :timeout_in_seconds => 5
|
||||||
selenium.click locator
|
selenium.click locator
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ module Webrat
|
||||||
def click_link(link_text_or_regexp, options = {})
|
def click_link(link_text_or_regexp, options = {})
|
||||||
pattern = adjust_if_regexp(link_text_or_regexp)
|
pattern = adjust_if_regexp(link_text_or_regexp)
|
||||||
locator = "webratlink=#{pattern}"
|
locator = "webratlink=#{pattern}"
|
||||||
selenium.wait_for_element locator, 5
|
selenium.wait_for_element locator, :timeout_in_seconds => 5
|
||||||
selenium.click locator
|
selenium.click locator
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ module Webrat
|
||||||
|
|
||||||
def click_link_within(selector, link_text, options = {})
|
def click_link_within(selector, link_text, options = {})
|
||||||
locator = "webratlinkwithin=#{selector}|#{link_text}"
|
locator = "webratlinkwithin=#{selector}|#{link_text}"
|
||||||
selenium.wait_for_element locator, 5
|
selenium.wait_for_element locator, :timeout_in_seconds => 5
|
||||||
selenium.click locator
|
selenium.click locator
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ module Webrat
|
||||||
select_locator = "webratselectwithoption=#{option_text}"
|
select_locator = "webratselectwithoption=#{option_text}"
|
||||||
end
|
end
|
||||||
|
|
||||||
selenium.wait_for_element select_locator, 5
|
selenium.wait_for_element select_locator, :timeout_in_seconds => 5
|
||||||
selenium.select(select_locator, option_text)
|
selenium.select(select_locator, option_text)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ module Webrat
|
||||||
|
|
||||||
def choose(label_text)
|
def choose(label_text)
|
||||||
locator = "webrat=#{label_text}"
|
locator = "webrat=#{label_text}"
|
||||||
selenium.wait_for_element locator, 5
|
selenium.wait_for_element locator, :timeout_in_seconds => 5
|
||||||
selenium.click locator
|
selenium.click locator
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ module Webrat
|
||||||
|
|
||||||
def check(label_text)
|
def check(label_text)
|
||||||
locator = "webrat=#{label_text}"
|
locator = "webrat=#{label_text}"
|
||||||
selenium.wait_for_element locator, 5
|
selenium.wait_for_element locator, :timeout_in_seconds => 5
|
||||||
selenium.click locator
|
selenium.click locator
|
||||||
end
|
end
|
||||||
alias_method :uncheck, :check
|
alias_method :uncheck, :check
|
||||||
|
|
Loading…
Reference in New Issue