Skip to content

Commit

Permalink
Depending on selenium-webdriver, instead of selenium-client
Browse files Browse the repository at this point in the history
Also fixed a bug with the newest Sauce Connect
  • Loading branch information
epall committed Jan 22, 2011
1 parent ebd0d7e commit d673840
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ begin
gem.add_runtime_dependency "rest-client", ">= 0"
gem.add_runtime_dependency "net-ssh", ">= 0"
gem.add_runtime_dependency "net-ssh-gateway", ">= 0"
gem.add_runtime_dependency "selenium-client", ">= 1.2.18"
gem.add_runtime_dependency "selenium-webdriver", ">= 0.1.2"
gem.add_runtime_dependency "childprocess", ">= 0.1.6"
gem.add_runtime_dependency "json", ">= 1.4.6"
gem.add_runtime_dependency "cmdparse", ">= 2.0.2"
gem.add_runtime_dependency "highline", ">= 1.5.0"
Expand Down
2 changes: 1 addition & 1 deletion lib/sauce/connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def initialize(options={})
if line =~ /Tunnel host is (.*) (\.\.|at)/
@status = $1
end
if line =~/You may start your tests/
if line =~/You may start your tests\./
@ready = true
end
if line =~ /- (Problem.*)$/
Expand Down
16 changes: 9 additions & 7 deletions lib/sauce/utilities.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require 'timeout'
require 'socket'
require 'childprocess'
require 'net/http'

module Sauce
module Utilities
Expand Down Expand Up @@ -31,17 +33,17 @@ def wait_for_server_on_port(port)
def with_selenium_rc
ENV['LOCAL_SELENIUM'] = "true"
STDERR.puts "Starting Selenium RC server on port 4444..."
server = ::Selenium::RemoteControl::RemoteControl.new("0.0.0.0", 4444)
server.jar_file = File.expand_path(File.dirname(__FILE__) + "/../../support/selenium-server.jar")
silence_stream(STDOUT) do
server.start :background => true
wait_for_server_on_port(4444)
end

jar_file = File.expand_path(File.dirname(__FILE__) + "/../../support/selenium-server.jar")
command = ["java", "-jar", jar_file, "-port", "4444"]
server = ChildProcess.build(*command)
server.start
wait_for_server_on_port(4444)
STDERR.puts "Selenium RC running!"
begin
yield
ensure
server.stop
Net::HTTP.get("127.0.0.1", "/selenium-server/driver/?cmd=shutDownSeleniumServer", 4444)
end
end

Expand Down

0 comments on commit d673840

Please sign in to comment.