webdrivers 3.8.1 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +18 -9
- data/.travis.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +1 -1
- data/README.md +28 -24
- data/Rakefile +2 -0
- data/lib/webdrivers.rb +0 -22
- data/lib/webdrivers/chromedriver.rb +65 -59
- data/lib/webdrivers/common.rb +101 -167
- data/lib/webdrivers/geckodriver.rb +45 -18
- data/lib/webdrivers/iedriver.rb +26 -5
- data/lib/webdrivers/mswebdriver.rb +45 -49
- data/lib/webdrivers/network.rb +58 -0
- data/lib/webdrivers/system.rb +151 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/webdrivers/chromedriver_spec.rb +197 -83
- data/spec/webdrivers/geckodriver_spec.rb +181 -37
- data/spec/webdrivers/i_edriver_spec.rb +171 -20
- data/spec/webdrivers/ms_webdriver_spec.rb +17 -13
- data/spec/webdrivers_proxy_support_spec.rb +2 -2
- data/webdrivers.gemspec +3 -2
- metadata +20 -5
- data/lib/webdrivers/selenium.rb +0 -40
@@ -5,22 +5,26 @@ require 'spec_helper'
|
|
5
5
|
describe Webdrivers::MSWebdriver do
|
6
6
|
let(:mswebdriver) { described_class }
|
7
7
|
|
8
|
-
it '
|
9
|
-
|
10
|
-
allow(mswebdriver).to receive(:desired_version).and_return(mswebdriver.latest_version)
|
11
|
-
expect(File.exist?(mswebdriver.download)).to be true
|
12
|
-
end
|
8
|
+
it 'gives deprecation for using it' do
|
9
|
+
msg = /WARN Webdrivers Microsoft WebDriver for the Edge browser is no longer supported by Webdrivers gem/
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
if Selenium::WebDriver::VERSION > '3.141.0'
|
12
|
+
expect { Selenium::WebDriver::Edge::Service.driver_path }.to output(msg).to_stdout_from_any_process
|
13
|
+
else
|
14
|
+
expect { Selenium::WebDriver::Edge.driver_path }.to output(msg).to_stdout_from_any_process
|
15
|
+
end
|
17
16
|
end
|
18
17
|
|
19
|
-
|
20
|
-
|
18
|
+
it 'does not give deprecation when set to ignore' do
|
19
|
+
described_class.ignore = true
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
service = instance_double(Selenium::WebDriver::Service, host: '', start: nil, uri: '')
|
22
|
+
bridge = instance_double(Selenium::WebDriver::Remote::Bridge, create_session: nil, session_id: '')
|
23
|
+
|
24
|
+
allow(Selenium::WebDriver::Service).to receive(:new).and_return(service)
|
25
|
+
allow(Selenium::WebDriver::Remote::Bridge).to receive(:new).and_return(bridge)
|
26
|
+
allow(Selenium::WebDriver::Remote::W3C::Bridge).to receive(:new)
|
27
|
+
|
28
|
+
expect { Selenium::WebDriver.for :edge }.not_to output.to_stdout_from_any_process
|
25
29
|
end
|
26
30
|
end
|
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
class FakeDriver < Webdrivers::Common
|
6
6
|
def self.http_object
|
7
|
-
http
|
7
|
+
Webdrivers::Network.http
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -48,6 +48,6 @@ describe Webdrivers do
|
|
48
48
|
it 'raises an exception when net_http_ssl_fix is called.' do
|
49
49
|
err = 'Webdrivers.net_http_ssl_fix is no longer available.' \
|
50
50
|
' Please see https://github.com/titusfortner/webdrivers#ssl_connect-errors.'
|
51
|
-
expect { described_class.net_http_ssl_fix }.to raise_error(
|
51
|
+
expect { described_class.net_http_ssl_fix }.to raise_error(RuntimeError, err)
|
52
52
|
end
|
53
53
|
end
|
data/webdrivers.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('../lib', __dir__)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'webdrivers'
|
7
|
-
s.version = '3.
|
7
|
+
s.version = '3.9.0'
|
8
8
|
s.authors = ['Titus Fortner', 'Lakshya Kapoor']
|
9
9
|
s.email = %w[titusfortner@gmail.com kapoorlakshya@gmail.com]
|
10
10
|
s.homepage = 'https://github.com/titusfortner/webdrivers'
|
@@ -18,9 +18,10 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.require_paths = ['lib']
|
19
19
|
|
20
20
|
s.add_development_dependency 'ffi', '~> 1.0' # For selenium-webdriver on Windows
|
21
|
-
s.add_development_dependency 'rake', '~>
|
21
|
+
s.add_development_dependency 'rake', '~> 12.0'
|
22
22
|
s.add_development_dependency 'rspec', '~> 3.0'
|
23
23
|
s.add_development_dependency 'rubocop', '~>0.66'
|
24
|
+
s.add_development_dependency 'rubocop-performance'
|
24
25
|
s.add_development_dependency 'rubocop-rspec', '~>1.32'
|
25
26
|
s.add_development_dependency 'simplecov', '~>0.16'
|
26
27
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webdrivers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Titus Fortner
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-05-
|
12
|
+
date: 2019-05-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '12.0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '12.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,6 +67,20 @@ dependencies:
|
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0.66'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rubocop-performance
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
70
84
|
- !ruby/object:Gem::Dependency
|
71
85
|
name: rubocop-rspec
|
72
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,7 +177,8 @@ files:
|
|
163
177
|
- lib/webdrivers/iedriver.rb
|
164
178
|
- lib/webdrivers/logger.rb
|
165
179
|
- lib/webdrivers/mswebdriver.rb
|
166
|
-
- lib/webdrivers/
|
180
|
+
- lib/webdrivers/network.rb
|
181
|
+
- lib/webdrivers/system.rb
|
167
182
|
- spec/spec_helper.rb
|
168
183
|
- spec/webdrivers/chromedriver_spec.rb
|
169
184
|
- spec/webdrivers/geckodriver_spec.rb
|
data/lib/webdrivers/selenium.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'selenium-webdriver'
|
4
|
-
|
5
|
-
# v3.151.59 and higher
|
6
|
-
if ::Selenium::WebDriver::Service.respond_to? :driver_path=
|
7
|
-
::Selenium::WebDriver::Chrome::Service.driver_path = proc { ::Webdrivers::Chromedriver.update }
|
8
|
-
::Selenium::WebDriver::Firefox::Service.driver_path = proc { ::Webdrivers::Geckodriver.update }
|
9
|
-
::Selenium::WebDriver::Edge::Service.driver_path = proc { ::Webdrivers::MSWebdriver.update }
|
10
|
-
::Selenium::WebDriver::IE::Service.driver_path = proc { ::Webdrivers::IEdriver.update }
|
11
|
-
else
|
12
|
-
# v3.141.0 and lower
|
13
|
-
module Selenium
|
14
|
-
module WebDriver
|
15
|
-
module Chrome
|
16
|
-
def self.driver_path
|
17
|
-
@driver_path ||= Webdrivers::Chromedriver.update
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
module Firefox
|
22
|
-
def self.driver_path
|
23
|
-
@driver_path ||= Webdrivers::Geckodriver.update
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
module Edge
|
28
|
-
def self.driver_path
|
29
|
-
@driver_path ||= Webdrivers::MSWebdriver.update
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
module IE
|
34
|
-
def self.driver_path
|
35
|
-
@driver_path ||= Webdrivers::IEdriver.update
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|