selenium-webdriver 2.21.2 → 2.22.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +5 -0
- data/lib/selenium/webdriver.rb +2 -24
- data/lib/selenium/webdriver/common.rb +1 -0
- data/lib/selenium/webdriver/common/json_helper.rb +34 -0
- data/lib/selenium/webdriver/firefox/bridge.rb +2 -2
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/ie/native/win32/IEDriver.dll +0 -0
- data/lib/selenium/webdriver/ie/native/x64/IEDriver.dll +0 -0
- data/lib/selenium/webdriver/safari/bridge.rb +8 -5
- data/lib/selenium/webdriver/safari/server.rb +2 -2
- metadata +6 -5
data/CHANGES
CHANGED
data/lib/selenium/webdriver.rb
CHANGED
@@ -8,6 +8,8 @@ require 'selenium/webdriver/common'
|
|
8
8
|
|
9
9
|
module Selenium
|
10
10
|
module WebDriver
|
11
|
+
extend JsonHelper
|
12
|
+
|
11
13
|
Point = Struct.new(:x, :y)
|
12
14
|
Dimension = Struct.new(:width, :height)
|
13
15
|
Location = Struct.new(:latitude, :longitude, :altitude)
|
@@ -63,29 +65,5 @@ module Selenium
|
|
63
65
|
WebDriver::Driver.for(*args)
|
64
66
|
end
|
65
67
|
|
66
|
-
if MultiJson.respond_to?(:dump)
|
67
|
-
# @api private
|
68
|
-
def self.json_dump(obj)
|
69
|
-
MultiJson.dump(obj)
|
70
|
-
end
|
71
|
-
else
|
72
|
-
# @api private
|
73
|
-
def self.json_dump(obj)
|
74
|
-
MultiJson.encode(obj)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
if MultiJson.respond_to?(:load)
|
79
|
-
# @api private
|
80
|
-
def self.json_load(obj)
|
81
|
-
MultiJson.load(obj)
|
82
|
-
end
|
83
|
-
else
|
84
|
-
# @api private
|
85
|
-
def self.json_load(obj)
|
86
|
-
MultiJson.decode(obj)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
68
|
end # WebDriver
|
91
69
|
end # Selenium
|
@@ -35,5 +35,6 @@ require 'selenium/webdriver/common/driver_extensions/uploads_files'
|
|
35
35
|
require 'selenium/webdriver/common/keys'
|
36
36
|
require 'selenium/webdriver/common/bridge_helper'
|
37
37
|
require 'selenium/webdriver/common/profile_helper'
|
38
|
+
require 'selenium/webdriver/common/json_helper'
|
38
39
|
require 'selenium/webdriver/common/driver'
|
39
40
|
require 'selenium/webdriver/common/element'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Selenium
|
2
|
+
module WebDriver
|
3
|
+
module JsonHelper
|
4
|
+
|
5
|
+
# ActiveSupport may define Object#load, so we can't use MultiJson.respond_to? here
|
6
|
+
sm = MultiJson.singleton_methods.map { |e| e.to_sym }
|
7
|
+
|
8
|
+
if sm.include? :load
|
9
|
+
# @api private
|
10
|
+
def json_load(obj)
|
11
|
+
MultiJson.load(obj)
|
12
|
+
end
|
13
|
+
else
|
14
|
+
# @api private
|
15
|
+
def json_load(obj)
|
16
|
+
MultiJson.decode(obj)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
if sm.include? :dump
|
21
|
+
# @api private
|
22
|
+
def json_dump(obj)
|
23
|
+
MultiJson.dump(obj)
|
24
|
+
end
|
25
|
+
else
|
26
|
+
# @api private
|
27
|
+
def json_dump(obj)
|
28
|
+
MultiJson.encode(obj)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -50,18 +50,21 @@ module Selenium
|
|
50
50
|
|
51
51
|
params.merge!(command_hash) if command_hash
|
52
52
|
|
53
|
-
@server.send
|
54
|
-
|
55
|
-
|
53
|
+
@server.send(
|
54
|
+
:origin => "webdriver",
|
55
|
+
:type => "command",
|
56
|
+
:command => { :id => @command_id.to_s, :name => command, :parameters => params}
|
57
|
+
)
|
56
58
|
|
57
|
-
|
59
|
+
raw = @server.receive
|
60
|
+
response = raw.fetch('response')
|
58
61
|
|
59
62
|
status_code = response['status']
|
60
63
|
if status_code != 0
|
61
64
|
raise Error.for_code(status_code), response['value']['message']
|
62
65
|
end
|
63
66
|
|
64
|
-
if
|
67
|
+
if raw['id'] != @command_id.to_s
|
65
68
|
raise Error::WebDriverError, "response id does not match command id"
|
66
69
|
end
|
67
70
|
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-webdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 2.
|
4
|
+
prerelease: 7
|
5
|
+
version: 2.22.0.rc1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jari Bakken
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-05-01 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- lib/selenium/webdriver/common/element.rb
|
160
160
|
- lib/selenium/webdriver/common/error.rb
|
161
161
|
- lib/selenium/webdriver/common/file_reaper.rb
|
162
|
+
- lib/selenium/webdriver/common/json_helper.rb
|
162
163
|
- lib/selenium/webdriver/common/keyboard.rb
|
163
164
|
- lib/selenium/webdriver/common/keys.rb
|
164
165
|
- lib/selenium/webdriver/common/mouse.rb
|
@@ -248,9 +249,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
248
249
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
249
250
|
none: false
|
250
251
|
requirements:
|
251
|
-
- - "
|
252
|
+
- - ">"
|
252
253
|
- !ruby/object:Gem::Version
|
253
|
-
version:
|
254
|
+
version: 1.3.1
|
254
255
|
requirements: []
|
255
256
|
|
256
257
|
rubyforge_project:
|