selenium-webdriver 2.52.0 → 2.53.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/CHANGES +14 -0
  2. data/Gemfile.lock +53 -0
  3. data/lib/selenium/webdriver.rb +1 -3
  4. data/lib/selenium/webdriver/chrome/profile.rb +2 -2
  5. data/lib/selenium/webdriver/chrome/service.rb +8 -5
  6. data/lib/selenium/webdriver/common.rb +0 -1
  7. data/lib/selenium/webdriver/common/alert.rb +7 -1
  8. data/lib/selenium/webdriver/common/element.rb +1 -1
  9. data/lib/selenium/webdriver/common/error.rb +1 -1
  10. data/lib/selenium/webdriver/common/platform.rb +8 -0
  11. data/lib/selenium/webdriver/common/profile_helper.rb +2 -2
  12. data/lib/selenium/webdriver/common/proxy.rb +1 -1
  13. data/lib/selenium/webdriver/edge/legacy_support.rb +5 -5
  14. data/lib/selenium/webdriver/edge/service.rb +8 -5
  15. data/lib/selenium/webdriver/firefox/binary.rb +4 -0
  16. data/lib/selenium/webdriver/firefox/extension.rb +13 -11
  17. data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
  18. data/lib/selenium/webdriver/firefox/profile.rb +3 -3
  19. data/lib/selenium/webdriver/firefox/service.rb +8 -5
  20. data/lib/selenium/webdriver/phantomjs/service.rb +8 -6
  21. data/lib/selenium/webdriver/remote/bridge.rb +4 -0
  22. data/lib/selenium/webdriver/remote/capabilities.rb +1 -1
  23. data/lib/selenium/webdriver/remote/commands.rb +2 -1
  24. data/lib/selenium/webdriver/remote/http/common.rb +2 -2
  25. data/lib/selenium/webdriver/remote/w3c_bridge.rb +8 -8
  26. data/lib/selenium/webdriver/remote/w3c_capabilities.rb +31 -14
  27. data/lib/selenium/webdriver/remote/w3c_commands.rb +1 -1
  28. data/lib/selenium/webdriver/safari/resources/client.js +266 -214
  29. data/lib/selenium/webdriver/safari/server.rb +6 -4
  30. data/lib/selenium/webdriver/support/select.rb +12 -2
  31. data/selenium-webdriver.gemspec +1 -2
  32. metadata +18 -29
  33. data/lib/selenium/webdriver/common/json_helper.rb +0 -53
@@ -44,7 +44,7 @@ module Selenium
44
44
  end
45
45
 
46
46
  def send(command)
47
- json = WebDriver.json_dump(command)
47
+ json = JSON.generate(command)
48
48
  puts ">>> #{json}" if $DEBUG
49
49
 
50
50
  frame = WebSocket::Frame::Outgoing::Server.new(:version => @version, :data => json, :type => :text)
@@ -76,7 +76,7 @@ module Selenium
76
76
 
77
77
  puts "<<< #{msg}" if $DEBUG
78
78
 
79
- WebDriver.json_load msg.to_s
79
+ JSON.parse msg.to_s
80
80
  end
81
81
 
82
82
  def ws_uri
@@ -101,7 +101,9 @@ Server: safaridriver-ruby
101
101
 
102
102
  HEADERS.gsub!("\n", "\r\n")
103
103
 
104
- HTML = "<!DOCTYPE html><script>#{Safari.resource_path.join('client.js').read}</script>"
104
+ def html
105
+ "<!DOCTYPE html><script>#{Safari.resource_path.join('client.js').read}</script>"
106
+ end
105
107
 
106
108
  def process_initial_http_request
107
109
  http = @server.accept
@@ -121,7 +123,7 @@ Server: safaridriver-ruby
121
123
  else
122
124
  http << HEADERS % [200, 'OK']
123
125
  http << "\r\n\r\n"
124
- http << HTML
126
+ http << html
125
127
  http.close
126
128
  end
127
129
  end
@@ -117,6 +117,7 @@ module Selenium
117
117
  #
118
118
  # @param [:text, :index, :value] how How to find the option
119
119
  # @param [String] what What value to find the option by.
120
+ # @raise [Error::UnsupportedOperationError] if the element does not support multiple selections.
120
121
  #
121
122
  # @see Select#select_by
122
123
  #
@@ -181,7 +182,7 @@ module Selenium
181
182
  raise Error::NoSuchElementError, "cannot locate element with index: #{index.inspect}"
182
183
  end
183
184
 
