webdrivers 4.0.1 → 4.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/.github/ISSUE_TEMPLATE.md +16 -14
- data/.gitignore +8 -7
- data/.travis.yml +40 -24
- data/CHANGELOG.md +14 -1
- data/LICENSE.txt +23 -23
- data/README.md +31 -22
- data/appveyor.yml +9 -5
- data/gemfiles/Gemfile.edge +7 -0
- data/lib/webdrivers.rb +1 -0
- data/lib/webdrivers/chrome_finder.rb +26 -14
- data/lib/webdrivers/chromedriver.rb +3 -2
- data/lib/webdrivers/common.rb +8 -6
- data/lib/webdrivers/edge_finder.rb +82 -0
- data/lib/webdrivers/edgedriver.rb +106 -0
- data/lib/webdrivers/system.rb +17 -17
- data/lib/webdrivers/tasks/chromedriver.rake +0 -2
- data/lib/webdrivers/tasks/edgedriver.rake +44 -0
- data/lib/webdrivers/tasks/geckodriver.rake +0 -2
- data/lib/webdrivers/tasks/iedriver.rake +0 -2
- data/lib/webdrivers/version.rb +1 -1
- data/spec/webdrivers/chrome_finder_spec.rb +44 -0
- data/spec/webdrivers/chromedriver_spec.rb +21 -10
- data/spec/webdrivers/edgedriver_spec.rb +276 -0
- data/spec/webdrivers/geckodriver_spec.rb +2 -2
- data/spec/webdrivers/i_edriver_spec.rb +2 -2
- data/spec/webdrivers/webdrivers_spec.rb +17 -5
- data/support/install_msedge.ps1 +17 -0
- data/webdrivers.gemspec +1 -0
- metadata +23 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c836de6a779887c856d52f673efe3aa222046c32d50386f195c31e1c1f37ac4f
|
4
|
+
data.tar.gz: 972c301f2b3176ad1629820779bff1174043858160e36c56f57522f263458284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89f7b359fe431e1fe4092baf2867049af4876df5f38f6edc8e7b91fc22bd2a8b7f81e6ea5492c97778453f9e532e4756f5102cc0b90e9954c9b4345e1b0e697f
|
7
|
+
data.tar.gz: 4c237d64c244c3e62581179b57c58d3961412ea1577d2a57f9c636c86b280db61496a156a28a341b7d6155136c855b38bc034efcc464370c9a6dc543d6a0b808
|
data/.github/ISSUE_TEMPLATE.md
CHANGED
@@ -1,14 +1,16 @@
|
|
1
|
-
#### Summary
|
2
|
-
Short summary of the bug or feature request.
|
3
|
-
|
4
|
-
#### Debug Info
|
5
|
-
Please provide the following information for bug reports:
|
6
|
-
|
7
|
-
*
|
8
|
-
*
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
#### Summary
|
2
|
+
Short summary of the bug or feature request.
|
3
|
+
|
4
|
+
#### Debug Info
|
5
|
+
Please provide the following information for bug reports:
|
6
|
+
|
7
|
+
* Webdrivers version:
|
8
|
+
* Ruby version:
|
9
|
+
* Operating system / CI Environment:
|
10
|
+
* Browser and version:
|
11
|
+
|
12
|
+
#### Expected Behavior
|
13
|
+
What you expect to happen.
|
14
|
+
|
15
|
+
#### Actual Behavior
|
16
|
+
What is actually happening: Error message, stack trace, DEBUG log if applicable (set `Webdrivers.logger.level = :DEBUG` after you require webdrivers)
|
data/.gitignore
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
*.gem
|
2
|
-
.bundle
|
3
|
-
Gemfile.lock
|
4
|
-
pkg/*
|
5
|
-
chromedriver.log
|
6
|
-
/.idea/
|
7
|
-
coverage/
|
1
|
+
*.gem
|
2
|
+
.bundle
|
3
|
+
Gemfile.lock
|
4
|
+
pkg/*
|
5
|
+
chromedriver.log
|
6
|
+
/.idea/
|
7
|
+
coverage/
|
8
|
+
gemfiles/Gemfile.*.lock
|
data/.travis.yml
CHANGED
@@ -1,24 +1,40 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
addons:
|
4
|
-
apt:
|
5
|
-
packages:
|
6
|
-
- chromium-browser
|
7
|
-
- libgconf-2-4
|
8
|
-
chrome: stable
|
9
|
-
script: bundle exec rake $RAKE_TASK
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
env: RAKE_TASK=spec
|
21
|
-
- rvm: 2.4.6
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
addons:
|
4
|
+
apt:
|
5
|
+
packages:
|
6
|
+
- chromium-browser
|
7
|
+
- libgconf-2-4
|
8
|
+
chrome: stable
|
9
|
+
script: bundle exec rake $RAKE_TASK
|
10
|
+
before_install:
|
11
|
+
- gem update --system
|
12
|
+
- gem update bundler
|
13
|
+
matrix:
|
14
|
+
include:
|
15
|
+
- rvm: 2.6.3
|
16
|
+
env: RAKE_TASK=spec
|
17
|
+
- rvm: 2.5.5
|
18
|
+
env: RAKE_TASK=spec
|
19
|
+
- rvm: 2.4.6
|
20
|
+
env: RAKE_TASK=spec
|
21
|
+
- rvm: 2.4.6
|
22
|
+
os: osx
|
23
|
+
env: RAKE_TASK=spec
|
24
|
+
- rvm: 2.4.6
|
25
|
+
env: RAKE_TASK=rubocop
|
26
|
+
- rvm: jruby-9.2.7.0
|
27
|
+
env: RAKE_TASK=spec
|
28
|
+
- rvm: 2.6
|
29
|
+
env: RAKE_TASK=spec
|
30
|
+
gemfile: gemfiles/Gemfile.edge
|
31
|
+
os: osx
|
32
|
+
osx_image: xcode10.2
|
33
|
+
addons:
|
34
|
+
chrome: stable
|
35
|
+
homebrew:
|
36
|
+
taps: homebrew/cask-versions
|
37
|
+
casks:
|
38
|
+
- microsoft-edge-canary
|
39
|
+
allow_failures:
|
40
|
+
- gemfile: gemfiles/Gemfile.edge
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
|
+
### 4.1.0 (2019-06-26)
|
2
|
+
* Add support for `msedgedriver` (issue [#93](https://github.com/titusfortner/webdrivers/issues/93))
|
3
|
+
* Allow users to provide a custom binary path via `WD_CHROME_PATH`
|
4
|
+
and `WD_EDGE_CHROME_ATH` environment variables (issues #[137](https://github.com/titusfortner/webdrivers/issues/137)
|
5
|
+
and [#93](https://github.com/titusfortner/webdrivers/issues/93))
|
6
|
+
* Fix a bug where the user given Chrome binary path via `Selenium::WebDriver::Chrome.path`
|
7
|
+
was not properly escaped (issue [#139](https://github.com/titusfortner/webdrivers/issues/139))
|
8
|
+
* Fix miscellaneous code warnings.
|
9
|
+
* **Announcement**: As of 06/21/2019, `heroku-buildpack-google-chrome`
|
10
|
+
no longer requires a [workaround](https://github.com/titusfortner/webdrivers/wiki/Heroku-buildpack-google-chrome)
|
11
|
+
to work with this gem. See [heroku-buildpack-google-chrome#73](https://github.com/heroku/heroku-buildpack-google-chrome/pull/73)
|
12
|
+
for more information.
|
13
|
+
|
1
14
|
### 4.0.1 (2019-06-12)
|
2
|
-
* 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) (issue [#132](https://github.com/titusfortner/webdrivers/issues/132))
|
15
|
+
* 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))
|
3
16
|
* Properly escape Chrome binary path when using JRuby on Windows (issue [#130](https://github.com/titusfortner/webdrivers/issues/130))
|
4
17
|
* Allow use of `selenium-webdriver` v4 (pre-releases only)
|
5
18
|
|
data/LICENSE.txt
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
(The MIT License)
|
2
|
-
|
3
|
-
Copyright (c) 2017-2019: Titus Fortner
|
4
|
-
Copyright (c) 2019: Lakshya Kapoor, Thomas Walpole
|
5
|
-
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
7
|
-
a copy of this software and associated documentation files (the
|
8
|
-
'Software'), to deal in the Software without restriction, including
|
9
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
10
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
11
|
-
permit persons to whom the Software is furnished to do so, subject to
|
12
|
-
the following conditions:
|
13
|
-
|
14
|
-
The above copyright notice and this permission notice shall be
|
15
|
-
included in all copies or substantial portions of the Software.
|
16
|
-
|
17
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
18
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
20
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
21
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
22
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
23
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2017-2019: Titus Fortner
|
4
|
+
Copyright (c) 2019: Lakshya Kapoor, Thomas Walpole
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
7
|
+
a copy of this software and associated documentation files (the
|
8
|
+
'Software'), to deal in the Software without restriction, including
|
9
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
10
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
11
|
+
permit persons to whom the Software is furnished to do so, subject to
|
12
|
+
the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be
|
15
|
+
included in all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
19
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
20
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
21
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
22
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
23
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -13,10 +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
|
-
|
17
|
-
Support for [`msedgedriver`](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/)
|
18
|
-
will be added once the next Microsoft Edge version (v75) is released. More information is available
|
19
|
-
[here](https://developer.microsoft.com/en-us/microsoft-edge/).
|
16
|
+
* [msedgedriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/) - Dev and Canary releases on Windows and macOS only
|
20
17
|
|
21
18
|
## Usage
|
22
19
|
|
@@ -36,10 +33,12 @@ through Selenium.
|
|
36
33
|
### Specific Drivers
|
37
34
|
|
38
35
|
If you want webdrivers to only manage specific drivers you can specify one or more as follows:
|
36
|
+
|
39
37
|
```ruby
|
40
38
|
require 'webdrivers/chromedriver'
|
41
39
|
require 'webdrivers/geckodriver'
|
42
40
|
require 'webdrivers/iedriver'
|
41
|
+
require 'webdrivers/edgedriver'
|
43
42
|
```
|
44
43
|
|
45
44
|
### Download Location
|
@@ -67,6 +66,9 @@ Webdrivers::Geckodriver.required_version = '0.23.0'
|
|
67
66
|
|
68
67
|
# Internet Explorer
|
69
68
|
Webdrivers::IEdriver.required_version = '3.14.0'
|
69
|
+
|
70
|
+
# Edge (Chromium)
|
71
|
+
Webdrivers::Edgedriver.required_version = '76.0.183.0'
|
70
72
|
```
|
71
73
|
|
72
74
|
You can explicitly trigger the update in your code, but this will happen
|
@@ -86,14 +88,13 @@ Webdrivers.cache_time = 86_400 # Default: 86,400 Seconds (24 hours)
|
|
86
88
|
```
|
87
89
|
|
88
90
|
Alternatively, you can define this value via the `WD_CACHE_TIME` environment
|
89
|
-
variable
|
90
|
-
**Only set one to avoid confusion**.
|
91
|
+
variable. **Only set one to avoid confusion**.
|
91
92
|
|
92
|
-
##### Special exception for chromedriver
|
93
|
+
##### Special exception for chromedriver and msedgedriver
|
93
94
|
|
94
|
-
Cache time will be respected as long as a
|
95
|
-
|
96
|
-
still at v75, `webdrivers` will ignore the cache time and update
|
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 v75, `webdrivers` will ignore the cache time and update the driver to make sure you're
|
97
98
|
using a compatible version.
|
98
99
|
|
99
100
|
### Proxy
|
@@ -133,7 +134,7 @@ Other solutions are documented on the RubyGems [website](https://guides.rubygems
|
|
133
134
|
### Rake tasks
|
134
135
|
|
135
136
|
Each driver has its own set of `rake` tasks (with `Railtie` support) that
|
136
|
-
you can call once before executing the tests.
|
137
|
+
you can call once before executing the tests. These are especially
|
137
138
|
useful if you're running tests in parallel and want to avoid performing
|
138
139
|
an update check per thread.
|
139
140
|
|
@@ -142,6 +143,9 @@ $ bundle exec rake -T
|
|
142
143
|
rake webdrivers:chromedriver:remove # Force remove chromedriver
|
143
144
|
rake webdrivers:chromedriver:update[version] # Remove and download updated chromedriver if necessary
|
144
145
|
rake webdrivers:chromedriver:version # Print current chromedriver version
|
146
|
+
rake webdrivers:edgedriver:remove # Force remove msedgedriver
|
147
|
+
rake webdrivers:edgedriver:update[version] # Remove and download updated msedgedriver if necessary
|
148
|
+
rake webdrivers:edgedriver:version # Print current msedgedriver version
|
145
149
|
rake webdrivers:geckodriver:remove # Force remove geckodriver
|
146
150
|
rake webdrivers:geckodriver:update[version] # Remove and download updated geckodriver if necessary
|
147
151
|
rake webdrivers:geckodriver:version # Print current geckodriver version
|
@@ -157,8 +161,9 @@ require 'webdrivers'
|
|
157
161
|
load 'webdrivers/Rakefile'
|
158
162
|
```
|
159
163
|
|
160
|
-
These tasks respect the `WD_INSTALL_DIR
|
161
|
-
variables which can also be passed
|
164
|
+
These tasks respect the `WD_INSTALL_DIR`, `WD_CACHE_TIME`, `WD_CHROME_PATH`,
|
165
|
+
and `WD_EDGE_CHROME_PATH` environment variables, which can also be passed
|
166
|
+
through the `rake` command:
|
162
167
|
|
163
168
|
```bash
|
164
169
|
$ bundle exec rake webdrivers:chromedriver:update[2.46] webdrivers:geckodriver:update[0.24.0] WD_CACHE_TIME=86_400 WD_INSTALL_DIR='my_dir'
|
@@ -180,7 +185,7 @@ Webdrivers.logger.level = :DEBUG
|
|
180
185
|
|
181
186
|
### Browser Specific Notes
|
182
187
|
|
183
|
-
#### Chrome/Chromium
|
188
|
+
#### Chrome/Chromium
|
184
189
|
|
185
190
|
The version of `chromedriver` will depend on the version of Chrome you are using it with:
|
186
191
|
|
@@ -197,21 +202,25 @@ You can override this behavior by providing a path to the browser binary you wan
|
|
197
202
|
Selenium::WebDriver::Chrome.path = '/chromium/install/path/to/binary'
|
198
203
|
```
|
199
204
|
|
205
|
+
Alternatively, you can define the path via the `WD_CHROME_PATH` environment
|
206
|
+
variable.
|
207
|
+
|
200
208
|
This is also required if Google Chrome is not installed in its
|
201
209
|
[default location](https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver).
|
202
210
|
|
203
|
-
#####
|
211
|
+
##### CircleCI Users
|
204
212
|
|
205
|
-
Follow the specific instructions [here](https://github.com/titusfortner/webdrivers/wiki/Heroku-buildpack-google-chrome) if your CI environment provides custom shims for Chrome or Chromium.
|
213
|
+
Follow the specific instructions [here](https://github.com/titusfortner/webdrivers/wiki/Heroku-buildpack-google-chrome) if your CI environment provides custom shims for Chrome or Chromium.
|
206
214
|
|
207
|
-
|
215
|
+
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.
|
208
216
|
|
209
|
-
Microsoft Edge
|
210
|
-
unreliable. To use Microsoft Edge, please visit the [Downloads and Installation page](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/#downloads).
|
217
|
+
#### Microsoft Edge (Chromium)
|
211
218
|
|
212
|
-
|
213
|
-
|
214
|
-
|
219
|
+
Microsoft Edge (Chromium) support was added in v4.1.0. Notes
|
220
|
+
from the [Chrome/Chromium](https://github.com/titusfortner/webdrivers#chromechromium)
|
221
|
+
section apply to this browser as well.
|
222
|
+
|
223
|
+
Please note that `msedgedriver` requires `selenium-webdriver` v4.
|
215
224
|
|
216
225
|
## Wiki
|
217
226
|
|
data/appveyor.yml
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
build: off
|
2
2
|
cache:
|
3
3
|
- vendor/bundle
|
4
|
+
image:
|
5
|
+
- Visual Studio 2017
|
4
6
|
environment:
|
5
7
|
matrix:
|
6
8
|
- RUBY_VERSION: Ruby24
|
@@ -23,12 +25,14 @@ environment:
|
|
23
25
|
RUBY_BIN: jruby
|
24
26
|
RAKE_TASK: spec
|
25
27
|
SCRIPT_CONTEXT: jruby -G -S
|
28
|
+
- RUBY_VERSION: Ruby26
|
29
|
+
RUBY_BIN: ruby
|
30
|
+
RAKE_TASK: spec
|
31
|
+
SCRIPT_CONTEXT: bundle exec
|
32
|
+
BUNDLE_GEMFILE: gemfiles/Gemfile.edge
|
26
33
|
install:
|
27
|
-
- ps:
|
28
|
-
|
29
|
-
{
|
30
|
-
support\install_jruby.ps1
|
31
|
-
}
|
34
|
+
- ps: if ($env:RUBY_BIN -eq 'jruby') { support\install_jruby.ps1 }
|
35
|
+
- ps: support\install_msedge.ps1
|
32
36
|
- set PATH=C:\%RUBY_VERSION%\bin;%PATH%
|
33
37
|
- '%RUBY_BIN% -S gem update --system'
|
34
38
|
- '%RUBY_BIN% -S gem install bundler'
|
data/lib/webdrivers.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Webdrivers
|
4
|
+
#
|
5
|
+
# @api private
|
6
|
+
#
|
4
7
|
class ChromeFinder
|
5
8
|
class << self
|
6
9
|
def version
|
7
|
-
location = Selenium::WebDriver::Chrome.path || send("#{System.platform}_location")
|
8
10
|
version = send("#{System.platform}_version", location)
|
9
11
|
|
10
12
|
raise VersionError, 'Failed to find Chrome binary or its version.' if version.nil? || version.empty?
|
@@ -13,9 +15,25 @@ module Webdrivers
|
|
13
15
|
version[/\d+\.\d+\.\d+\.\d+/] # Google Chrome 73.0.3683.75 -> 73.0.3683.75
|
14
16
|
end
|
15
17
|
|
16
|
-
def
|
17
|
-
|
18
|
+
def location
|
19
|
+
user_defined_location || send("#{System.platform}_location")
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def user_defined_location
|
25
|
+
if Selenium::WebDriver::Chrome.path
|
26
|
+
Webdrivers.logger.debug "Selenium::WebDriver::Chrome.path: #{Selenium::WebDriver::Chrome.path}"
|
27
|
+
return Selenium::WebDriver::Chrome.path
|
28
|
+
end
|
29
|
+
|
30
|
+
return if ENV['WD_CHROME_PATH'].nil?
|
18
31
|
|
32
|
+
Webdrivers.logger.debug "WD_CHROME_PATH: #{ENV['WD_CHROME_PATH']}"
|
33
|
+
ENV['WD_CHROME_PATH']
|
34
|
+
end
|
35
|
+
|
36
|
+
def win_location
|
19
37
|
envs = %w[LOCALAPPDATA PROGRAMFILES PROGRAMFILES(X86)]
|
20
38
|
directories = ['\\Google\\Chrome\\Application', '\\Chromium\\Application']
|
21
39
|
file = 'chrome.exe'
|
@@ -23,13 +41,7 @@ module Webdrivers
|
|
23
41
|
directories.each do |dir|
|
24
42
|
envs.each do |root|
|
25
43
|
option = "#{ENV[root]}\\#{dir}\\#{file}"
|
26
|
-
|
27
|
-
|
28
|
-
# Fix for JRuby on Windows - #41 and #130.
|
29
|
-
# Escape space and parenthesis with backticks.
|
30
|
-
option = option.gsub(/([\s()])/, '`\1') if RUBY_PLATFORM == 'java'
|
31
|
-
|
32
|
-
return System.escape_path(option)
|
44
|
+
return option if File.exist?(option)
|
33
45
|
end
|
34
46
|
end
|
35
47
|
end
|
@@ -42,7 +54,7 @@ module Webdrivers
|
|
42
54
|
directories.each do |dir|
|
43
55
|
files.each do |file|
|
44
56
|
option = "#{dir}/#{file}"
|
45
|
-
return
|
57
|
+
return option if File.exist?(option)
|
46
58
|
end
|
47
59
|
end
|
48
60
|
end
|
@@ -54,7 +66,7 @@ module Webdrivers
|
|
54
66
|
directories.each do |dir|
|
55
67
|
files.each do |file|
|
56
68
|
option = "#{dir}/#{file}"
|
57
|
-
return
|
69
|
+
return option if File.exist?(option)
|
58
70
|
end
|
59
71
|
end
|
60
72
|
end
|
@@ -64,11 +76,11 @@ module Webdrivers
|
|
64
76
|
end
|
65
77
|
|
66
78
|
def linux_version(location)
|
67
|
-
System.call(
|
79
|
+
System.call(location, '--product-version')&.strip
|
68
80
|
end
|
69
81
|
|
70
82
|
def mac_version(location)
|
71
|
-
System.call(
|
83
|
+
System.call(location, '--version')&.strip
|
72
84
|
end
|
73
85
|
end
|
74
86
|
end
|