lib/webrat/selenium/selenium_session.rb in diabolo-webrat-0.4.4 vs lib/webrat/selenium/selenium_session.rb in diabolo-webrat-0.4.4.1
- old
+ new
@@ -20,10 +20,11 @@
end
end
class SeleniumSession
include Webrat::SaveAndOpenPage
+ include Webrat::Selenium::SilenceStream
def initialize(*args) # :nodoc:
end
def simulate
@@ -53,10 +54,14 @@
def response_body #:nodoc:
selenium.get_html_source
end
+ def current_url
+ selenium.location
+ end
+
def click_button(button_text_or_regexp = nil, options = {})
if button_text_or_regexp.is_a?(Hash) && options == {}
pattern, options = nil, button_text_or_regexp
elsif button_text_or_regexp
pattern = adjust_if_regexp(button_text_or_regexp)
@@ -179,18 +184,9 @@
end
open_in_browser(filename)
end
protected
-
- def silence_stream(stream)
- old_stream = stream.dup
- stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null')
- stream.sync = true
- yield
- ensure
- stream.reopen(old_stream)
- end
def setup #:nodoc:
Webrat::Selenium::SeleniumRCServer.boot
Webrat::Selenium::ApplicationServer.boot