selenium-webdriver 3.12.0 → 3.13.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: 1e7904f54f32f24552260a185e59adae4f08dc44
4
- data.tar.gz: 4983d6f3db1619a3cad1686235dc2fc3bcbe9857
3
+ metadata.gz: a6e897acdd72c3d8d0e246985f91744dc7e6ea1e
4
+ data.tar.gz: 0fa878705e019d7af8ff26a10405ea3ebf38f5ae
5
5
  SHA512:
6
- metadata.gz: fd65f44de6eb59601fee4816fb1439f7fc3d225291a6662a5d845f5b9d33fbadd2dd718c09b9a7a430be3068630c939e15040c3e99ae711eab572ceb4ccb8f3e
7
- data.tar.gz: da56a1181546a60011aa218c40adba5b08fa66ef00082bb7fb3c74f147b4ea73f8d79b8b93ce19449d5ac5bfc6d3174a18e7034cbb653450475f771fdc4dfb07
6
+ metadata.gz: 9a20b24a1b499183f484a9efb95ba3cc58697eefc5d873d4f06a6189e70b0b56dac1409446bbd7854bd282451ab7d97d7811750593c4a6d0a25cd86ba2554dfc
7
+ data.tar.gz: 399698c8a1800e9e28c2f63cdf85c7f98ca24ec8aa3afb8b06a795de1111deb61b9e74276d961302d773469797f1caeece98add4f3051e9c5862ff8e3753456e
data/CHANGES CHANGED
@@ -1,3 +1,14 @@
1
+ 3.13.0 (2018-06-25)
2
+ ===================
3
+
4
+ Ruby:
5
+ * Address warnings for redefined methods and uninitialized instance variables
6
+
7
+ Chrome:
8
+ * Chrome options capabilities updated to use goog:chromeOptions.
9
+ Note that Selenium now requires ChromeDriver v2.31 at minimum.
10
+ * Added ability to tell headless Chrome to save files using Driver#download_path= (thanks @pelly)
11
+
1
12
  3.12.0 (2018-05-08)
2
13
  ===================
3
14
 
data/LICENSE CHANGED
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright 2016 Software Freedom Conservancy (SFC)
190
+ Copyright 2018 Software Freedom Conservancy (SFC)
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
@@ -22,7 +22,8 @@ module Selenium
22
22
 
23
23
  COMMANDS = {
24
24
  get_network_conditions: [:get, '/session/:session_id/chromium/network_conditions'.freeze],
25
- set_network_conditions: [:post, '/session/:session_id/chromium/network_conditions'.freeze]
25
+ set_network_conditions: [:post, '/session/:session_id/chromium/network_conditions'.freeze],
26
+ send_command: [:post, '/session/:session_id/chromium/send_command'.freeze]
26
27
  }.freeze
27
28
 
28
29
  def commands(command)
@@ -33,6 +34,10 @@ module Selenium
33
34
  execute :get_network_conditions
34
35
  end
35
36
 
37
+ def send_command(command_params)
38
+ execute :send_command, {}, command_params
39
+ end
40
+
36
41
  def network_conditions=(conditions)
37
42
  execute :set_network_conditions, {}, {network_conditions: conditions}
38
43
  end
@@ -29,6 +29,7 @@ module Selenium
29
29
  include DriverExtensions::HasTouchScreen
30
30
  include DriverExtensions::HasWebStorage
31
31
  include DriverExtensions::TakesScreenshot
32
+ include DriverExtensions::DownloadsFiles
32
33
 
33
34
  def initialize(opts = {})
34
35
  opts[:desired_capabilities] = create_capabilities(opts)
@@ -102,7 +103,7 @@ module Selenium
102
103
  end
103
104
 
104
105
  options = options.as_json
105
- caps[:chrome_options] = options unless options.empty?
106
+ caps.merge!(options) unless options.empty?
106
107
 
107
108
  caps[:proxy] = opts.delete(:proxy) if opts.key?(:proxy)
108
109
  caps[:proxy] ||= opts.delete('proxy') if opts.key?('proxy')
@@ -22,6 +22,8 @@ module Selenium
22
22
  attr_reader :args, :prefs, :options, :emulation, :extensions, :encoded_extensions
23
23
  attr_accessor :binary
24
24
 
