selenium-webdriver 3.11.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 116cec563ad6fc188c24fadbd5eeed9d0c8179bb
4
- data.tar.gz: b2ee6e5ea4189b0f815d345719b43c66b1102ac2
3
+ metadata.gz: 1e7904f54f32f24552260a185e59adae4f08dc44
4
+ data.tar.gz: 4983d6f3db1619a3cad1686235dc2fc3bcbe9857
5
5
  SHA512:
6
- metadata.gz: 6fb54537ff802701151d82cabad8799ba687aa7d86843c70593a0ad3febf588994012e0a3ba5a691f3cea59d71a76a6bd9dd21b77817719f24ce7bff715c917e
7
- data.tar.gz: 494d9b22454a4c49f1e61f8933fe9bd0c88c57520f80be5af20e877ec2db182d30fa22e46eb5e91f8a7ca672f6bac56c041c84edde8376058c487d3dbb7ca31c
6
+ metadata.gz: fd65f44de6eb59601fee4816fb1439f7fc3d225291a6662a5d845f5b9d33fbadd2dd718c09b9a7a430be3068630c939e15040c3e99ae711eab572ceb4ccb8f3e
7
+ data.tar.gz: da56a1181546a60011aa218c40adba5b08fa66ef00082bb7fb3c74f147b4ea73f8d79b8b93ce19449d5ac5bfc6d3174a18e7034cbb653450475f771fdc4dfb07
data/CHANGES CHANGED
@@ -1,10 +1,32 @@
1
+ 3.12.0 (2018-05-08)
2
+ ===================
3
+
4
+ Ruby:
5
+ * Added User-Agent header to requests from Selenium to give remote
6
+ ends more visibility into distribution of clients (thanks @sah)
7
+ * Added Selenium::WebDriver::VERSION constant (thanks @sah)
8
+ * Added changelog link to RubyGems page
9
+ * Fixed a bug when requests were sent with empty Content-Type,
10
+ which should instead be application/json (issue #5615 and #5659)
11
+ * Fixed a bug when failed connection attempt was retried without
12
+ grace period for remote to resolve its problem (thanks @amckinley42)
13
+ * Fixed a bug with accidentally removed HasNetworkConnection driver extension
14
+
15
+ Chrome:
16
+ * Fixed a bug when deprecation message for using Chrome extensions
17
+ was incorrectly shown (thanks @treby)
18
+
19
+ Safari:
20
+ * Added support getting permissions via Driver#permissions
21
+ * Added support setting permissions via Driver#permissions=
22
+ * Added support enabling web inspector via Driver#attach_debugger
23
+
1
24
  3.11.0 (2018-03-11)
2
25
  ===================
3
26
 
4
27
  Ruby:
5
28
  * No changes in Ruby bindings for this release
6
29
 
7
-
8
30
  3.10.0 (2018-03-02)
9
31
  ===================
10
32
 
@@ -24,6 +24,7 @@ require 'set'
24
24
 
25
25
  require 'selenium/webdriver/common'
26
26
  require 'selenium/webdriver/atoms'
27
+ require 'selenium/webdriver/version'
27
28
 
28
29
  module Selenium
29
30
  module WebDriver
@@ -78,7 +78,7 @@ module Selenium
78
78
  extensions.concat(@encoded_extensions)
79
79
 
80
80
  opts = {directory: @directory || layout_on_disk}
81
- opts[:extensions] = extensions if extensions
81
+ opts[:extensions] = extensions if extensions.any?
82
82
  opts
83
83
  end
84
84
 
@@ -56,6 +56,8 @@ require 'selenium/webdriver/common/driver_extensions/has_touch_screen'
56
56
  require 'selenium/webdriver/common/driver_extensions/has_remote_status'
57
57
  require 'selenium/webdriver/common/driver_extensions/has_network_conditions'
58
58
  require 'selenium/webdriver/common/driver_extensions/has_network_connection'
59
+ require 'selenium/webdriver/common/driver_extensions/has_permissions'
60
+ require 'selenium/webdriver/common/driver_extensions/has_debugger'
59
61
  require 'selenium/webdriver/common/driver_extensions/uploads_files'
60
62
  require 'selenium/webdriver/common/driver_extensions/has_addons'
61
63
  require 'selenium/webdriver/common/interactions/interactions'
@@ -0,0 +1,40 @@
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 HasDebugger
22
+
23
+ #
24
+ # Attaches debugger to session.
25
+ #
26
+ # @example
27
+ # driver.attach_debugger
28
+ # driver.execute_script('debugger')
29
+ #
30
+ # @return [Hash]
31
+ #
32
+
33
+ def attach_debugger
34
+ @bridge.attach_debugger
35
+ end
36
+
37
+ end # HasDebugger
38
+ end # DriverExtensions
39
+ end # WebDriver
40
+ end # Selenium
@@ -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 HasPermissions
22
+
23
+ #
24
+ # Returns permissions.
25
+ #
26
+ # @return [Hash]
27
+ #
28
+
29
+ def permissions
30
+ @bridge.permissions
31
+ end
32
+
33
+ #
34
+ # Sets permissions.
35
+ #
36
+ # @example
37
+ # driver.permissions = {'getUserMedia' => true}
38
+ #
39
+ # @param [Hash<Symbol, Boolean>] permissions
40
+ #
41
+
42
+ def permissions=(permissions)
43
+ @bridge.permissions = permissions
44
+ end
45
+
46
+ end # HasPermissions
47
+ end # DriverExtensions
48
+ end # WebDriver
49
+ end # Selenium
@@ -22,7 +22,11 @@ module Selenium
22
22
  class Common
23
23
  MAX_REDIRECTS = 20 # same as chromium/gecko
24
24
  CONTENT_TYPE = 'application/json'.freeze
25
- DEFAULT_HEADERS = {'Accept' => CONTENT_TYPE}.freeze
25
+ DEFAULT_HEADERS = {
26
+ 'Accept' => CONTENT_TYPE,
27
+ 'Content-Type' => "#{CONTENT_TYPE}; charset=UTF-8",
28
+ 'User-Agent' => "selenium/#{WebDriver::VERSION} (ruby #{Platform.os})"
29
+ }.freeze
26
30
 
27
31
  attr_accessor :timeout
28
32
  attr_writer :server_url
@@ -46,7 +50,6 @@ module Selenium
46
50
 
47
51
  if command_hash
48
52
  payload = JSON.generate(command_hash)
49
- headers['Content-Type'] = "#{CONTENT_TYPE}; charset=utf-8"
50
53
  headers['Content-Length'] = payload.bytesize.to_s if [:post, :put].include?(verb)
51
54
 
52
55
  WebDriver.logger.info(" >>> #{url} | #{payload}")
@@ -84,7 +84,7 @@ module Selenium
84
84
  # http://msdn.microsoft.com/en-us/library/aa560610%28v=bts.20%29.aspx
85
85
  raise if retries >= MAX_RETRIES
86
86
  retries += 1
87
-
87
+ sleep 2
88
88
  retry
89
89
  rescue Errno::EADDRNOTAVAIL => ex
90
90
  # a retry is sometimes needed when the port becomes temporarily unavailable
@@ -15,6 +15,7 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
+ require 'selenium/webdriver/safari/bridge'
18
19
  require 'selenium/webdriver/safari/driver'
19
20
  require 'selenium/webdriver/safari/service'
20
21
 
@@ -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 Safari
21
+ module Bridge
22
+
23
+ # https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/WebDriverEndpointDoc/Commands/Commands.html
24
+ COMMANDS = {
25
+ get_permissions: [:get, '/session/:session_id/apple/permissions'.freeze],
26
+ set_permissions: [:post, '/session/:session_id/apple/permissions'.freeze],
27
+ attach_debugger: [:post, '/session/:session_id/apple/attach_debugger'.freeze]
28
+ }.freeze
29
+
30
+ def commands(command)
31
+ COMMANDS[command] || super
32
+ end
33
+
34
+ def permissions
35
+ execute(:get_permissions)['permissions']
36
+ end
37
+
38
+ def permissions=(permissions)
39
+ execute :set_permissions, {}, {permissions: permissions}
40
+ end
41
+
42
+ def attach_debugger
43
+ execute :attach_debugger, {}, {}
44
+ end
45
+
46
+ end # Bridge
47
+ end # Safari
48
+ end # WebDriver
49
+ end # Selenium
@@ -25,6 +25,8 @@ module Selenium
25
25
  #
26
26
 
27
27
  class Driver < WebDriver::Driver
28
+ include DriverExtensions::HasDebugger
29
+ include DriverExtensions::HasPermissions
28
30
  include DriverExtensions::TakesScreenshot
29
31
 
30
32
  def initialize(opts = {})
@@ -42,6 +44,8 @@ module Selenium
42
44
 
43
45
  listener = opts.delete(:listener)
44
46
  @bridge = Remote::Bridge.handshake(opts)
47
+ @bridge.extend Bridge
48
+
45
49
  super(@bridge, listener: listener)
46
50
  end
47
51
 
@@ -0,0 +1,22 @@
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
+ VERSION = '3.12.0'.freeze
21
+ end # WebDriver
22
+ end # Selenium
@@ -1,18 +1,27 @@
1
1
  root = File.expand_path(File.dirname(__FILE__))
2
2
  raise "cwd must be #{root} when reading gemspec" if root != Dir.pwd
3
3
 
4
+ $LOAD_PATH.push(File.expand_path('lib', root))
5
+ require 'selenium/webdriver/version'
6
+
4
7
  Gem::Specification.new do |s|
5
8
  s.name = 'selenium-webdriver'
6
- s.version = '3.11.0'
9
+ s.version = Selenium::WebDriver::VERSION
7
10
 
8
11
  s.authors = ['Alex Rodionov', 'Titus Fortner']
9
12
  s.email = ['p0deje@gmail.com', 'titusfortner@gmail.com']
10
- s.description = 'WebDriver is a tool for writing automated tests of websites.
11
- It aims to mimic the behaviour of a real user, and as such interacts with the
12
- HTML of the application.'
13
+
13
14
  s.summary = 'The next generation developer focused tool for automated testing of webapps'
14
- s.homepage = 'https://github.com/seleniumhq/selenium'
15
+ s.description = 'WebDriver is a tool for writing automated tests of websites. ' \
16
+ 'It aims to mimic the behaviour of a real user, ' \
17
+ 'and as such interacts with the HTML of the application.'
18
+
15
19
  s.license = 'Apache-2.0'
20
+ s.homepage = 'https://github.com/SeleniumHQ/selenium'
21
+ s.metadata = {
22
+ 'changelog_uri' => 'https://github.com/SeleniumHQ/selenium/blob/master/rb/CHANGES',
23
+ 'source_code_uri' => 'https://github.com/SeleniumHQ/selenium/tree/master/rb'
24
+ }
16
25
 
17
26
  s.required_rubygems_version = Gem::Requirement.new('> 1.3.1') if s.respond_to? :required_rubygems_version=
18
27
  s.required_ruby_version = Gem::Requirement.new('>= 2.0')
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.11.0
4
+ version: 3.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Rodionov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-12 00:00:00.000000000 Z
12
+ date: 2018-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement
@@ -109,10 +109,9 @@ dependencies:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
111
  version: 0.50.0
112
- description: |-
113
- WebDriver is a tool for writing automated tests of websites.
114
- It aims to mimic the behaviour of a real user, and as such interacts with the
115
- HTML of the application.
112
+ description: WebDriver is a tool for writing automated tests of websites. It aims
113
+ to mimic the behaviour of a real user, and as such interacts with the HTML of the
114
+ application.
116
115
  email:
117
116
  - p0deje@gmail.com
118
117
  - titusfortner@gmail.com
@@ -141,9 +140,11 @@ files:
141
140
  - lib/selenium/webdriver/common/bridge_helper.rb
142
141
  - lib/selenium/webdriver/common/driver.rb
143
142
  - lib/selenium/webdriver/common/driver_extensions/has_addons.rb
143
+ - lib/selenium/webdriver/common/driver_extensions/has_debugger.rb
144
144
  - lib/selenium/webdriver/common/driver_extensions/has_location.rb
145
145
  - lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb
146
146
  - lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb
147
+ - lib/selenium/webdriver/common/driver_extensions/has_permissions.rb
147
148
  - lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb
148
149
  - lib/selenium/webdriver/common/driver_extensions/has_session_id.rb
149
150
  - lib/selenium/webdriver/common/driver_extensions/has_touch_screen.rb
@@ -231,6 +232,7 @@ files:
231
232
  - lib/selenium/webdriver/remote/w3c/capabilities.rb
232
233
  - lib/selenium/webdriver/remote/w3c/commands.rb
233
234
  - lib/selenium/webdriver/safari.rb
235
+ - lib/selenium/webdriver/safari/bridge.rb
234
236
  - lib/selenium/webdriver/safari/driver.rb
235
237
  - lib/selenium/webdriver/safari/service.rb
236
238
  - lib/selenium/webdriver/support.rb
@@ -240,11 +242,14 @@ files:
240
242
  - lib/selenium/webdriver/support/escaper.rb
241
243
  - lib/selenium/webdriver/support/event_firing_bridge.rb
242
244
  - lib/selenium/webdriver/support/select.rb
245
+ - lib/selenium/webdriver/version.rb
243
246
  - selenium-webdriver.gemspec
244
- homepage: https://github.com/seleniumhq/selenium
247
+ homepage: https://github.com/SeleniumHQ/selenium
245
248
  licenses:
246
249
  - Apache-2.0
247
- metadata: {}
250
+ metadata:
251
+ changelog_uri: https://github.com/SeleniumHQ/selenium/blob/master/rb/CHANGES
252
+ source_code_uri: https://github.com/SeleniumHQ/selenium/tree/master/rb
248
253
  post_install_message:
249
254
  rdoc_options: []
250
255
  require_paths: