selenium-client 1.2.17 → 1.2.18
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +6 -1
- data/examples/rspec/google_spec.rb +2 -2
- data/examples/script/google.rb +1 -1
- data/examples/testunit/google_test.rb +1 -1
- data/lib/selenium/client.rb +1 -1
- data/lib/selenium/client/idiomatic.rb +1 -1
- data/lib/selenium/client/{generated_driver.rb → legacy_driver.rb} +0 -0
- data/lib/selenium/client/protocol.rb +12 -4
- data/lib/selenium/rake/remote_control_start_task.rb +2 -1
- data/lib/selenium/remote_control/remote_control.rb +4 -2
- data/lib/selenium/rspec/reporting/selenium_test_report_formatter.rb +1 -1
- data/lib/selenium/rspec/rspec_extensions.rb +1 -1
- metadata +3 -3
data/README.markdown
CHANGED
@@ -153,7 +153,7 @@ Writing Tests
|
|
153
153
|
If BDD is more your style, here is how you can achieve the same thing using RSpec:
|
154
154
|
|
155
155
|
require 'rubygems'
|
156
|
-
gem "rspec", "
|
156
|
+
gem "rspec", ">=1.2.8"
|
157
157
|
gem "selenium-client", ">=1.2.16"
|
158
158
|
require "selenium/client"
|
159
159
|
require "selenium/rspec/spec_helper"
|
@@ -326,3 +326,8 @@ Contributors
|
|
326
326
|
- Fix escaping bug when dealing with embedded regexes such as
|
327
327
|
"webratlink=evalregex:/Pastry Lovers \\(Organizer\\)/"
|
328
328
|
[patch](http://github.com/derfred/selenium-client/commit/4342cbb39d1a92b8db8f26ee0dc6c1a8f3287737)
|
329
|
+
|
330
|
+
* [Alex Chaffe](http://alexch.github.com)
|
331
|
+
- Better error reporting and fixed bug where if the response
|
332
|
+
doesn't start with "OK" it swallows the first three
|
333
|
+
chars (leading to annoying "ed out after 5000 msec" messages)
|
data/examples/script/google.rb
CHANGED
data/lib/selenium/client.rb
CHANGED
@@ -13,7 +13,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../nautilus/shell')
|
|
13
13
|
require File.expand_path(File.dirname(__FILE__) + '/command_error')
|
14
14
|
require File.expand_path(File.dirname(__FILE__) + '/protocol_error')
|
15
15
|
require File.expand_path(File.dirname(__FILE__) + '/client/protocol')
|
16
|
-
require File.expand_path(File.dirname(__FILE__) + '/client/
|
16
|
+
require File.expand_path(File.dirname(__FILE__) + '/client/legacy_driver')
|
17
17
|
require File.expand_path(File.dirname(__FILE__) + '/client/javascript_expression_builder')
|
18
18
|
require File.expand_path(File.dirname(__FILE__) + '/client/javascript_frameworks/prototype')
|
19
19
|
require File.expand_path(File.dirname(__FILE__) + '/client/javascript_frameworks/jquery')
|
@@ -472,7 +472,7 @@ module Selenium
|
|
472
472
|
# Set the execution delay in milliseconds, i.e. a pause delay following
|
473
473
|
# each selenium operation. By default, there is no such delay.
|
474
474
|
#
|
475
|
-
# Setting an execution can be useful to troubleshoot
|
475
|
+
# Setting an execution can be useful to troubleshoot or capture videos
|
476
476
|
def execution_delay=(delay_in_milliseconds)
|
477
477
|
remote_control_command "setSpeed", [delay_in_milliseconds]
|
478
478
|
end
|
File without changes
|
@@ -11,7 +11,7 @@ module Selenium
|
|
11
11
|
timeout(@default_timeout_in_seconds) do
|
12
12
|
status, response = http_post(http_request_for(verb, args))
|
13
13
|
raise Selenium::CommandError, response unless status == "OK"
|
14
|
-
response
|
14
|
+
response[3..-1] # strip "OK," from response
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -81,13 +81,21 @@ module Selenium
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def http_post(data)
|
84
|
-
|
84
|
+
start = Time.now
|
85
|
+
called_from = caller.detect{|line| line !~ /(selenium-client|vendor|usr\/lib\/ruby|\(eval\))/i}
|
85
86
|
http = Net::HTTP.new(@host, @port)
|
86
87
|
http.open_timeout = default_timeout_in_seconds
|
87
88
|
http.read_timeout = default_timeout_in_seconds
|
88
89
|
response = http.post('/selenium-server/driver/', data, HTTP_HEADERS)
|
89
|
-
|
90
|
-
|
90
|
+
if response.body !~ /^OK/
|
91
|
+
puts "#{start} selenium-client received failure from selenium server:"
|
92
|
+
puts "requested:"
|
93
|
+
puts "\t" + CGI::unescape(data.split('&').join("\n\t"))
|
94
|
+
puts "received:"
|
95
|
+
puts "\t#{response.body.inspect}"
|
96
|
+
puts "\tcalled from #{called_from}"
|
97
|
+
end
|
98
|
+
[ response.body[0..1], response.body ]
|
91
99
|
end
|
92
100
|
|
93
101
|
end
|
@@ -23,7 +23,7 @@ module Selenium
|
|
23
23
|
# Control. You will find the nightly build at
|
24
24
|
# http://nexus.openqa.org/content/repositories/snapshots/org/seleniumhq/selenium/server/selenium-server/
|
25
25
|
class RemoteControlStartTask
|
26
|
-
attr_accessor :port, :timeout_in_seconds, :background,
|
26
|
+
attr_accessor :host, :port, :timeout_in_seconds, :background,
|
27
27
|
:wait_until_up_and_running, :additional_args,
|
28
28
|
:log_to
|
29
29
|
attr_reader :jar_file
|
@@ -32,6 +32,7 @@ module Selenium
|
|
32
32
|
|
33
33
|
def initialize(name = :'selenium:rc:start')
|
34
34
|
@name = name
|
35
|
+
@host = "localhost"
|
35
36
|
@port = 4444
|
36
37
|
@timeout_in_seconds = 5
|
37
38
|
project_specific_jar = Dir[JAR_FILE_PATTERN].first
|
@@ -2,14 +2,15 @@ module Selenium
|
|
2
2
|
module RemoteControl
|
3
3
|
|
4
4
|
class RemoteControl
|
5
|
-
attr_reader :host, :port, :timeout_in_seconds, :shutdown_command
|
5
|
+
attr_reader :host, :port, :timeout_in_seconds, :firefox_profile, :shutdown_command
|
6
6
|
attr_accessor :additional_args, :jar_file, :log_to
|
7
7
|
|
8
8
|
def initialize(host, port, options={})
|
9
9
|
@host, @port = host, port
|
10
10
|
@timeout_in_seconds = options[:timeout] || (2 * 60)
|
11
11
|
@shutdown_command = options[:shutdown_command] || "shutDownSeleniumServer"
|
12
|
-
@
|
12
|
+
@firefox_profile = options[:firefox_profile]
|
13
|
+
@additional_args = options[:additional_args] || []
|
13
14
|
@shell = Nautilus::Shell.new
|
14
15
|
end
|
15
16
|
|
@@ -17,6 +18,7 @@ module Selenium
|
|
17
18
|
command = "java -jar \"#{jar_file}\""
|
18
19
|
command << " -port #{@port}"
|
19
20
|
command << " -timeout #{@timeout_in_seconds}"
|
21
|
+
command << " -firefoxProfileTemplate '#{@firefox_profile}'" if @firefox_profile
|
20
22
|
command << " #{additional_args.join(' ')}" unless additional_args.empty?
|
21
23
|
command << " > #{log_to}" if log_to
|
22
24
|
|
@@ -7,7 +7,7 @@ require "digest/md5"
|
|
7
7
|
require "base64"
|
8
8
|
require 'tmpdir'
|
9
9
|
require "rubygems"
|
10
|
-
gem "rspec", "1.2.8"
|
10
|
+
gem "rspec", ">=1.2.8"
|
11
11
|
require "spec"
|
12
12
|
require 'spec/runner/formatter/html_formatter'
|
13
13
|
require File.expand_path(File.dirname(__FILE__) + "/file_path_strategy")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenQA
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-12 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -26,11 +26,11 @@ files:
|
|
26
26
|
- lib/selenium/client/base.rb
|
27
27
|
- lib/selenium/client/driver.rb
|
28
28
|
- lib/selenium/client/extensions.rb
|
29
|
-
- lib/selenium/client/generated_driver.rb
|
30
29
|
- lib/selenium/client/idiomatic.rb
|
31
30
|
- lib/selenium/client/javascript_expression_builder.rb
|
32
31
|
- lib/selenium/client/javascript_frameworks/jquery.rb
|
33
32
|
- lib/selenium/client/javascript_frameworks/prototype.rb
|
33
|
+
- lib/selenium/client/legacy_driver.rb
|
34
34
|
- lib/selenium/client/protocol.rb
|
35
35
|
- lib/selenium/client/selenium_helper.rb
|
36
36
|
- lib/selenium/client.rb
|