Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding javascript_framework to selenium options which can be used by webrat #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/webrat/core/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def application_port_for_selenium
# Defaults to false
attr_accessor :selenium_verbose_output

# Set the javascript framework for selenium to use
attr_accessor :javascript_framework

def initialize # :nodoc:
self.open_error_files = true
self.application_environment = :test
Expand All @@ -87,6 +90,7 @@ def initialize # :nodoc:
self.selenium_browser_key = '*firefox'
self.selenium_browser_startup_timeout = 5
self.selenium_verbose_output = false
self.javascript_framework = :jquery

tmp_dir = Pathname.new(Dir.pwd).join("tmp")
self.saved_pages_dir = tmp_dir.exist? ? tmp_dir : Dir.pwd
Expand Down
13 changes: 7 additions & 6 deletions lib/webrat/selenium/selenium_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,13 @@ def setup #:nodoc:


def create_browser
$browser = ::Selenium::Client::Driver.new(
Webrat.configuration.selenium_server_address || "localhost",
Webrat.configuration.selenium_server_port,
Webrat.configuration.selenium_browser_key,
"http://#{Webrat.configuration.application_address}:#{Webrat.configuration.application_port_for_selenium}"
)
$browser = ::Selenium::Client::Driver.new({
:host => Webrat.configuration.selenium_server_address || "localhost",
:port => Webrat.configuration.selenium_server_port,
:browser => Webrat.configuration.selenium_browser_key,
:url => "http://#{Webrat.configuration.application_address}:#{Webrat.configuration.application_port_for_selenium}",
:javascript_framework => Webrat.configuration.javascript_framework
})
$browser.set_speed(0) unless Webrat.configuration.selenium_server_address

at_exit do
Expand Down