webdrivers 3.3.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +13 -1
- data/lib/webdrivers/common.rb +13 -8
- data/lib/webdrivers/mswebdriver.rb +15 -0
- data/spec/geckodriver_spec.rb +1 -1
- data/spec/mswebdriver_spec.rb +1 -1
- data/webdrivers.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e797daab91623814fcd8a1d5ab92edccf0be063
|
4
|
+
data.tar.gz: d0f7101c1f88765150d2fdba2dd47974f2adb298
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 221dfa39597516e7f7dd876f52095dc87af490f72f82cb417776ccd86918609656d408eebf9dd2768523a5cad2f24d378b71bad534e09909c31501ab96e44c01
|
7
|
+
data.tar.gz: 2f2c9732436f84bdc4a1a2a21fd6d693d5722eb50af22aeffb18f68fd34c9365b0bf3abae0585f3beb758f4ce603a66ca74a59877c66ade2f274c01e95885239
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,7 @@ in your Gemfile:
|
|
24
24
|
|
25
25
|
in your project:
|
26
26
|
|
27
|
-
`require 'webdrivers'
|
27
|
+
`require 'webdrivers'`
|
28
28
|
|
29
29
|
If there is a proxy between you and the Internet then you will need to configure
|
30
30
|
the gem to use the proxy. You can do this by calling the `configure` method.
|
@@ -38,6 +38,18 @@ Webdrivers.configure do |config|
|
|
38
38
|
end
|
39
39
|
````
|
40
40
|
|
41
|
+
**Note when using Microsoft Edge**:
|
42
|
+
|
43
|
+
After updating Microsoft Edge on Windows 10, you will need to delete the existing binary (`%USERPROFILE%/.webdrivers/MicrosoftWebDriver.exe`) to
|
44
|
+
to be able to download the latest version through this gem.
|
45
|
+
|
46
|
+
This is because `MicrosoftWebDriver.exe` is not backwards compatible and it does not have an argument to retrieve
|
47
|
+
the current version. We work around this limitation by querying the current Edge version from the registry and
|
48
|
+
fetching the corresponding binary IF a file does not already exist. If a file does exist, the gem assumes it is the
|
49
|
+
expected version and skips the download process.
|
50
|
+
|
51
|
+
If you continue with the outdated binary, Selenium will throw an error: `unable to connect to MicrosoftWebDriver localhost:17556`.
|
52
|
+
|
41
53
|
# License
|
42
54
|
|
43
55
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT),
|
data/lib/webdrivers/common.rb
CHANGED
@@ -9,24 +9,23 @@ module Webdrivers
|
|
9
9
|
unless site_available?
|
10
10
|
return current.nil? ? nil : binary
|
11
11
|
end
|
12
|
-
released
|
13
|
-
location
|
14
|
-
binary_exists = File.exists?(location)
|
12
|
+
released = latest()
|
13
|
+
location = binary()
|
15
14
|
|
16
|
-
return location if released.nil? &&
|
15
|
+
return location if released.nil? && File.exists?(binary) # Newer not found, keep current
|
17
16
|
|
18
|
-
if released.nil?
|
17
|
+
if released.nil? # Can't find latest and no existing binary
|
19
18
|
msg = "Unable to find the latest version of #{file_name}; try downloading manually from #{base_url} and place in #{install_dir}"
|
20
19
|
raise StandardError, msg
|
21
20
|
end
|
22
21
|
|
23
|
-
if
|
22
|
+
if correct_binary?
|
24
23
|
Webdrivers.logger.debug "Expected webdriver version found"
|
25
24
|
return location
|
26
25
|
end
|
27
26
|
|
28
|
-
remove
|
29
|
-
download
|
27
|
+
remove # Remove outdated exe
|
28
|
+
download # Fetch latest
|
30
29
|
end
|
31
30
|
|
32
31
|
def latest
|
@@ -178,6 +177,12 @@ module Webdrivers
|
|
178
177
|
def install_dir
|
179
178
|
File.expand_path(File.join(ENV['HOME'], ".webdrivers")).tap { |dir| FileUtils.mkdir_p dir }
|
180
179
|
end
|
180
|
+
|
181
|
+
# Already have latest version downloaded?
|
182
|
+
def correct_binary?
|
183
|
+
latest == current && File.exists?(binary)
|
184
|
+
end
|
185
|
+
|
181
186
|
end
|
182
187
|
end
|
183
188
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Webdrivers
|
2
2
|
class MSWebdriver < Common
|
3
|
+
|
3
4
|
class << self
|
4
5
|
|
5
6
|
def current
|
@@ -18,6 +19,13 @@ module Webdrivers
|
|
18
19
|
build.to_i
|
19
20
|
end
|
20
21
|
|
22
|
+
# Webdriver binaries for Microsoft Edge are not backwards compatible.
|
23
|
+
# For this reason, instead of downloading the latest binary we download the correct one for the
|
24
|
+
# currently installed browser version.
|
25
|
+
def download(version = current)
|
26
|
+
super
|
27
|
+
end
|
28
|
+
|
21
29
|
private
|
22
30
|
|
23
31
|
def normalize(string)
|
@@ -40,6 +48,13 @@ module Webdrivers
|
|
40
48
|
def base_url
|
41
49
|
'https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/'
|
42
50
|
end
|
51
|
+
|
52
|
+
# Assume we have the latest if file exists since MicrosoftWebdriver.exe does not have an
|
53
|
+
# argument to check the current version.
|
54
|
+
def correct_binary?
|
55
|
+
File.exist?(binary)
|
56
|
+
end
|
57
|
+
|
43
58
|
end
|
44
59
|
end
|
45
60
|
end
|
data/spec/geckodriver_spec.rb
CHANGED
@@ -7,7 +7,7 @@ describe Webdrivers::Geckodriver do
|
|
7
7
|
it 'raises exception if unable to get latest geckodriver and no geckodriver present' do
|
8
8
|
geckodriver.remove
|
9
9
|
allow(geckodriver).to receive(:latest).and_return(nil)
|
10
|
-
msg = /^Unable to find the latest version of geckodriver
|
10
|
+
msg = /^Unable to find the latest version of geckodriver(.exe)?; try downloading manually from (.*)?and place in (.*)?\.webdrivers$/
|
11
11
|
expect { geckodriver.update }.to raise_exception StandardError, msg
|
12
12
|
end
|
13
13
|
|
data/spec/mswebdriver_spec.rb
CHANGED
data/webdrivers.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "webdrivers"
|
6
|
-
s.version = "3.3.
|
6
|
+
s.version = "3.3.1"
|
7
7
|
s.authors = ["Titus Fortner"]
|
8
8
|
s.email = ["titusfortner@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/titusfortner/webdrivers"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webdrivers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Titus Fortner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04
|
11
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|