webdrivers 4.1.1 → 4.4.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 +3 -2
- data/.travis.yml +11 -11
- data/CHANGELOG.md +26 -2
- data/README.md +8 -10
- data/appveyor.yml +11 -11
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/webdrivers/chrome_finder.rb +38 -2
- data/lib/webdrivers/chromedriver.rb +30 -10
- data/lib/webdrivers/common.rb +10 -5
- data/lib/webdrivers/edge_finder.rb +5 -1
- data/lib/webdrivers/system.rb +29 -2
- data/lib/webdrivers/version.rb +1 -1
- data/spec/webdrivers/chrome_finder_spec.rb +53 -0
- data/spec/webdrivers/chromedriver_spec.rb +14 -9
- data/spec/webdrivers/edgedriver_spec.rb +16 -12
- data/spec/webdrivers/geckodriver_spec.rb +2 -1
- data/spec/webdrivers/i_edriver_spec.rb +2 -1
- data/spec/webdrivers/system_spec.rb +73 -0
- data/support/install_jruby.ps1 +2 -2
- data/support/install_msedge.ps1 +7 -13
- data/webdrivers.gemspec +9 -2
- metadata +19 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f905a3a4839d0f0a56317926d560cab4ee29f98b3d36d4feb1bb671e3f1b23b
|
4
|
+
data.tar.gz: 44ae96f9ba7edfbb2fb1bd1fd7ef319e73643f5a43c0fce59c51e2b94c1a25c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73d60000abc1ad06f692ee556bca7bd57403cde91f2152b5349fda2b0feaa2afb261dd87b1e16f6f8c74e843634b8dbde3da85ed666164920e78163fed764029
|
7
|
+
data.tar.gz: 1c94fde9cafdb1929a3e70ada28c7dfec07cbae6f68220e247ffe62343700c5b3ca2c0556d1d028d4d25b0f6bbd76923c402f1925574ec6f117eb8c4066e6255
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.4.
|
2
|
+
TargetRubyVersion: 2.4.10
|
3
3
|
|
4
4
|
require:
|
5
5
|
- rubocop-rspec
|
@@ -11,7 +11,7 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
11
11
|
Layout/EndOfLine:
|
12
12
|
EnforcedStyle: lf
|
13
13
|
|
14
|
-
|
14
|
+
Layout/LineLength:
|
15
15
|
Max: 120
|
16
16
|
IgnoredPatterns:
|
17
17
|
- '\s+# rubocop:disable'
|
@@ -23,6 +23,7 @@ Metrics/BlockLength:
|
|
23
23
|
Exclude:
|
24
24
|
- 'spec/**/*'
|
25
25
|
- 'lib/webdrivers/tasks/*.rake'
|
26
|
+
- 'webdrivers.gemspec'
|
26
27
|
|
27
28
|
Metrics/ClassLength:
|
28
29
|
Max: 116
|
data/.travis.yml
CHANGED
@@ -8,34 +8,34 @@ addons:
|
|
8
8
|
chrome: stable
|
9
9
|
script: bundle exec rake $RAKE_TASK
|
10
10
|
before_install:
|
11
|
-
- gem update --system
|
12
|
-
- gem
|
11
|
+
- gem update --system -N
|
12
|
+
- gem install bundler -N
|
13
13
|
matrix:
|
14
14
|
include:
|
15
|
-
- rvm: 2.
|
15
|
+
- rvm: 2.4
|
16
16
|
env: RAKE_TASK=spec
|
17
|
-
- rvm: 2.5
|
17
|
+
- rvm: 2.5
|
18
18
|
env: RAKE_TASK=spec
|
19
|
-
- rvm: 2.
|
19
|
+
- rvm: 2.6
|
20
20
|
env: RAKE_TASK=spec
|
21
|
-
- rvm: 2.
|
21
|
+
- rvm: 2.7
|
22
22
|
os: osx
|
23
23
|
env: RAKE_TASK=spec
|
24
|
-
- rvm: 2.
|
24
|
+
- rvm: 2.7
|
25
25
|
env: RAKE_TASK=rubocop
|
26
|
-
- rvm: jruby-9.2.
|
26
|
+
- rvm: jruby-9.2.11.1
|
27
27
|
jdk: openjdk8
|
28
28
|
env: RAKE_TASK=spec
|
29
|
-
- rvm: 2.
|
29
|
+
- rvm: 2.7
|
30
30
|
env: RAKE_TASK=spec
|
31
31
|
gemfile: gemfiles/Gemfile.edge
|
32
32
|
os: osx
|
33
|
-
osx_image:
|
33
|
+
osx_image: xcode11.3
|
34
34
|
addons:
|
35
35
|
chrome: stable
|
36
36
|
homebrew:
|
37
37
|
taps: homebrew/cask-versions
|
38
38
|
casks:
|
39
|
-
- microsoft-edge
|
39
|
+
- microsoft-edge
|
40
40
|
allow_failures:
|
41
41
|
- gemfile: gemfiles/Gemfile.edge
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,27 @@
|
|
1
|
+
### 4.4.0 (2020-05-31)
|
2
|
+
* Implement initial support for WSLv1 ([#172](https://github.com/titusfortner/webdrivers/issues/172)). Thanks G-Rath!
|
3
|
+
* Chrome/Edgedriver - Fix [#171](https://github.com/titusfortner/webdrivers/issues/171) by making sure the cached
|
4
|
+
driver build version matches the browser build version before using it.
|
5
|
+
* Chrome/Edgedriver - Driver version check now matches the driver and browser `major.minor.build` versions instead of just
|
6
|
+
the major version to be fully compliant with the `chromedriver` version selection
|
7
|
+
[document](https://chromedriver.chromium.org/downloads/version-selection).
|
8
|
+
|
9
|
+
### 4.3.0 (2020-04-14)
|
10
|
+
* Add support for Microsoft Edge (Chromium) stable
|
11
|
+
* Drop support for Ruby < 2.4.0
|
12
|
+
|
13
|
+
### 4.2.0 (2019-12-27)
|
14
|
+
* Add support for Microsoft Edge (Chromium) Beta releases ([#155](https://github.com/titusfortner/webdrivers/pull/155))
|
15
|
+
* Use tilde expansion to resolve user's home directory ([#166](https://github.com/titusfortner/webdrivers/pull/161))
|
16
|
+
* Add support for Chromium installed using Snap on Ubuntu ([#163](https://github.com/titusfortner/webdrivers/pull/163)). Thanks Tietew!
|
17
|
+
|
18
|
+
### 4.1.3 (2019-10-07)
|
19
|
+
* Require rubyzip version 1.3.0 or higher to fix [rubyzip#403](https://github.com/rubyzip/rubyzip/pull/403). Thanks rhymes! ([#153](https://github.com/titusfortner/webdrivers/pull/153))
|
20
|
+
* Fix a bug where the file deletion confirmation was printed even when there were no files to delete.
|
21
|
+
|
22
|
+
### 4.1.2 (2019-07-29)
|
23
|
+
* Fix a bug related to raising `BrowserNotFound`.
|
24
|
+
|
1
25
|
### 4.1.1 (2019-07-18)
|
2
26
|
* Raise `BrowserNotFound` if Chrome and Edge binary are not found (issue [#144](https://github.com/titusfortner/webdrivers/issues/144)).
|
3
27
|
|
@@ -9,10 +33,10 @@ and [#93](https://github.com/titusfortner/webdrivers/issues/93))
|
|
9
33
|
* Fix a bug where the user given Chrome binary path via `Selenium::WebDriver::Chrome.path`
|
10
34
|
was not properly escaped (issue [#139](https://github.com/titusfortner/webdrivers/issues/139))
|
11
35
|
* Fix miscellaneous code warnings.
|
12
|
-
*
|
36
|
+
* ~~**Announcement**: As of 06/21/2019, `heroku-buildpack-google-chrome`
|
13
37
|
no longer requires a [workaround](https://github.com/titusfortner/webdrivers/wiki/Heroku-buildpack-google-chrome)
|
14
38
|
to work with this gem. See [heroku-buildpack-google-chrome#73](https://github.com/heroku/heroku-buildpack-google-chrome/pull/73)
|
15
|
-
for more information
|
39
|
+
for more information.~~
|
16
40
|
|
17
41
|
### 4.0.1 (2019-06-12)
|
18
42
|
* Cache time now defaults to 86,400 Seconds (24 hours). Please note the special exception for `chromedriver` in the [README](https://github.com/titusfortner/webdrivers#special-exception-for-chromedriver-and-msedgedriver) (issue [#132](https://github.com/titusfortner/webdrivers/issues/132))
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Run Selenium tests more easily with automatic installation and updates for all s
|
|
13
13
|
* [chromedriver](http://chromedriver.chromium.org/)
|
14
14
|
* [geckodriver](https://github.com/mozilla/geckodriver)
|
15
15
|
* [IEDriverServer](https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver)
|
16
|
-
* [msedgedriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/)
|
16
|
+
* [msedgedriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/)
|
17
17
|
|
18
18
|
## Usage
|
19
19
|
|
@@ -68,7 +68,7 @@ Webdrivers::Geckodriver.required_version = '0.23.0'
|
|
68
68
|
Webdrivers::IEdriver.required_version = '3.14.0'
|
69
69
|
|
70
70
|
# Edge (Chromium)
|
71
|
-
Webdrivers::Edgedriver.required_version
|
71
|
+
Webdrivers::Edgedriver.required_version = '76.0.183.0'
|
72
72
|
```
|
73
73
|
|
74
74
|
You can explicitly trigger the update in your code, but this will happen
|
@@ -92,10 +92,10 @@ variable. **Only set one to avoid confusion**.
|
|
92
92
|
|
93
93
|
##### Special exception for chromedriver and msedgedriver
|
94
94
|
|
95
|
-
Cache time will be respected as long as a driver binary exists and the major versions of
|
96
|
-
the browser and the driver match. For example, if you update Chrome or Edge to v76 and its driver is
|
97
|
-
still at
|
98
|
-
using a compatible version.
|
95
|
+
Cache time will be respected as long as a driver binary exists and the major.minor.build versions of
|
96
|
+
the browser and the driver match. For example, if you update Chrome or Edge to v76.0.123 and its driver is
|
97
|
+
still at v76.0.100, `webdrivers` will ignore the cache time and update the driver to make sure you're
|
98
|
+
using a compatible build version.
|
99
99
|
|
100
100
|
### Proxy
|
101
101
|
|
@@ -217,11 +217,9 @@ variable.
|
|
217
217
|
This is also required if Google Chrome is not installed in its
|
218
218
|
[default location](https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver).
|
219
219
|
|
220
|
-
#####
|
220
|
+
##### Heroku Users
|
221
221
|
|
222
|
-
Follow the specific instructions [here](https://github.com/titusfortner/webdrivers/wiki/Heroku-buildpack-google-chrome) if
|
223
|
-
|
224
|
-
Please note that as of 06/21/2019, [`heroku-buildpack-google-chrome`](https://github.com/heroku/heroku-buildpack-google-chrome/pull/73) no longer requires this workaround.
|
222
|
+
Follow the specific instructions [here](https://github.com/titusfortner/webdrivers/wiki/Heroku-buildpack-google-chrome) if you're using `heroku-buildpack-google-chrome`.
|
225
223
|
|
226
224
|
#### Microsoft Edge (Chromium)
|
227
225
|
|
data/appveyor.yml
CHANGED
@@ -2,30 +2,30 @@ build: off
|
|
2
2
|
cache:
|
3
3
|
- vendor/bundle
|
4
4
|
image:
|
5
|
-
- Visual Studio
|
5
|
+
- Visual Studio 2019
|
6
6
|
environment:
|
7
7
|
matrix:
|
8
|
-
- RUBY_VERSION: Ruby24
|
8
|
+
- RUBY_VERSION: Ruby24-x64
|
9
9
|
RUBY_BIN: ruby
|
10
|
-
RAKE_TASK:
|
10
|
+
RAKE_TASK: rubocop
|
11
11
|
SCRIPT_CONTEXT: bundle exec
|
12
|
-
- RUBY_VERSION: Ruby24
|
12
|
+
- RUBY_VERSION: Ruby24-x64
|
13
13
|
RUBY_BIN: ruby
|
14
|
-
RAKE_TASK:
|
14
|
+
RAKE_TASK: spec
|
15
15
|
SCRIPT_CONTEXT: bundle exec
|
16
|
-
- RUBY_VERSION: Ruby25
|
16
|
+
- RUBY_VERSION: Ruby25-x64
|
17
17
|
RUBY_BIN: ruby
|
18
18
|
RAKE_TASK: spec
|
19
19
|
SCRIPT_CONTEXT: bundle exec
|
20
|
-
- RUBY_VERSION: Ruby26
|
20
|
+
- RUBY_VERSION: Ruby26-x64
|
21
21
|
RUBY_BIN: ruby
|
22
22
|
RAKE_TASK: spec
|
23
23
|
SCRIPT_CONTEXT: bundle exec
|
24
|
-
- RUBY_VERSION: jruby-9.2.
|
24
|
+
- RUBY_VERSION: jruby-9.2.11.1
|
25
25
|
RUBY_BIN: jruby
|
26
26
|
RAKE_TASK: spec
|
27
27
|
SCRIPT_CONTEXT: jruby -G -S
|
28
|
-
- RUBY_VERSION: Ruby26
|
28
|
+
- RUBY_VERSION: Ruby26-x64
|
29
29
|
RUBY_BIN: ruby
|
30
30
|
RAKE_TASK: spec
|
31
31
|
SCRIPT_CONTEXT: bundle exec
|
@@ -34,8 +34,8 @@ install:
|
|
34
34
|
- ps: if ($env:RUBY_BIN -eq 'jruby') { support\install_jruby.ps1 }
|
35
35
|
- ps: support\install_msedge.ps1
|
36
36
|
- set PATH=C:\%RUBY_VERSION%\bin;%PATH%
|
37
|
-
- '%RUBY_BIN% -S gem update --system'
|
38
|
-
- '%RUBY_BIN% -S gem install bundler'
|
37
|
+
- '%RUBY_BIN% -S gem update --system -N'
|
38
|
+
- '%RUBY_BIN% -S gem install bundler -N'
|
39
39
|
- '%RUBY_BIN% -S bundle install'
|
40
40
|
before_test:
|
41
41
|
- '%RUBY_BIN% -v'
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'webdrivers'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -46,6 +46,30 @@ module Webdrivers
|
|
46
46
|
return option if File.exist?(option)
|
47
47
|
end
|
48
48
|
end
|
49
|
+
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
|
53
|
+
def wsl_location
|
54
|
+
_, drive, user = ENV['PATH'].match(%r{/([a-z])/Users/([^/:]+)/AppData/}).to_a
|
55
|
+
|
56
|
+
roots = [
|
57
|
+
"#{drive}:\\Users\\#{user}\\AppData\\Local",
|
58
|
+
"#{drive}:\\Program Files (x86)",
|
59
|
+
"#{drive}:\\Program Files"
|
60
|
+
]
|
61
|
+
|
62
|
+
directories = %w[Google\\Chrome\\Application Chromium\\Application]
|
63
|
+
file = 'chrome.exe'
|
64
|
+
|
65
|
+
directories.each do |dir|
|
66
|
+
roots.each do |root|
|
67
|
+
option = System.to_wsl_path("#{root}\\#{dir}\\#{file}")
|
68
|
+
return option if File.exist?(option)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
nil
|
49
73
|
end
|
50
74
|
|
51
75
|
def mac_location
|
@@ -59,10 +83,14 @@ module Webdrivers
|
|
59
83
|
return option if File.exist?(option)
|
60
84
|
end
|
61
85
|
end
|
86
|
+
|
87
|
+
nil
|
62
88
|
end
|
63
89
|
|
64
90
|
def linux_location
|
65
|
-
|
91
|
+
return wsl_location if System.wsl?
|
92
|
+
|
93
|
+
directories = %w[/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /snap/bin /opt/google/chrome]
|
66
94
|
files = %w[google-chrome chrome chromium chromium-browser]
|
67
95
|
|
68
96
|
directories.each do |dir|
|
@@ -71,13 +99,21 @@ module Webdrivers
|
|
71
99
|
return option if File.exist?(option)
|
72
100
|
end
|
73
101
|
end
|
102
|
+
|
103
|
+
nil
|
74
104
|
end
|
75
105
|
|
76
106
|
def win_version(location)
|
77
|
-
System.call("powershell (Get-ItemProperty '#{location}').VersionInfo.ProductVersion")&.strip
|
107
|
+
System.call("powershell.exe \"(Get-ItemProperty '#{location}').VersionInfo.ProductVersion\"")&.strip
|
108
|
+
end
|
109
|
+
|
110
|
+
def wsl_version(location)
|
111
|
+
win_version(System.to_win32_path(location))
|
78
112
|
end
|
79
113
|
|
80
114
|
def linux_version(location)
|
115
|
+
return wsl_version(location) if System.wsl?
|
116
|
+
|
81
117
|
System.call(location, '--product-version')&.strip
|
82
118
|
end
|
83
119
|
|
@@ -29,9 +29,14 @@ module Webdrivers
|
|
29
29
|
def latest_version
|
30
30
|
@latest_version ||= begin
|
31
31
|
# Versions before 70 do not have a LATEST_RELEASE file
|
32
|
-
return normalize_version('2.41') if
|
32
|
+
return normalize_version('2.41') if browser_build_version < normalize_version('70')
|
33
33
|
|
34
|
-
|
34
|
+
# Cache check
|
35
|
+
# Cached version should exist and be compatible with the current browser version.
|
36
|
+
# Otherwise, fetch the latest compatible driver.
|
37
|
+
latest_applicable = with_cache(file_name,
|
38
|
+
current_build_version,
|
39
|
+
browser_build_version) { latest_point_release(browser_build_version) }
|
35
40
|
|
36
41
|
Webdrivers.logger.debug "Latest version available: #{latest_applicable}"
|
37
42
|
normalize_version(latest_applicable)
|
@@ -80,7 +85,7 @@ module Webdrivers
|
|
80
85
|
end
|
81
86
|
|
82
87
|
def file_name
|
83
|
-
System.platform == 'win' ? 'chromedriver.exe' : 'chromedriver'
|
88
|
+
System.platform == 'win' || System.wsl? ? 'chromedriver.exe' : 'chromedriver'
|
84
89
|
end
|
85
90
|
|
86
91
|
def download_url
|
@@ -92,24 +97,39 @@ module Webdrivers
|
|
92
97
|
normalize_version(required_version)
|
93
98
|
end
|
94
99
|
|
95
|
-
file_name = System.platform == 'win' ? 'win32' : "#{System.platform}64"
|
100
|
+
file_name = System.platform == 'win' || System.wsl? ? 'win32' : "#{System.platform}64"
|
96
101
|
url = "#{base_url}/#{version}/chromedriver_#{file_name}.zip"
|
97
102
|
Webdrivers.logger.debug "chromedriver URL: #{url}"
|
98
103
|
@download_url = url
|
99
104
|
end
|
100
105
|
|
101
|
-
# Returns
|
106
|
+
# Returns major.minor.build version from the currently installed chromedriver version
|
102
107
|
#
|
103
108
|
# @example
|
104
|
-
# 73.0.3683.
|
105
|
-
def
|
106
|
-
|
107
|
-
|
109
|
+
# 73.0.3683.68 (major.minor.build.patch) -> 73.0.3683 (major.minor.build)
|
110
|
+
def current_build_version
|
111
|
+
build_ver = if current_version.nil? # Driver not found
|
112
|
+
nil
|
113
|
+
else
|
114
|
+
current_version.segments[0..2].join('.')
|
115
|
+
end
|
116
|
+
normalize_version(build_ver)
|
108
117
|
end
|
109
118
|
|
119
|
+
# Returns major.minor.build version from the currently installed Chrome version
|
120
|
+
#
|
121
|
+
# @example
|
122
|
+
# 73.0.3683.75 (major.minor.build.patch) -> 73.0.3683 (major.minor.build)
|
123
|
+
def browser_build_version
|
124
|
+
normalize_version(browser_version.segments[0..2].join('.'))
|
125
|
+
end
|
126
|
+
alias chrome_build_version browser_build_version
|
127
|
+
|
128
|
+
# Returns true if an executable driver binary exists
|
129
|
+
# and its build version matches the browser build version
|
110
130
|
def sufficient_binary?
|
111
131
|
super && current_version && (current_version < normalize_version('70.0.3538') ||
|
112
|
-
|
132
|
+
current_build_version == browser_build_version)
|
113
133
|
end
|
114
134
|
end
|
115
135
|
end
|
data/lib/webdrivers/common.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rubygems/package'
|
4
|
-
require 'zip'
|
5
4
|
require 'webdrivers/logger'
|
6
5
|
require 'webdrivers/network'
|
7
6
|
require 'webdrivers/system'
|
@@ -22,7 +21,7 @@ module Webdrivers
|
|
22
21
|
end
|
23
22
|
|
24
23
|
DEFAULT_CACHE_TIME = 86_400 # 24 hours
|
25
|
-
DEFAULT_INSTALL_DIR = File.expand_path(
|
24
|
+
DEFAULT_INSTALL_DIR = File.expand_path('~/.webdrivers')
|
26
25
|
|
27
26
|
class << self
|
28
27
|
attr_accessor :proxy_addr, :proxy_port, :proxy_user, :proxy_pass
|
@@ -158,9 +157,15 @@ module Webdrivers
|
|
158
157
|
nil
|
159
158
|
end
|
160
159
|
|
161
|
-
|
162
|
-
|
163
|
-
|
160
|
+
# Returns cached driver version if cache is still valid and the driver binary exists.
|
161
|
+
# Otherwise caches the given version (typically the latest available)
|
162
|
+
# In case of Chrome, it also verifies that the driver build and browser build versions are compatible.
|
163
|
+
# Example usage: lib/webdrivers/chromedriver.rb:34
|
164
|
+
def with_cache(file_name, driver_build = nil, browser_build = nil)
|
165
|
+
if System.valid_cache?(file_name) && exists? && (driver_build == browser_build)
|
166
|
+
cached_version = System.cached_version(file_name)
|
167
|
+
Webdrivers.logger.debug "using cached version as latest: #{cached_version}"
|
168
|
+
normalize_version cached_version
|
164
169
|
else
|
165
170
|
version = yield
|
166
171
|
System.cache_version(file_name, version)
|
@@ -37,7 +37,10 @@ module Webdrivers
|
|
37
37
|
|
38
38
|
def win_location
|
39
39
|
envs = %w[LOCALAPPDATA PROGRAMFILES PROGRAMFILES(X86)]
|
40
|
-
directories = ['\\Microsoft\\Edge
|
40
|
+
directories = ['\\Microsoft\\Edge\\Application',
|
41
|
+
'\\Microsoft\\Edge Beta\\Application',
|
42
|
+
'\\Microsoft\\Edge Dev\\Application',
|
43
|
+
'\\Microsoft\\Edge SxS\\Application']
|
41
44
|
file = 'msedge.exe'
|
42
45
|
|
43
46
|
directories.each do |dir|
|
@@ -52,6 +55,7 @@ module Webdrivers
|
|
52
55
|
def mac_location
|
53
56
|
directories = ['', File.expand_path('~')]
|
54
57
|
files = ['/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge',
|
58
|
+
'/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta',
|
55
59
|
'/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev',
|
56
60
|
'/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary']
|
57
61
|
|
data/lib/webdrivers/system.rb
CHANGED
@@ -4,6 +4,12 @@ require 'rubygems/package'
|
|
4
4
|
require 'zip'
|
5
5
|
require 'English'
|
6
6
|
|
7
|
+
# validate zip entry sizes to avoid zip bombs
|
8
|
+
# see https://github.com/rubyzip/rubyzip#size-validation
|
9
|
+
# and https://github.com/rubyzip/rubyzip/pull/403 for further details
|
10
|
+
# this will be the default in rubyzip 2.0+
|
11
|
+
Zip.validate_entry_sizes = true
|
12
|
+
|
7
13
|
module Webdrivers
|
8
14
|
#
|
9
15
|
# @api private
|
@@ -14,11 +20,13 @@ module Webdrivers
|
|
14
20
|
max_attempts = 3
|
15
21
|
attempts_made = 0
|
16
22
|
delay = 0.5
|
17
|
-
Webdrivers.logger.debug "Deleting #{file}"
|
18
23
|
|
19
24
|
begin
|
20
25
|
attempts_made += 1
|
21
|
-
|
26
|
+
if File.exist? file
|
27
|
+
Webdrivers.logger.debug "Deleting #{file}"
|
28
|
+
File.delete file
|
29
|
+
end
|
22
30
|
rescue Errno::EACCES # Solves an intermittent file locking issue on Windows
|
23
31
|
sleep(delay)
|
24
32
|
retry if File.exist?(file) && attempts_made <= max_attempts
|
@@ -140,6 +148,25 @@ module Webdrivers
|
|
140
148
|
end
|
141
149
|
end
|
142
150
|
|
151
|
+
# @return [TrueClass, FalseClass]
|
152
|
+
def wsl?
|
153
|
+
platform == 'linux' && File.open('/proc/version').read.include?('Microsoft')
|
154
|
+
end
|
155
|
+
|
156
|
+
# @param [String] path
|
157
|
+
# @return [String]
|
158
|
+
def to_win32_path(path)
|
159
|
+
return path if /[a-z]:\\/iu.match?(path)
|
160
|
+
|
161
|
+
call("wslpath -w '#{path}'").chomp
|
162
|
+
end
|
163
|
+
|
164
|
+
# @param [String] path
|
165
|
+
# @return [String]
|
166
|
+
def to_wsl_path(path)
|
167
|
+
call("wslpath -u '#{path}'").chomp
|
168
|
+
end
|
169
|
+
|
143
170
|
def bitsize
|
144
171
|
Selenium::WebDriver::Platform.bitsize
|
145
172
|
end
|
data/lib/webdrivers/version.rb
CHANGED
@@ -47,4 +47,57 @@ describe Webdrivers::ChromeFinder do
|
|
47
47
|
expect { chrome_finder.version }.to raise_error(Webdrivers::BrowserNotFound)
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
context 'when running in WSL' do
|
52
|
+
before do
|
53
|
+
skip "The current platform cannot be WSL, as it's not Linux" unless Selenium::WebDriver::Platform.linux?
|
54
|
+
|
55
|
+
allow(Webdrivers::System).to receive(:wsl?).and_return(true)
|
56
|
+
allow(Webdrivers::System).to receive(:to_wsl_path).and_return('')
|
57
|
+
allow(Webdrivers::System).to receive(:to_win32_path).and_return('')
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'checks Windows locations for Chrome' do
|
61
|
+
drive = 'c'
|
62
|
+
user = 'WinUser'
|
63
|
+
file = 'chrome.exe'
|
64
|
+
path = [
|
65
|
+
'/home/wsl-user/.local/bin',
|
66
|
+
'/usr/local/bin',
|
67
|
+
'/usr/local/games',
|
68
|
+
'/usr/bin',
|
69
|
+
"/#{drive}/Users/#{user}/AppData/Local/Microsoft/WindowsApps",
|
70
|
+
'/snap/bin'
|
71
|
+
].join ':'
|
72
|
+
|
73
|
+
allow(chrome_finder).to receive(:user_defined_location).and_return(nil)
|
74
|
+
allow(ENV).to receive(:[]).with('WD_CHROME_PATH').and_return(nil)
|
75
|
+
allow(ENV).to receive(:[]).with('PATH').and_return(path)
|
76
|
+
allow(File).to receive(:exist?).and_return(false)
|
77
|
+
|
78
|
+
locations = [
|
79
|
+
"#{drive}:\\Users\\#{user}\\AppData\\Local\\Google\\Chrome\\Application\\#{file}",
|
80
|
+
"#{drive}:\\Program Files (x86)\\Chromium\\Application\\#{file}",
|
81
|
+
"#{drive}:\\Program Files\\Google\\Chrome\\Application\\#{file}"
|
82
|
+
]
|
83
|
+
|
84
|
+
# CIs don't support WSL yet, so our mocks lead to the error path for simplicity
|
85
|
+
expect { chrome_finder.location }.to raise_error(Webdrivers::BrowserNotFound)
|
86
|
+
|
87
|
+
locations.each do |dir|
|
88
|
+
expect(Webdrivers::System).to have_received(:to_wsl_path).with(dir)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'uses win_version to get the Chrome version using win32 path' do
|
93
|
+
allow(chrome_finder).to receive(:win_version).and_return('')
|
94
|
+
allow(File).to receive(:exist?).and_return(true)
|
95
|
+
|
96
|
+
# CIs don't support WSL yet, so our mocks lead to the error path for simplicity
|
97
|
+
expect { chrome_finder.version }.to raise_error(Webdrivers::VersionError)
|
98
|
+
|
99
|
+
expect(Webdrivers::System).to have_received(:to_win32_path)
|
100
|
+
expect(chrome_finder).to have_received(:win_version)
|
101
|
+
end
|
102
|
+
end
|
50
103
|
end
|
@@ -106,15 +106,16 @@ describe Webdrivers::Chromedriver do
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
-
it 'makes
|
109
|
+
it 'makes network calls if cached driver does not match the browser' do
|
110
110
|
Webdrivers::System.cache_version('chromedriver', '71.0.3578.137')
|
111
|
+
allow(chromedriver).to receive(:current_version).and_return(Gem::Version.new('71.0.3578.137'))
|
111
112
|
allow(chromedriver).to receive(:browser_version).and_return(Gem::Version.new('73.0.3683.68'))
|
112
113
|
allow(Webdrivers::Network).to receive(:get).and_return('73.0.3683.68')
|
113
114
|
allow(Webdrivers::System).to receive(:download)
|
114
115
|
|
115
116
|
chromedriver.update
|
116
117
|
|
117
|
-
expect(Webdrivers::Network).to have_received(:get).
|
118
|
+
expect(Webdrivers::Network).to have_received(:get).twice
|
118
119
|
end
|
119
120
|
|
120
121
|
context 'when required version is 0' do
|
@@ -155,19 +156,19 @@ describe Webdrivers::Chromedriver do
|
|
155
156
|
|
156
157
|
describe '#latest_version' do
|
157
158
|
it 'returns 2.41 if the browser version is less than 70' do
|
158
|
-
allow(chromedriver).to receive(:browser_version).and_return('69.0.0')
|
159
|
+
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('69.0.0')
|
159
160
|
|
160
161
|
expect(chromedriver.latest_version).to eq(Gem::Version.new('2.41'))
|
161
162
|
end
|
162
163
|
|
163
164
|
it 'returns the correct point release for a production version greater than 70' do
|
164
|
-
allow(chromedriver).to receive(:browser_version).and_return '71.0.3578.9999'
|
165
|
+
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('71.0.3578.9999')
|
165
166
|
|
166
167
|
expect(chromedriver.latest_version).to eq Gem::Version.new('71.0.3578.137')
|
167
168
|
end
|
168
169
|
|
169
170
|
it 'raises VersionError for beta version' do
|
170
|
-
allow(chromedriver).to receive(:browser_version).and_return('100.0.0')
|
171
|
+
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('100.0.0')
|
171
172
|
msg = 'Unable to find latest point release version for 100.0.0. '\
|
172
173
|
'You appear to be using a non-production version of Chrome. '\
|
173
174
|
'Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` '\
|
@@ -177,7 +178,7 @@ describe Webdrivers::Chromedriver do
|
|
177
178
|
end
|
178
179
|
|
179
180
|
it 'raises VersionError for unknown version' do
|
180
|
-
allow(chromedriver).to receive(:browser_version).and_return('72.0.9999.0000')
|
181
|
+
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('72.0.9999.0000')
|
181
182
|
msg = 'Unable to find latest point release version for 72.0.9999. '\
|
182
183
|
'Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` '\
|
183
184
|
'to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html'
|
@@ -199,9 +200,12 @@ describe Webdrivers::Chromedriver do
|
|
199
200
|
expect(File.exist?("#{Webdrivers::System.install_dir}/chromedriver.version")).to eq true
|
200
201
|
end
|
201
202
|
|
202
|
-
it 'does not make network
|
203
|
+
it 'does not make network calls if cache is valid and driver exists' do
|
203
204
|
allow(Webdrivers).to receive(:cache_time).and_return(3600)
|
204
205
|
Webdrivers::System.cache_version('chromedriver', '71.0.3578.137')
|
206
|
+
allow(chromedriver).to receive(:current_version).and_return Gem::Version.new('71.0.3578.137')
|
207
|
+
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('71.0.3578.137')
|
208
|
+
allow(Webdrivers::System).to receive(:exists?).and_return(true)
|
205
209
|
allow(Webdrivers::Network).to receive(:get)
|
206
210
|
|
207
211
|
expect(chromedriver.latest_version).to eq Gem::Version.new('71.0.3578.137')
|
@@ -209,10 +213,11 @@ describe Webdrivers::Chromedriver do
|
|
209
213
|
expect(Webdrivers::Network).not_to have_received(:get)
|
210
214
|
end
|
211
215
|
|
212
|
-
it 'makes
|
216
|
+
it 'makes network calls if cache is expired' do
|
213
217
|
Webdrivers::System.cache_version('chromedriver', '71.0.3578.137')
|
218
|
+
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('71.0.3578.137')
|
214
219
|
allow(Webdrivers::Network).to receive(:get).and_return('73.0.3683.68')
|
215
|
-
allow(Webdrivers::System).to receive(:valid_cache?)
|
220
|
+
allow(Webdrivers::System).to receive(:valid_cache?).and_return(false)
|
216
221
|
|
217
222
|
expect(chromedriver.latest_version).to eq Gem::Version.new('73.0.3683.68')
|
218
223
|
|
@@ -114,15 +114,16 @@ describe Webdrivers::Edgedriver do
|
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
117
|
-
it 'makes
|
117
|
+
it 'makes network calls if cached driver does not match the browser' do
|
118
118
|
Webdrivers::System.cache_version('msedgedriver', '71.0.3578.137')
|
119
|
-
allow(edgedriver).to receive(:
|
119
|
+
allow(edgedriver).to receive(:current_version).and_return Gem::Version.new('71.0.3578.137')
|
120
|
+
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('73.0.3683.68')
|
120
121
|
allow(Webdrivers::Network).to receive(:get).and_return('73.0.3683.68'.encode('UTF-16'))
|
121
122
|
allow(Webdrivers::System).to receive(:download)
|
122
123
|
|
123
124
|
edgedriver.update
|
124
125
|
|
125
|
-
expect(Webdrivers::Network).to have_received(:get).
|
126
|
+
expect(Webdrivers::Network).to have_received(:get).twice
|
126
127
|
end
|
127
128
|
|
128
129
|
context 'when required version is 0' do
|
@@ -163,13 +164,13 @@ describe Webdrivers::Edgedriver do
|
|
163
164
|
|
164
165
|
describe '#latest_version' do
|
165
166
|
it 'returns the correct point release for a production version' do
|
166
|
-
allow(edgedriver).to receive(:browser_version).and_return '77.0.207.0'
|
167
|
+
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('77.0.207.0')
|
167
168
|
|
168
169
|
expect(edgedriver.latest_version).to be_between(Gem::Version.new('77.0.207.0'), Gem::Version.new('78'))
|
169
170
|
end
|
170
171
|
|
171
172
|
it 'raises VersionError for beta version' do
|
172
|
-
allow(edgedriver).to receive(:browser_version).and_return('100.0.0')
|
173
|
+
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('100.0.0')
|
173
174
|
msg = 'Unable to find latest point release version for 100.0.0. '\
|
174
175
|
'You appear to be using a non-production version of Edge. '\
|
175
176
|
'Please set `Webdrivers::Edgedriver.required_version = <desired driver version>` '\
|
@@ -196,28 +197,31 @@ describe Webdrivers::Edgedriver do
|
|
196
197
|
end
|
197
198
|
|
198
199
|
it 'creates cached file' do
|
199
|
-
allow(edgedriver).to receive(:browser_version).and_return('77.0.207.0')
|
200
|
+
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('77.0.207.0')
|
200
201
|
allow(Webdrivers::Network).to receive(:get).and_return('77.0.207.0'.encode('UTF-16'))
|
201
202
|
|
202
203
|
edgedriver.latest_version
|
203
204
|
expect(File.exist?("#{Webdrivers::System.install_dir}/msedgedriver.version")).to eq true
|
204
205
|
end
|
205
206
|
|
206
|
-
it 'does not make network
|
207
|
+
it 'does not make network calls if cache is valid and driver exists' do
|
207
208
|
allow(Webdrivers).to receive(:cache_time).and_return(3600)
|
208
|
-
Webdrivers::System.cache_version('msedgedriver', '
|
209
|
+
Webdrivers::System.cache_version('msedgedriver', '82.0.445.0')
|
210
|
+
allow(edgedriver).to receive(:current_version).and_return Gem::Version.new('82.0.445.0')
|
211
|
+
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('82.0.445.0')
|
212
|
+
allow(Webdrivers::System).to receive(:exists?).and_return(true)
|
209
213
|
allow(Webdrivers::Network).to receive(:get)
|
210
214
|
|
211
|
-
expect(edgedriver.latest_version).to eq Gem::Version.new('
|
215
|
+
expect(edgedriver.latest_version).to eq Gem::Version.new('82.0.445.0')
|
212
216
|
|
213
217
|
expect(Webdrivers::Network).not_to have_received(:get)
|
214
218
|
end
|
215
219
|
|
216
|
-
it 'makes
|
220
|
+
it 'makes network calls if cache is expired' do
|
217
221
|
Webdrivers::System.cache_version('msedgedriver', '71.0.3578.137')
|
218
222
|
allow(Webdrivers::Network).to receive(:get).and_return('77.0.207.0'.encode('UTF-16'))
|
219
|
-
allow(Webdrivers::System).to receive(:valid_cache?)
|
220
|
-
allow(edgedriver).to receive(:browser_version).and_return('77.0.207.0')
|
223
|
+
allow(Webdrivers::System).to receive(:valid_cache?).and_return(false)
|
224
|
+
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('77.0.207.0')
|
221
225
|
|
222
226
|
expect(edgedriver.latest_version).to eq Gem::Version.new('77.0.207.0')
|
223
227
|
|
@@ -135,9 +135,10 @@ You can obtain a copy of the license at https://mozilla.org/MPL/2.0/"
|
|
135
135
|
expect(File.exist?("#{Webdrivers::System.install_dir}/geckodriver.version")).to eq true
|
136
136
|
end
|
137
137
|
|
138
|
-
it 'does not make network
|
138
|
+
it 'does not make network calls if cache is valid and driver exists' do
|
139
139
|
allow(Webdrivers).to receive(:cache_time).and_return(3600)
|
140
140
|
Webdrivers::System.cache_version('geckodriver', '0.23.0')
|
141
|
+
allow(Webdrivers::System).to receive(:exists?).and_return(true)
|
141
142
|
allow(Webdrivers::Network).to receive(:get)
|
142
143
|
|
143
144
|
expect(geckodriver.latest_version).to eq Gem::Version.new('0.23.0')
|
@@ -115,9 +115,10 @@ describe Webdrivers::IEdriver do
|
|
115
115
|
expect(File.exist?("#{Webdrivers::System.install_dir}/IEDriverServer.version")).to eq true
|
116
116
|
end
|
117
117
|
|
118
|
-
it 'does not make network
|
118
|
+
it 'does not make network calls if cache is valid and driver exists' do
|
119
119
|
allow(Webdrivers).to receive(:cache_time).and_return(3600)
|
120
120
|
Webdrivers::System.cache_version('IEDriverServer', '3.4.0')
|
121
|
+
allow(Webdrivers::System).to receive(:exists?).and_return(true)
|
121
122
|
allow(Webdrivers::Network).to receive(:get)
|
122
123
|
|
123
124
|
expect(iedriver.latest_version).to eq Gem::Version.new('3.4.0')
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
wsl_proc_contents = [
|
6
|
+
'Linux version 4.4.0-18362-Microsoft',
|
7
|
+
'(Microsoft@Microsoft.com)',
|
8
|
+
'(gcc version 5.4.0 (GCC) )',
|
9
|
+
'#836-Microsoft',
|
10
|
+
'Mon May 05 16:04:00 PST 2020'
|
11
|
+
].join ' '
|
12
|
+
|
13
|
+
describe Webdrivers::System do
|
14
|
+
describe '#wsl?' do
|
15
|
+
context 'when the current platform is linux' do
|
16
|
+
before { allow(described_class).to receive(:platform).and_return 'linux' }
|
17
|
+
|
18
|
+
it 'checks /proc/version' do
|
19
|
+
allow(File).to receive(:open).with('/proc/version').and_return(StringIO.new(wsl_proc_contents))
|
20
|
+
|
21
|
+
expect(described_class.wsl?).to eq true
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'when the current platform is mac' do
|
26
|
+
before { allow(described_class).to receive(:platform).and_return 'mac' }
|
27
|
+
|
28
|
+
it 'does not bother checking proc' do
|
29
|
+
allow(File).to receive(:open).and_call_original
|
30
|
+
|
31
|
+
expect(described_class.wsl?).to eq false
|
32
|
+
|
33
|
+
expect(File).not_to have_received(:open).with('/proc/version')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe '#to_win32_path' do
|
39
|
+
before { allow(described_class).to receive(:call).and_return("C:\\path\\to\\folder\n") }
|
40
|
+
|
41
|
+
it 'uses wslpath' do
|
42
|
+
described_class.to_win32_path '/c/path/to/folder'
|
43
|
+
|
44
|
+
expect(described_class).to have_received(:call).with('wslpath -w \'/c/path/to/folder\'')
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'removes the trailing newline' do
|
48
|
+
expect(described_class.to_win32_path('/c/path/to/folder')).not_to end_with('\n')
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'when the path is already in Windows format' do
|
52
|
+
it 'returns early' do
|
53
|
+
expect(described_class.to_win32_path('D:\\')).to eq 'D:\\'
|
54
|
+
|
55
|
+
expect(described_class).not_to have_received(:call)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe '#to_wsl_path' do
|
61
|
+
before { allow(described_class).to receive(:call).and_return("/c/path/to/folder\n") }
|
62
|
+
|
63
|
+
it 'uses wslpath' do
|
64
|
+
described_class.to_wsl_path 'C:\\path\\to\\folder'
|
65
|
+
|
66
|
+
expect(described_class).to have_received(:call).with('wslpath -u \'C:\\path\\to\\folder\'')
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'removes the trailing newline' do
|
70
|
+
expect(described_class.to_wsl_path('/c/path/to/folder')).not_to end_with('\n')
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
data/support/install_jruby.ps1
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
$downloadLink = "https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.
|
2
|
-
$zipPath = "c:\jruby-dist-9.2.
|
1
|
+
$downloadLink = "https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.11.1/jruby-dist-9.2.11.1-bin.zip"
|
2
|
+
$zipPath = "c:\jruby-dist-9.2.11.1-bin.zip"
|
3
3
|
|
4
4
|
Write-Host "Installing $($env:RUBY_VERSION)" -ForegroundColor cyan
|
5
5
|
appveyor DownloadFile "$($downloadLink)" -FileName "$($zipPath)"
|
data/support/install_msedge.ps1
CHANGED
@@ -1,17 +1,11 @@
|
|
1
|
-
$
|
2
|
-
$
|
3
|
-
$devSetup = "C:\MicrosoftEdgeSetupDev.exe"
|
4
|
-
$canarySetup = "C:\MicrosoftEdgeSetupCanary.exe"
|
1
|
+
$downloadLink = "https://go.microsoft.com/fwlink/?linkid=2108834&Channel=Stable&language=en"
|
2
|
+
$installerFile = "C:\MicrosoftEdgeSetup.exe"
|
5
3
|
|
6
4
|
# Note: We're purposely skipping the -Wait flag in Start-Process.
|
7
5
|
# This is because Edge auto-launches after the setup is done and
|
8
6
|
# Start-Process continues to indefinitely wait on that process.
|
9
|
-
Write-Host "
|
10
|
-
Invoke-WebRequest $
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
Write-Host "Installing Microsoft Edge (Canary)..." -ForegroundColor cyan
|
15
|
-
Invoke-WebRequest $downloadCanaryLink -OutFile $canarySetup # Download Canary
|
16
|
-
Start-Process $canarySetup # Run installer
|
17
|
-
Write-Host "Microsoft Edge (Canary) installed.`n" -ForegroundColor green
|
7
|
+
Write-Host "Downloading Microsoft Edge (Stable)..." -ForegroundColor cyan
|
8
|
+
Invoke-WebRequest $downloadLink -OutFile $installerFile
|
9
|
+
Write-Host "Installing..." -ForegroundColor cyan
|
10
|
+
Start-Process $installerFile
|
11
|
+
Write-Host "Microsoft Edge (Stable) installed.`n" -ForegroundColor green
|
data/webdrivers.gemspec
CHANGED
@@ -7,6 +7,7 @@ require 'webdrivers/version'
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = 'webdrivers'
|
9
9
|
s.version = Webdrivers::VERSION
|
10
|
+
s.required_ruby_version = '>= 2.4.0'
|
10
11
|
s.authors = ['Titus Fortner', 'Lakshya Kapoor', 'Thomas Walpole']
|
11
12
|
s.email = %w[titusfortner@gmail.com kapoorlakshya@gmail.com]
|
12
13
|
s.homepage = 'https://github.com/titusfortner/webdrivers'
|
@@ -14,13 +15,19 @@ Gem::Specification.new do |s|
|
|
14
15
|
s.description = 'Run Selenium tests more easily with install and updates for all supported webdrivers.'
|
15
16
|
s.licenses = ['MIT']
|
16
17
|
|
18
|
+
s.metadata = {
|
19
|
+
'bug_tracker_uri' => 'https://github.com/titusfortner/webdrivers/issues',
|
20
|
+
'changelog_uri' => 'https://github.com/titusfortner/webdrivers/blob/master/CHANGELOG.md',
|
21
|
+
'documentation_uri' => "https://www.rubydoc.info/gems/webdrivers/#{Webdrivers::VERSION}",
|
22
|
+
'source_code_uri' => "https://github.com/titusfortner/webdrivers/tree/v#{Webdrivers::VERSION}"
|
23
|
+
}
|
24
|
+
|
17
25
|
s.files = `git ls-files`.split("\n")
|
18
26
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
27
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
20
28
|
s.require_paths = ['lib']
|
21
29
|
|
22
30
|
s.add_development_dependency 'ffi', '~> 1.0' # For selenium-webdriver on Windows
|
23
|
-
s.add_development_dependency 'irb'
|
24
31
|
s.add_development_dependency 'rake', '~> 12.0'
|
25
32
|
s.add_development_dependency 'rspec', '~> 3.0'
|
26
33
|
s.add_development_dependency 'rubocop', '~>0.66'
|
@@ -29,6 +36,6 @@ Gem::Specification.new do |s|
|
|
29
36
|
s.add_development_dependency 'simplecov', '~>0.16'
|
30
37
|
|
31
38
|
s.add_runtime_dependency 'nokogiri', '~> 1.6'
|
32
|
-
s.add_runtime_dependency 'rubyzip', '
|
39
|
+
s.add_runtime_dependency 'rubyzip', '>= 1.3.0'
|
33
40
|
s.add_runtime_dependency 'selenium-webdriver', '>= 3.0', '< 4.0'
|
34
41
|
end
|
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: 4.
|
4
|
+
version: 4.4.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: 2020-06-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ffi
|
@@ -26,20 +26,6 @@ dependencies:
|
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '1.0'
|
29
|
-
- !ruby/object:Gem::Dependency
|
30
|
-
name: irb
|
31
|
-
requirement: !ruby/object:Gem::Requirement
|
32
|
-
requirements:
|
33
|
-
- - ">="
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version: '0'
|
36
|
-
type: :development
|
37
|
-
prerelease: false
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
39
|
-
requirements:
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '0'
|
43
29
|
- !ruby/object:Gem::Dependency
|
44
30
|
name: rake
|
45
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,16 +128,16 @@ dependencies:
|
|
142
128
|
name: rubyzip
|
143
129
|
requirement: !ruby/object:Gem::Requirement
|
144
130
|
requirements:
|
145
|
-
- - "
|
131
|
+
- - ">="
|
146
132
|
- !ruby/object:Gem::Version
|
147
|
-
version:
|
133
|
+
version: 1.3.0
|
148
134
|
type: :runtime
|
149
135
|
prerelease: false
|
150
136
|
version_requirements: !ruby/object:Gem::Requirement
|
151
137
|
requirements:
|
152
|
-
- - "
|
138
|
+
- - ">="
|
153
139
|
- !ruby/object:Gem::Version
|
154
|
-
version:
|
140
|
+
version: 1.3.0
|
155
141
|
- !ruby/object:Gem::Dependency
|
156
142
|
name: selenium-webdriver
|
157
143
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,7 +163,9 @@ description: Run Selenium tests more easily with install and updates for all sup
|
|
177
163
|
email:
|
178
164
|
- titusfortner@gmail.com
|
179
165
|
- kapoorlakshya@gmail.com
|
180
|
-
executables:
|
166
|
+
executables:
|
167
|
+
- console
|
168
|
+
- setup
|
181
169
|
extensions: []
|
182
170
|
extra_rdoc_files: []
|
183
171
|
files:
|
@@ -191,6 +179,8 @@ files:
|
|
191
179
|
- README.md
|
192
180
|
- Rakefile
|
193
181
|
- appveyor.yml
|
182
|
+
- bin/console
|
183
|
+
- bin/setup
|
194
184
|
- gemfiles/Gemfile.edge
|
195
185
|
- lib/webdrivers.rb
|
196
186
|
- lib/webdrivers/Rakefile
|
@@ -217,6 +207,7 @@ files:
|
|
217
207
|
- spec/webdrivers/edgedriver_spec.rb
|
218
208
|
- spec/webdrivers/geckodriver_spec.rb
|
219
209
|
- spec/webdrivers/i_edriver_spec.rb
|
210
|
+
- spec/webdrivers/system_spec.rb
|
220
211
|
- spec/webdrivers/webdrivers_spec.rb
|
221
212
|
- spec/webdrivers_proxy_support_spec.rb
|
222
213
|
- support/install_jruby.ps1
|
@@ -225,7 +216,11 @@ files:
|
|
225
216
|
homepage: https://github.com/titusfortner/webdrivers
|
226
217
|
licenses:
|
227
218
|
- MIT
|
228
|
-
metadata:
|
219
|
+
metadata:
|
220
|
+
bug_tracker_uri: https://github.com/titusfortner/webdrivers/issues
|
221
|
+
changelog_uri: https://github.com/titusfortner/webdrivers/blob/master/CHANGELOG.md
|
222
|
+
documentation_uri: https://www.rubydoc.info/gems/webdrivers/4.4.0
|
223
|
+
source_code_uri: https://github.com/titusfortner/webdrivers/tree/v4.4.0
|
229
224
|
post_install_message:
|
230
225
|
rdoc_options: []
|
231
226
|
require_paths:
|
@@ -234,14 +229,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
234
229
|
requirements:
|
235
230
|
- - ">="
|
236
231
|
- !ruby/object:Gem::Version
|
237
|
-
version:
|
232
|
+
version: 2.4.0
|
238
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
234
|
requirements:
|
240
235
|
- - ">="
|
241
236
|
- !ruby/object:Gem::Version
|
242
237
|
version: '0'
|
243
238
|
requirements: []
|
244
|
-
rubygems_version: 3.
|
239
|
+
rubygems_version: 3.1.3
|
245
240
|
signing_key:
|
246
241
|
specification_version: 4
|
247
242
|
summary: Easy download and use of browser drivers.
|