25
+ KEY = 'goog:chromeOptions'.freeze
26
+
25
27
  #
26
28
  # Create a new Options instance.
27
29
  #
@@ -175,7 +177,8 @@ module Selenium
175
177
  opts[:extensions] = extensions if extensions.any?
176
178
  opts[:mobileEmulation] = @emulation unless @emulation.empty?
177
179
  opts[:prefs] = @prefs unless @prefs.empty?
178
- opts
180
+
181
+ {KEY => opts}
179
182
  end
180
183
  end # Options
181
184
  end # Chrome
@@ -77,7 +77,7 @@ module Selenium
77
77
 
78
78
  extensions.concat(@encoded_extensions)
79
79
 
80
- opts = {directory: @directory || layout_on_disk}
80
+ opts = {directory: directory || layout_on_disk}
81
81
  opts[:extensions] = extensions if extensions.any?
82
82
  opts
83
83
  end
@@ -50,6 +50,7 @@ require 'selenium/webdriver/common/html5/session_storage'
50
50
  require 'selenium/webdriver/common/driver_extensions/takes_screenshot'
51
51
  require 'selenium/webdriver/common/driver_extensions/rotatable'
52
52
  require 'selenium/webdriver/common/driver_extensions/has_web_storage'
53
+ require 'selenium/webdriver/common/driver_extensions/downloads_files'
53
54
  require 'selenium/webdriver/common/driver_extensions/has_location'
54
55
  require 'selenium/webdriver/common/driver_extensions/has_session_id'
55
56
  require 'selenium/webdriver/common/driver_extensions/has_touch_screen'
@@ -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 DriverExtensions
21
+ module DownloadsFiles
22
+
23
+ #
24
+ # Sets download path for Chromium.
25
+ #
26
+ # @param [String] path
27
+ #
28
+
29
+ def download_path=(path)
30
+ params = {
31
+ 'cmd' => 'Page.setDownloadBehavior',
32
+ 'params' => {
33
+ 'behavior' => 'allow',
34
+ 'downloadPath' => path
35
+ }
36
+ }
37
+ @bridge.send_command(params)
38
+ end
39
+
40
+ end # DownloadsFiles
41
+ end # DriverExtensions
42
+ end # WebDriver
43
+ end # Selenium
@@ -129,7 +129,7 @@ module Selenium
129
129
  end
130
130
 
131
131
  def process_running?
132
- @process && @process.alive?
132
+ defined?(@process) && @process && @process.alive?
133
133
  end
134
134
 
135
135
  def process_exited?
@@ -37,10 +37,13 @@ module Selenium
37
37
  }.freeze
38
38
 
39
39
  DEFAULTS.each_key do |key|
40
- define_method key do
41
- @capabilities.fetch(key)
40
+ if key != :javascript_enabled
41
+ define_method key do
42
+ @capabilities.fetch(key)
43
+ end
42
44
  end
43
45
 
46
+ next if key == :proxy
44
47
  define_method "#{key}=" do |value|
45
48
  @capabilities[key] = value
46
49
  end
@@ -60,6 +60,7 @@ module Selenium
60
60
  @capabilities.fetch(key)
61
61
  end
62
62
 
63
+ next if key == :proxy
63
64
  define_method "#{key}=" do |value|
64
65
  @capabilities[key] = value
65
66
  end
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Selenium
19
19
  module WebDriver
20
- VERSION = '3.12.0'.freeze
20
+ VERSION = '3.13.0'.freeze
21
21
  end # WebDriver
22
22
  end # Selenium
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.12.0
4
+ version: 3.13.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-05-08 00:00:00.000000000 Z
12
+ date: 2018-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement
@@ -139,6 +139,7 @@ files:
139
139
  - lib/selenium/webdriver/common/alert.rb
140
140
  - lib/selenium/webdriver/common/bridge_helper.rb
141
141
  - lib/selenium/webdriver/common/driver.rb
142
+ - lib/selenium/webdriver/common/driver_extensions/downloads_files.rb
142
143
  - lib/selenium/webdriver/common/driver_extensions/has_addons.rb
143
144
  - lib/selenium/webdriver/common/driver_extensions/has_debugger.rb
144
145
  - lib/selenium/webdriver/common/driver_extensions/has_location.rb