184
- select_options opts
185
+ select_option opts.first
185
186
  end
186
187
 
187
188
  def select_by_value(value)
@@ -195,6 +196,9 @@ module Selenium
195
196
  end
196
197
 
197
198
  def deselect_by_text(text)
199
+ unless multiple?
200
+ raise Error::UnsupportedOperationError, 'you may only deselect option of a multi-select'
201
+ end
198
202
  opts = find_by_text text
199
203
 
200
204
  if opts.empty?
@@ -205,6 +209,9 @@ module Selenium
205
209
  end
206
210
 
207
211
  def deselect_by_value(value)
212
+ unless multiple?
213
+ raise Error::UnsupportedOperationError, 'you may only deselect option of a multi-select'
214
+ end
208
215
  opts = find_by_value value
209
216
 
210
217
  if opts.empty?
@@ -215,13 +222,16 @@ module Selenium
215
222
  end
216
223
 
217
224
  def deselect_by_index(index)
225
+ unless multiple?
226
+ raise Error::UnsupportedOperationError, 'you may only deselect option of a multi-select'
227
+ end
218
228
  opts = find_by_index index
219
229
 
220
230
  if opts.empty?
221
231
  raise Error::NoSuchElementError, "cannot locate option with index: #{index}"
222
232
  end
223
233
 
224
- deselect_options opts
234
+ deselect_option opts.first
225
235
  end
226
236
 
227
237
  private
@@ -7,7 +7,7 @@ end
7
7
 
8
8
  Gem::Specification.new do |s|
9
9
  s.name = "selenium-webdriver"
10
- s.version = "2.52.0"
10
+ s.version = "2.53.0"
11
11
 
12
12
  s.authors = ["Jari Bakken"]
13
13
  s.email = "jari.bakken@gmail.com"
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
22
22
  s.files = Dir[root + '/**/*'].reject { |e| e =~ /ruby\.iml|build\.desc/ }.map { |e| e.sub(root + '/', '') }
23
23
  s.require_paths = ["lib"]
24
24
 
25
- s.add_runtime_dependency "multi_json", ["~> 1.0"]
26
25
  s.add_runtime_dependency "rubyzip", ["~> 1.0"]
27
26
  s.add_runtime_dependency "childprocess", ["~> 0.5"]
