Skip to content
Browse files

Depending on selenium-webdriver, instead of selenium-client

Also fixed a bug with the newest Sauce Connect
  • Loading branch information...
1 parent ebd0d7e commit d6738409f455282f928a27bb79db374b239d1d8d @epall epall committed Jan 21, 2011
Showing with 12 additions and 9 deletions.
  1. +2 −1 Rakefile
  2. +1 −1 lib/sauce/connect.rb
  3. +9 −7 lib/sauce/utilities.rb
View
3 Rakefile
@@ -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"
View
2 lib/sauce/connect.rb
@@ -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.*)$/
View
16 lib/sauce/utilities.rb
@@ -1,5 +1,7 @@
require 'timeout'
require 'socket'
+require 'childprocess'
+require 'net/http'
module Sauce
module Utilities
@@ -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

0 comments on commit d673840

Please sign in to comment.
Something went wrong with that request. Please try again.