webdrivers 5.0.0 → 5.1.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/webdrivers/chrome_finder.rb +13 -3
- data/lib/webdrivers/edge_finder.rb +11 -12
- data/lib/webdrivers/edgedriver.rb +2 -7
- data/lib/webdrivers/geckodriver.rb +1 -1
- data/lib/webdrivers/railtie.rb +0 -1
- data/lib/webdrivers/version.rb +1 -1
- data/spec/webdrivers/chromedriver_spec.rb +2 -2
- data/spec/webdrivers/edgedriver_spec.rb +8 -9
- data/spec/webdrivers/geckodriver_spec.rb +34 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 366e7e4f90b5bd54a2f5f1cbe2df6074f6cad56026502ec6d9f0ceddd4a269c8
|
4
|
+
data.tar.gz: '09439fb8a5f6e550ab6562891e1b11daa43f13694e21740e8e7141916b02641d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7b1a0e9791e985716d7e887c23e7346752218c108ac1bc11c1833c087ecfbf43f5eab718968ab6ddbce1b313740af6d8758a9568cb058edcbe06ae08583a44d
|
7
|
+
data.tar.gz: 98fe42f01271e270387795e0dd30ec943d5c0937d413f8ddedf96946ac00b7686a9cf2aee4ce78e52510ff08e2dffb963dd6a282c9abb6267d003a2704f9cfe1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# 5.1.0 (2022-09-19)
|
2
|
+
* Improve error messages (#232, thanks dan-jensen)
|
3
|
+
* Fix circular require bug with railtie (#233, thanks amatsuda)
|
4
|
+
* Support downloading correct geckodriver on Apple silicon (#234 thanks stephannv)
|
5
|
+
* Update linux locations for Chrome to latest chromedriver finder (thanks entretechno-jeremiah)
|
6
|
+
* Add support for Microsoft Edge on Linux (#236)
|
7
|
+
|
1
8
|
# 5.0.0 (2021-10-19)
|
2
9
|
* Require Selenium 4+
|
3
10
|
* Remove custom Logger and use the one in Selenium 4
|
@@ -8,7 +8,7 @@ module Webdrivers
|
|
8
8
|
class << self
|
9
9
|
def version
|
10
10
|
version = send("#{System.platform}_version", location)
|
11
|
-
raise VersionError, 'Failed to
|
11
|
+
raise VersionError, 'Failed to determine Chrome version.' if version.nil? || version.empty?
|
12
12
|
|
13
13
|
Webdrivers.logger.debug "Browser version: #{version}"
|
14
14
|
version[/\d+\.\d+\.\d+\.\d+/] # Google Chrome 73.0.3683.75 -> 73.0.3683.75
|
@@ -18,7 +18,7 @@ module Webdrivers
|
|
18
18
|
chrome_bin = user_defined_location || send("#{System.platform}_location")
|
19
19
|
return chrome_bin unless chrome_bin.nil?
|
20
20
|
|
21
|
-
raise BrowserNotFound, 'Failed to
|
21
|
+
raise BrowserNotFound, 'Failed to determine Chrome binary location.'
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
@@ -90,7 +90,17 @@ module Webdrivers
|
|
90
90
|
def linux_location
|
91
91
|
return wsl_location if System.wsl_v1?
|
92
92
|
|
93
|
-
directories = %w[
|
93
|
+
directories = %w[
|
94
|
+
/usr/local/sbin
|
95
|
+
/usr/local/bin
|
96
|
+
/usr/sbin
|
97
|
+
/usr/bin
|
98
|
+
/sbin
|
99
|
+
/bin
|
100
|
+
/snap/bin
|
101
|
+
/opt/google/chrome
|
102
|
+
/opt/chromium.org/chromium
|
103
|
+
]
|
94
104
|
files = %w[google-chrome chrome chromium chromium-browser]
|
95
105
|
|
96
106
|
directories.each do |dir|
|
@@ -69,18 +69,17 @@ module Webdrivers
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def linux_location
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
raise 'Default location not yet known'
|
72
|
+
directories = %w[/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /snap/bin /opt/microsoft/edge]
|
73
|
+
files = %w[microsoft-edge microsoft-edge-beta microsoft-edge-dev]
|
74
|
+
|
75
|
+
directories.each do |dir|
|
76
|
+
files.each do |file|
|
77
|
+
option = "#{dir}/#{file}"
|
78
|
+
return option if File.exist?(option)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
nil
|
84
83
|
end
|
85
84
|
|
86
85
|
def win_version(location)
|
@@ -22,8 +22,7 @@ module Webdrivers
|
|
22
22
|
#
|
23
23
|
# @return [String]
|
24
24
|
def base_url
|
25
|
-
|
26
|
-
'https://msedgedriver.azureedge.net/'
|
25
|
+
'https://msedgedriver.azureedge.net'
|
27
26
|
end
|
28
27
|
|
29
28
|
private
|
@@ -76,14 +75,10 @@ module Webdrivers
|
|
76
75
|
false
|
77
76
|
end
|
78
77
|
|
79
|
-
def linux_compatible?(driver_version)
|
80
|
-
System.platform == 'linux' && driver_version >= normalize_version('89.0.731.0')
|
81
|
-
end
|
82
|
-
|
83
78
|
def driver_filename(driver_version)
|
84
79
|
if System.platform == 'win' || System.wsl_v1?
|
85
80
|
"win#{System.bitsize}" # 32 or 64-bit
|
86
|
-
elsif
|
81
|
+
elsif System.platform == 'linux'
|
87
82
|
'linux64'
|
88
83
|
elsif System.platform == 'mac'
|
89
84
|
# Determine M1 or Intel architecture
|
data/lib/webdrivers/railtie.rb
CHANGED
data/lib/webdrivers/version.rb
CHANGED
@@ -168,8 +168,8 @@ describe Webdrivers::Chromedriver do
|
|
168
168
|
end
|
169
169
|
|
170
170
|
it 'raises VersionError for beta version' do
|
171
|
-
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('
|
172
|
-
msg = 'Unable to find latest point release version for
|
171
|
+
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('999.0.0')
|
172
|
+
msg = 'Unable to find latest point release version for 999.0.0. '\
|
173
173
|
'You appear to be using a non-production version of Chrome. '\
|
174
174
|
'Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` '\
|
175
175
|
'to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html'
|
@@ -6,7 +6,6 @@ describe Webdrivers::Edgedriver do
|
|
6
6
|
let(:edgedriver) { described_class }
|
7
7
|
|
8
8
|
before do
|
9
|
-
skip 'Edge is not yet supported on Linux' if Webdrivers::System.platform == 'linux'
|
10
9
|
edgedriver.remove
|
11
10
|
end
|
12
11
|
|
@@ -123,19 +122,19 @@ describe Webdrivers::Edgedriver do
|
|
123
122
|
|
124
123
|
context 'when required version is 0' do
|
125
124
|
it 'downloads the latest version' do
|
126
|
-
allow(edgedriver).to receive(:latest_version).and_return(Gem::Version.new('
|
125
|
+
allow(edgedriver).to receive(:latest_version).and_return(Gem::Version.new('98.0.1089.1'))
|
127
126
|
edgedriver.required_version = 0
|
128
127
|
edgedriver.update
|
129
|
-
expect(edgedriver.current_version.version).to eq('
|
128
|
+
expect(edgedriver.current_version.version).to eq('98.0.1089.1')
|
130
129
|
end
|
131
130
|
end
|
132
131
|
|
133
132
|
context 'when required version is nil' do
|
134
133
|
it 'downloads the latest version' do
|
135
|
-
allow(edgedriver).to receive(:latest_version).and_return(Gem::Version.new('
|
134
|
+
allow(edgedriver).to receive(:latest_version).and_return(Gem::Version.new('98.0.1089.1'))
|
136
135
|
edgedriver.required_version = nil
|
137
136
|
edgedriver.update
|
138
|
-
expect(edgedriver.current_version.version).to eq('
|
137
|
+
expect(edgedriver.current_version.version).to eq('98.0.1089.1')
|
139
138
|
end
|
140
139
|
end
|
141
140
|
end
|
@@ -165,11 +164,11 @@ describe Webdrivers::Edgedriver do
|
|
165
164
|
end
|
166
165
|
|
167
166
|
it 'raises VersionError for beta version' do
|
168
|
-
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('
|
169
|
-
msg = 'Unable to find latest point release version for
|
167
|
+
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('999.0.0')
|
168
|
+
msg = 'Unable to find latest point release version for 999.0.0. '\
|
170
169
|
'You appear to be using a non-production version of Edge. '\
|
171
170
|
'Please set `Webdrivers::Edgedriver.required_version = <desired driver version>` '\
|
172
|
-
'to a known edgedriver version: Can not reach https://msedgedriver.azureedge.net
|
171
|
+
'to a known edgedriver version: Can not reach https://msedgedriver.azureedge.net'
|
173
172
|
|
174
173
|
expect { edgedriver.latest_version }.to raise_exception(Webdrivers::VersionError, msg)
|
175
174
|
end
|
@@ -178,7 +177,7 @@ describe Webdrivers::Edgedriver do
|
|
178
177
|
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('77.0.9999')
|
179
178
|
msg = 'Unable to find latest point release version for 77.0.9999. '\
|
180
179
|
'Please set `Webdrivers::Edgedriver.required_version = <desired driver version>` '\
|
181
|
-
'to a known edgedriver version: Can not reach https://msedgedriver.azureedge.net
|
180
|
+
'to a known edgedriver version: Can not reach https://msedgedriver.azureedge.net'
|
182
181
|
|
183
182
|
expect { edgedriver.latest_version }.to raise_exception(Webdrivers::VersionError, msg)
|
184
183
|
end
|
@@ -92,6 +92,40 @@ describe Webdrivers::Geckodriver do
|
|
92
92
|
msg = /Net::HTTPServerException: 404 "Not Found"/
|
93
93
|
expect { geckodriver.update }.to raise_error(StandardError, msg)
|
94
94
|
end
|
95
|
+
|
96
|
+
context 'when platform is Apple Sillicon' do
|
97
|
+
it 'downloads aarch64 binary' do
|
98
|
+
allow(Webdrivers::System).to receive(:platform).and_return('mac')
|
99
|
+
allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(true)
|
100
|
+
base = 'https://github.com/mozilla/geckodriver/releases/download'
|
101
|
+
binary = 'geckodriver-v0.31.0-macos-aarch64.tar.gz'
|
102
|
+
url = "#{base}/v0.31.0/#{binary}"
|
103
|
+
|
104
|
+
allow(Webdrivers::System).to receive(:download).with(url, geckodriver.driver_path)
|
105
|
+
|
106
|
+
geckodriver.required_version = '0.31.0'
|
107
|
+
geckodriver.update
|
108
|
+
|
109
|
+
expect(Webdrivers::System).to have_received(:download).with(url, geckodriver.driver_path)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
context 'when platform isn\'t Apple Sillicon' do
|
114
|
+
it 'downloads default binary' do
|
115
|
+
allow(Webdrivers::System).to receive(:platform).and_return('mac')
|
116
|
+
allow(Webdrivers::System).to receive(:apple_m1_architecture?).and_return(false)
|
117
|
+
base = 'https://github.com/mozilla/geckodriver/releases/download'
|
118
|
+
binary = 'geckodriver-v0.31.0-macos.tar.gz'
|
119
|
+
url = "#{base}/v0.31.0/#{binary}"
|
120
|
+
|
121
|
+
allow(Webdrivers::System).to receive(:download).with(url, geckodriver.driver_path)
|
122
|
+
|
123
|
+
geckodriver.required_version = '0.31.0'
|
124
|
+
geckodriver.update
|
125
|
+
|
126
|
+
expect(Webdrivers::System).to have_received(:download).with(url, geckodriver.driver_path)
|
127
|
+
end
|
128
|
+
end
|
95
129
|
end
|
96
130
|
|
97
131
|
describe '#current_version' do
|
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: 5.
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Titus Fortner
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-09-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ffi
|
@@ -212,8 +212,8 @@ licenses:
|
|
212
212
|
metadata:
|
213
213
|
bug_tracker_uri: https://github.com/titusfortner/webdrivers/issues
|
214
214
|
changelog_uri: https://github.com/titusfortner/webdrivers/blob/master/CHANGELOG.md
|
215
|
-
documentation_uri: https://www.rubydoc.info/gems/webdrivers/5.
|
216
|
-
source_code_uri: https://github.com/titusfortner/webdrivers/tree/v5.
|
215
|
+
documentation_uri: https://www.rubydoc.info/gems/webdrivers/5.1.0
|
216
|
+
source_code_uri: https://github.com/titusfortner/webdrivers/tree/v5.1.0
|
217
217
|
post_install_message:
|
218
218
|
rdoc_options: []
|
219
219
|
require_paths:
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
229
|
- !ruby/object:Gem::Version
|
230
230
|
version: '0'
|
231
231
|
requirements: []
|
232
|
-
rubygems_version: 3.
|
232
|
+
rubygems_version: 3.3.7
|
233
233
|
signing_key:
|
234
234
|
specification_version: 4
|
235
235
|
summary: Easy download and use of browser drivers.
|