selenium-webdriver 3.8.0 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 040d77515f5ec4c62675327ab517eec003fbead5a3062766036e81bb9e44412b
4
- data.tar.gz: d032a845a6bfa1819b0baddb61e93b2185d03623e4834fa55b1fa1090ea5829e
2
+ SHA1:
3
+ metadata.gz: 4de4171f1c01dacf1c8f143f742fe0fee1b011b9
4
+ data.tar.gz: 970370fe12cfc9cb0a5c241521c96f8cca968c52
5
5
  SHA512:
6
- metadata.gz: ea59ab603478f2713683e681a9d112673e6d0ce54bd7fab0711550cdee256527ddc9b7cc9c0bd1dae248f00274b73f4583365b28ede303f9961b4ffae737545e
7
- data.tar.gz: 35c08a797df512637253014872e7262aa30ba676b2ee0fd4849175b074a8aaed4640c876ce1aa9da932a7e48ba7f085348b845551015aff4dde7611142f431d5
6
+ metadata.gz: 23b922cf527ea641ea9ee4941fb2f39cdea614b41a025a88730a4e104c24b6d4de316e7f13d262c2b31952cf5336c223b5e2923e987e13f48c2fd40ec6fa1c58
7
+ data.tar.gz: b9f234b46090ae9674fc315b1248a56bb5a1ad806ad77d707713d95b133ea6d42b5f9f13348d3e71cab08575b76163b27a05d870057797acec2e01b22a52a756
data/CHANGES CHANGED
@@ -1,3 +1,21 @@
1
+ 3.9.0 (2018-02-06)
2
+ ==================
3
+
4
+ Ruby:
5
+ * Fixed a bug when omitted capabilities caused NoMethodError (issue #5185)
6
+ * Fixed a bug when getting page source in W3C dialect caused WebDriverError (thanks @KazuCocoa)
7
+ * Fixed a bug when getting backtrace of server error would case NoMethodError (thanks @mcking49)
8
+ * Updated YARD to ~> 0.9.11
9
+ * Updated rubyzip to ~> 1.2 (thanks @michaelglass)
10
+
11
+ Chrome:
12
+ * Added support for getting network conditions via Driver#network_conditions
13
+ * Added support for setting network conditions via Driver#network_conditions=
14
+ * Added support to allow driver respond with custom error codes (issue #5376)
15
+
16
+ Firefox:
17
+ * Improved GeckoDriver binary lookup mechanism (issue #5240)
18
+
1
19
  3.8.0 (2017-12-01)
2
20
  ==================
3
21
 
data/README.md CHANGED
@@ -16,7 +16,7 @@ and has been tested to work on MRI (2.0 through 2.2),
16
16
 
17
17
  ## License
18
18
 
19
- Copyright 2009-2017 Software Freedom Conservancy
19
+ Copyright 2009-2018 Software Freedom Conservancy
20
20
 
21
21
  Licensed to the Software Freedom Conservancy (SFC) under one
22
22
  or more contributor license agreements. See the NOTICE file
@@ -17,6 +17,7 @@
17
17
 
18
18
  require 'net/http'
19
19
 
20
+ require 'selenium/webdriver/chrome/bridge'
20
21
  require 'selenium/webdriver/chrome/service'
21
22
  require 'selenium/webdriver/chrome/driver'
22
23
  require 'selenium/webdriver/chrome/profile'
@@ -0,0 +1,43 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ module Selenium
19
+ module WebDriver
20
+ module Chrome
21
+ module Bridge
22
+
23
+ COMMANDS = {
24
+ get_network_conditions: [:get, '/session/:session_id/chromium/network_conditions'.freeze],
25
+ set_network_conditions: [:post, '/session/:session_id/chromium/network_conditions'.freeze]
26
+ }.freeze
27
+
28
+ def commands(command)
29
+ COMMANDS[command] || super
30
+ end
31
+
32
+ def network_conditions
33
+ execute :get_network_conditions
34
+ end
35
+
36
+ def network_conditions=(conditions)
37
+ execute :set_network_conditions, {}, {network_conditions: conditions}
38
+ end
39
+
40
+ end # Bridge
41
+ end # Chrome
42
+ end # WebDriver
43
+ end # Selenium
@@ -25,6 +25,7 @@ module Selenium
25
25
  #
26
26
 
27
27
  class Driver < WebDriver::Driver
28
+ include DriverExtensions::HasNetworkConditions
28
29
  include DriverExtensions::HasTouchScreen
29
30
  include DriverExtensions::HasWebStorage
30
31
  include DriverExtensions::TakesScreenshot
@@ -44,6 +45,8 @@ module Selenium
44
45
 
45
46
  listener = opts.delete(:listener)
46
47
  @bridge = Remote::Bridge.handshake(opts)
48
+ @bridge.extend Bridge
49
+
47
50
  super(@bridge, listener: listener)
48
51
  end
49
52
 
@@ -54,6 +54,7 @@ require 'selenium/webdriver/common/driver_extensions/has_location'
54
54
  require 'selenium/webdriver/common/driver_extensions/has_session_id'
55
55
  require 'selenium/webdriver/common/driver_extensions/has_touch_screen'
56
56
  require 'selenium/webdriver/common/driver_extensions/has_remote_status'
57
+ require 'selenium/webdriver/common/driver_extensions/has_network_conditions'
57
58
  require 'selenium/webdriver/common/driver_extensions/has_network_connection'
58
59
  require 'selenium/webdriver/common/driver_extensions/uploads_files'
59
60
  require 'selenium/webdriver/common/driver_extensions/has_addons'
@@ -0,0 +1,49 @@
1
+ # Licensed to the Software Freedom Conservancy (SFC) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The SFC licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ module Selenium
19
+ module WebDriver
20
+ module DriverExtensions
21
+ module HasNetworkConditions
22
+
23
+ #
24
+ # Returns network conditions.
25
+ #
26
+ # @return [Hash]
27
+ #
28
+
29
+ def network_conditions
30
+ @bridge.network_conditions
31
+ end
32
+
33
+ #
34
+ # Sets network conditions
35
+ #
36
+ # @param [Hash] conditions
37
+ # @option conditions [Integer] :latency
38
+ # @option conditions [Integer] :throughput
39
+ # @option conditions [Boolean] :offline
40
+ #
41
+
42
+ def network_conditions=(conditions)
43
+ @bridge.network_conditions = conditions
44
+ end
45
+
46
+ end # HasNetworkConditions
47
+ end # DriverExtensions
48
+ end # WebDriver
49
+ end # Selenium
@@ -34,7 +34,7 @@ module Selenium
34
34
  klass_name = code.split(' ').map(&:capitalize).join.sub(/Error$/, '')
35
35
  const_get("#{klass_name}Error")
36
36
  end
37
- rescue NameError
37
+ rescue KeyError, NameError
38
38
  WebDriverError
39
39
  end
40
40
 
@@ -24,7 +24,7 @@ module Selenium
24
24
 
25
25
  class Service < WebDriver::Service
26
26
  DEFAULT_PORT = 4444
27
- @executable = 'geckodriver*'.freeze
27
+ @executable = 'geckodriver'.freeze
28
28
  @missing_text = <<-ERROR.gsub(/\n +| {2,}/, ' ').freeze
29
29
  Unable to find Mozilla geckodriver. Please download the server from
30
30
  https://github.com/mozilla/geckodriver/releases and place it somewhere on your PATH.
@@ -40,13 +40,13 @@ module Selenium
40
40
  # @return [OSS:Bridge, W3C::Bridge]
41
41
  #
42
42
  def self.handshake(**opts)
43
- desired_capabilities = opts.delete(:desired_capabilities)
43
+ desired_capabilities = opts.delete(:desired_capabilities) { Capabilities.new }
44
44
 
45
45
  if desired_capabilities.is_a?(Symbol)
46
- unless Remote::Capabilities.respond_to?(desired_capabilities)
46
+ unless Capabilities.respond_to?(desired_capabilities)
47
47
  raise Error::WebDriverError, "invalid desired capability: #{desired_capabilities.inspect}"
48
48
  end
49
- desired_capabilities = Remote::Capabilities.__send__(desired_capabilities)
49
+ desired_capabilities = Capabilities.__send__(desired_capabilities)
50
50
  end
51
51
 
52
52
  bridge = new(opts)
@@ -77,7 +77,7 @@ module Selenium
77
77
 
78
78
  server_trace = error_payload[STACKTRACE_KEY] ||
79
79
  error_payload[STACKTRACE_KEY.downcase] ||
80
- error_payload['value'][STACKTRACE_KEY]
80
+ (error_payload['value'] && error_payload['value'][STACKTRACE_KEY])
81
81
  return unless server_trace
82
82
 
83
83
  backtrace = case server_trace
@@ -88,7 +88,7 @@ module Selenium
88
88
  # document handling
89
89
  #
90
90
 
91
- get_page_source: [:get, '/session/:session_id/source'.freeze],
91
+ get_page_source: [:get, 'session/:session_id/source'.freeze],
92
92
  execute_script: [:post, 'session/:session_id/execute/sync'.freeze],
93
93
  execute_async_script: [:post, 'session/:session_id/execute/async'.freeze],
94
94
 
@@ -3,7 +3,7 @@ raise "cwd must be #{root} when reading gemspec" if root != Dir.pwd
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'selenium-webdriver'
6
- s.version = '3.8.0'
6
+ s.version = '3.9.0'
7
7
 
8
8
  s.authors = ['Alex Rodionov', 'Titus Fortner']
9
9
  s.email = ['p0deje@gmail.com', 'titusfortner@gmail.com']
@@ -20,12 +20,12 @@ HTML of the application.'
20
20
  s.files = Dir[root + '/**/*'].reject { |e| e =~ /ruby\.iml|build\.desc/ }.map { |e| e.sub(root + '/', '') }
21
21
  s.require_paths = ['lib']
22
22
 
23
- s.add_runtime_dependency 'rubyzip', ['~> 1.0']
23
+ s.add_runtime_dependency 'rubyzip', ['~> 1.2']
24
24
  s.add_runtime_dependency 'childprocess', ['~> 0.5']
25
25
 
26
26
  s.add_development_dependency 'rspec', ['~> 3.0']
27
27
  s.add_development_dependency 'rack', ['~> 1.0']
28
28
  s.add_development_dependency 'webmock', ['~> 2.0']
29
- s.add_development_dependency 'yard', ['~> 0.9.9']
29
+ s.add_development_dependency 'yard', ['~> 0.9.11']
30
30
  s.add_development_dependency 'rubocop', ['~> 0.50.0']
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-12-01 00:00:00.000000000 Z
12
+ date: 2018-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '1.2'
20
20
  name: rubyzip
21
21
  prerelease: false
22
22
  type: :runtime
@@ -24,7 +24,7 @@ dependencies:
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.0'
27
+ version: '1.2'
28
28
  - !ruby/object:Gem::Dependency
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
@@ -86,7 +86,7 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.9.9
89
+ version: 0.9.11
90
90
  name: yard
91
91
  prerelease: false
92
92
  type: :development
@@ -94,7 +94,7 @@ dependencies:
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 0.9.9
97
+ version: 0.9.11
98
98
  - !ruby/object:Gem::Dependency
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
@@ -130,6 +130,7 @@ files:
130
130
  - lib/selenium/webdriver/atoms.rb
131
131
  - lib/selenium/webdriver/atoms/getAttribute.js
132
132
  - lib/selenium/webdriver/chrome.rb
133
+ - lib/selenium/webdriver/chrome/bridge.rb
133
134
  - lib/selenium/webdriver/chrome/driver.rb
134
135
  - lib/selenium/webdriver/chrome/options.rb
135
136
  - lib/selenium/webdriver/chrome/profile.rb
@@ -141,6 +142,7 @@ files:
141
142
  - lib/selenium/webdriver/common/driver.rb
142
143
  - lib/selenium/webdriver/common/driver_extensions/has_addons.rb
143
144
  - lib/selenium/webdriver/common/driver_extensions/has_location.rb
145
+ - lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb
144
146
  - lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb
145
147
  - lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb
146
148
  - lib/selenium/webdriver/common/driver_extensions/has_session_id.rb
@@ -259,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
261
  version: 1.3.1
260
262
  requirements: []
261
263
  rubyforge_project:
262
- rubygems_version: 2.6.13
264
+ rubygems_version: 2.6.14
263
265
  signing_key:
264
266
  specification_version: 4
265
267
  summary: The next generation developer focused tool for automated testing of webapps