28
27
  s.add_runtime_dependency "websocket", ["~> 1.0"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: selenium-webdriver
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.52.0
5
+ version: 2.53.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jari Bakken
@@ -10,11 +10,11 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2016-02-12 00:00:00 -06:00
13
+ date: 2016-03-15 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: multi_json
17
+ name: rubyzip
18
18
  prerelease: false
19
19
  requirement: &id001 !ruby/object:Gem::Requirement
20
20
  none: false
@@ -24,65 +24,54 @@ dependencies:
24
24
  version: "1.0"
25
25
  type: :runtime
26
26
  version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: rubyzip
29
- prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
31
- none: false
32
- requirements:
33
- - - ~>
34
- - !ruby/object:Gem::Version
35
- version: "1.0"
36
- type: :runtime
37
- version_requirements: *id002
38
27
  - !ruby/object:Gem::Dependency
39
28
  name: childprocess
40
29
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
30
+ requirement: &id002 !ruby/object:Gem::Requirement
42
31
  none: false
43
32
  requirements:
44
33
  - - ~>
45
34
  - !ruby/object:Gem::Version
46
35
  version: "0.5"
47
36
  type: :runtime
48
- version_requirements: *id003
37
+ version_requirements: *id002
49
38
  - !ruby/object:Gem::Dependency
50
39
  name: websocket
51
40
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
41
+ requirement: &id003 !ruby/object:Gem::Requirement
53
42
  none: false
54
43
  requirements:
55
44
  - - ~>
56
45
  - !ruby/object:Gem::Version
57
46
  version: "1.0"
58
47
  type: :runtime
59
- version_requirements: *id004
48
+ version_requirements: *id003
60
49
  - !ruby/object:Gem::Dependency
61
50
  name: rspec
62
51
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
52
+ requirement: &id004 !ruby/object:Gem::Requirement
64
53
  none: false
65
54
  requirements:
66
55
  - - ~>
67
56
  - !ruby/object:Gem::Version
68
57
  version: 2.99.0
69
58
  type: :development
70
- version_requirements: *id005
59
+ version_requirements: *id004
71
60
  - !ruby/object:Gem::Dependency
72
61
  name: rack
73
62
  prerelease: false
74
- requirement: &id006 !ruby/object:Gem::Requirement
63
+ requirement: &id005 !ruby/object:Gem::Requirement
75
64
  none: false
76
65
  requirements:
77
66
  - - ~>
78
67
  - !ruby/object:Gem::Version
79
68
  version: "1.0"
80
69
  type: :development
81
- version_requirements: *id006
70
+ version_requirements: *id005
82
71
  - !ruby/object:Gem::Dependency
83
72
  name: ci_reporter
84
73
  prerelease: false
85
- requirement: &id007 !ruby/object:Gem::Requirement
74
+ requirement: &id006 !ruby/object:Gem::Requirement
86
75
  none: false
87
76
  requirements:
88
77
  - - ~>
@@ -92,11 +81,11 @@ dependencies:
92
81
  - !ruby/object:Gem::Version
93
82
  version: 1.6.2
94
83
  type: :development
95
- version_requirements: *id007
84
+ version_requirements: *id006
96
85
  - !ruby/object:Gem::Dependency
97
86
  name: webmock
98
87
  prerelease: false
99
- requirement: &id008 !ruby/object:Gem::Requirement
88
+ requirement: &id007 !ruby/object:Gem::Requirement
100
89
  none: false
101
90
  requirements:
102
91
  - - ~>
@@ -106,18 +95,18 @@ dependencies:
106
95
  - !ruby/object:Gem::Version
107
96
  version: 1.7.5
108
97
  type: :development
109
- version_requirements: *id008
98
+ version_requirements: *id007
110
99
  - !ruby/object:Gem::Dependency
111
100
  name: yard
112
101
  prerelease: false
113
- requirement: &id009 !ruby/object:Gem::Requirement
102
+ requirement: &id008 !ruby/object:Gem::Requirement
114
103
  none: false
115
104
  requirements:
116
105
  - - ~>
117
106
  - !ruby/object:Gem::Version
118
107
  version: 0.8.7
119
108
  type: :development
120
- version_requirements: *id009
109
+ version_requirements: *id008
121
110
  description: WebDriver is a tool for writing automated tests of websites. It aims to mimic the behaviour of a real user, and as such interacts with the HTML of the application.
122
111
  email: jari.bakken@gmail.com
123
112
  executables: []
@@ -129,6 +118,7 @@ extra_rdoc_files: []
129
118
  files:
130
119
  - CHANGES
131
120
  - Gemfile
121
+ - Gemfile.lock
132
122
  - LICENSE
133
123
  - README.md
134
124
  - selenium-webdriver.gemspec
@@ -171,7 +161,6 @@ files:
171
161
  - lib/selenium/webdriver/common/element.rb
172
162
  - lib/selenium/webdriver/common/error.rb
173
163
  - lib/selenium/webdriver/common/file_reaper.rb
174
- - lib/selenium/webdriver/common/json_helper.rb
175
164
  - lib/selenium/webdriver/common/keyboard.rb
176
165
  - lib/selenium/webdriver/common/keys.rb
177
166
  - lib/selenium/webdriver/common/log_entry.rb
@@ -1,53 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # Licensed to the Software Freedom Conservancy (SFC) under one
4
- # or more contributor license agreements. See the NOTICE file
5
- # distributed with this work for additional information
6
- # regarding copyright ownership. The SFC licenses this file
7
- # to you under the Apache License, Version 2.0 (the
8
- # "License"); you may not use this file except in compliance
9
- # with the License. You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing,
14
- # software distributed under the License is distributed on an
15
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- # KIND, either express or implied. See the License for the
17
- # specific language governing permissions and limitations
18
- # under the License.
19
-
20
- module Selenium
21
- module WebDriver
22
- module JsonHelper
23
-
24
- # ActiveSupport may define Object#load, so we can't use MultiJson.respond_to? here
25
- sm = MultiJson.singleton_methods.map { |e| e.to_sym }
26
-
27
- if sm.include? :load
28
- # @api private
29
- def json_load(obj)
30
- MultiJson.load(obj)
31
- end
32
- else
33
- # @api private
34
- def json_load(obj)
35
- MultiJson.decode(obj)
36
- end
37
- end
38
-
39
- if sm.include? :dump
40
- # @api private
41
- def json_dump(obj)
42
- MultiJson.dump(obj)
43
- end
44
- else
45
- # @api private
46
- def json_dump(obj)
47
- MultiJson.encode(obj)
48
- end
49
- end
50
-
51
- end # JsonHelper
52
- end # WebDriver
53
- end # Selenium