webdrivers 4.1.3 → 4.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecc36e5f9d3969cfc74f760b76c503aee82245ef3d38e4abf185927b9c4a4de4
4
- data.tar.gz: 0d20abe48637e92ae714e24d50ea7ef51feaeb1dc018fb69ae145f766e799344
3
+ metadata.gz: 5a9aab40e8054bb95185ed1231b7f74757811afb4ad47553b7b78c2fc35ea936
4
+ data.tar.gz: c77d486952c76061d5007030b8e02025a72870469043617ddb230c16b11d0f1f
5
5
  SHA512:
6
- metadata.gz: 69ee84671cb4ea6c45cfc4f12260c43da13827558f7c91653081bdc01f51ca750145bfe9e42908e5a907a60bd75d92698cd8f1cee3a81cd80094946d7841a680
7
- data.tar.gz: 2a047608c7d39f7790fadcb5aa1deb91abe8daf6c1132059f9f61c03bcffe39d8983e9aa8c65b7bad6abe2af71e3f4031317ae92331497e807c44c294356eae5
6
+ metadata.gz: c9f29b0e62b33afe328f833ac8a8cb55e11e137938d22a7a66e9e72aa837ee58a9a00f94aa06977c78eac88bd3f446571753728536414b4a9b34a1ddfc0971bf
7
+ data.tar.gz: 2b979a07116667932ee3e0ca71678f1eec119840b712a2d265a61b1c1585bc14134e1238829d336bedf8c1373bff08cd6f0a80c66bf8378d63123e53a3ab249b
@@ -1,3 +1,37 @@
1
+ ### 4.4.2 (2020-12-29)
2
+ * Use new powershell if available to enhance WSL support ([#176](https://github.com/titusfortner/webdrivers/issues/176),
3
+ [#186](https://github.com/titusfortner/webdrivers/pull/186)). Thanks, [G-Rath](https://github.com/G-Rath) and
4
+ [131](https://github.com/131)!
5
+ * Update rubocop version (development dependency only) ([#178](https://github.com/titusfortner/webdrivers/pull/178)).
6
+ Thanks, [utkarsh2102](https://github.com/utkarsh2102)!
7
+ * Replace `git ls-files` with `dir` in the gemspec for better Debian support ([#179](https://github.com/titusfortner/webdrivers/pull/179),
8
+ [#184](https://github.com/titusfortner/webdrivers/issues/184)).
9
+ Thanks again, [utkarsh2102](https://github.com/utkarsh2102)!
10
+ * Update README with `require: false` when adding gem to Gemfile ([#183](https://github.com/titusfortner/webdrivers/pull/183)).
11
+ * Make WSL detection more generic ([#187](https://github.com/titusfortner/webdrivers/pull/187)).
12
+ [rbclark](https://github.com/rbclark)!
13
+
14
+ ### 4.4.1 (2020-06-01)
15
+ * Do not include binstubs used for troubleshooting only. Fixes [#174](https://github.com/titusfortner/webdrivers/issues/174).
16
+
17
+ ### 4.4.0 (2020-05-31)
18
+ * Implement support for `chromedriver` in Windows Subsystem for Linux (WSL) v1 ([#172](https://github.com/titusfortner/webdrivers/issues/172)).
19
+ Thanks, [G-Rath](https://github.com/G-Rath)!
20
+ * Chrome/Edgedriver - Fix [#171](https://github.com/titusfortner/webdrivers/issues/171) by making sure the cached
21
+ driver build version matches the browser build version before using it.
22
+ * Chrome/Edgedriver - Driver version check now matches the driver and browser `major.minor.build` versions instead of just
23
+ the major version to be fully compliant with the `chromedriver` version selection
24
+ [document](https://chromedriver.chromium.org/downloads/version-selection).
25
+
26
+ ### 4.3.0 (2020-04-14)
27
+ * Add support for Microsoft Edge (Chromium) stable
28
+ * Drop support for Ruby < 2.4.0
29
+
30
+ ### 4.2.0 (2019-12-27)
31
+ * Add support for Microsoft Edge (Chromium) Beta releases ([#155](https://github.com/titusfortner/webdrivers/pull/155))
32
+ * Use tilde expansion to resolve user's home directory ([#166](https://github.com/titusfortner/webdrivers/pull/161))
33
+ * Add support for Chromium installed using Snap on Ubuntu ([#163](https://github.com/titusfortner/webdrivers/pull/163)). Thanks Tietew!
34
+
1
35
  ### 4.1.3 (2019-10-07)
2
36
  * 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))
3
37
  * Fix a bug where the file deletion confirmation was printed even when there were no files to delete.
data/README.md CHANGED
@@ -13,13 +13,15 @@ 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/) - Dev and Canary releases on Windows and macOS only
16
+ * [msedgedriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/)
17
+
18
+ Works on macOS, Linux, Windows, and Windows Subsystem for Linux (WSL) v1.
17
19
 
18
20
  ## Usage
19
21
 
20
22
  In your Gemfile:
21
23
 
22
- `gem 'webdrivers', '~> 4.0'`
24
+ `gem 'webdrivers', '~> 4.0', require: false`
23
25
 
24
26
  In your project:
25
27
 
@@ -68,7 +70,7 @@ Webdrivers::Geckodriver.required_version = '0.23.0'
68
70
  Webdrivers::IEdriver.required_version = '3.14.0'
69
71
 
70
72
  # Edge (Chromium)
71
- Webdrivers::Edgedriver.required_version = '76.0.183.0'
73
+ Webdrivers::Edgedriver.required_version = '76.0.183.0'
72
74
  ```
73
75
 
74
76
  You can explicitly trigger the update in your code, but this will happen
@@ -92,10 +94,10 @@ variable. **Only set one to avoid confusion**.
92
94
 
93
95
  ##### Special exception for chromedriver and msedgedriver
94
96
 
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
98
- using a compatible version.
97
+ Cache time will be respected as long as a driver binary exists and the major.minor.build versions of
98
+ the browser and the driver match. For example, if you update Chrome or Edge to v76.0.123 and its driver is
99
+ still at v76.0.100, `webdrivers` will ignore the cache time and update the driver to make sure you're
100
+ using a compatible build version.
99
101
 
100
102
  ### Proxy
101
103
 
@@ -192,6 +194,14 @@ The logging level can be configured for debugging purpose:
192
194
  Webdrivers.logger.level = :DEBUG
193
195
  ```
194
196
 
197
+ ### WSLv1 support
198
+
199
+ While WSLv1 is not designed to run headful applications like Chrome, it can run exes; as such when found to be running
200
+ in WSL, `webdrivers` will use the Windows `chromedriver.exe`.
201
+
202
+ It's recommended that you install the new PowerShell (PS7) to avoid [a known issue](https://github.com/microsoft/terminal/issues/367)
203
+ with the console font being changed when calling the old PowerShell (PS5).
204
+
195
205
  ### Browser Specific Notes
196
206
 
197
207
  #### Chrome/Chromium
@@ -50,6 +50,28 @@ module Webdrivers
50
50
  nil
51
51
  end
52
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
73
+ end
74
+
53
75
  def mac_location
54
76
  directories = ['', File.expand_path('~')]
55
77
  files = ['/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
@@ -66,7 +88,9 @@ module Webdrivers
66
88
  end
67
89
 
68
90
  def linux_location
69
- directories = %w[/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /opt/google/chrome]
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]
70
94
  files = %w[google-chrome chrome chromium chromium-browser]
71
95
 
72
96
  directories.each do |dir|
@@ -80,10 +104,18 @@ module Webdrivers
80
104
  end
81
105
 
82
106
  def win_version(location)
83
- System.call("powershell (Get-ItemProperty '#{location}').VersionInfo.ProductVersion")&.strip
107
+ System.call("pwsh.exe -command \"(Get-ItemProperty '#{location}').VersionInfo.ProductVersion\"")&.strip
108
+ rescue StandardError
109
+ System.call("powershell.exe \"(Get-ItemProperty '#{location}').VersionInfo.ProductVersion\"")&.strip
110
+ end
111
+
112
+ def wsl_version(location)
113
+ win_version(System.to_win32_path(location))
84
114
  end
85
115
 
86
116
  def linux_version(location)
117
+ return wsl_version(location) if System.wsl?
118
+
87
119
  System.call(location, '--product-version')&.strip
88
120
  end
89
121
 
@@ -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 release_version < normalize_version('70')
32
+ return normalize_version('2.41') if browser_build_version < normalize_version('70')
33
33
 
34
- latest_applicable = with_cache(file_name) { latest_point_release(release_version) }
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)
@@ -68,19 +73,18 @@ module Webdrivers
68
73
  else
69
74
  msg
70
75
  end
71
- rescue NetworkError
72
- "#{msg} A network issue is preventing determination of latest chromedriver release."
76
+ rescue NetworkError
77
+ "#{msg} A network issue is preventing determination of latest chromedriver release."
73
78
  end
74
79
 
75
80
  msg = "#{msg} Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` "\
76
- 'to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html'
77
-
81
+ 'to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.html'
78
82
  Webdrivers.logger.debug msg
79
83
  raise VersionError, msg
80
84
  end
81
85
 
82
86
  def file_name
83
- System.platform == 'win' ? 'chromedriver.exe' : 'chromedriver'
87
+ System.platform == 'win' || System.wsl? ? 'chromedriver.exe' : 'chromedriver'
84
88
  end
85
89
 
86
90
  def download_url
@@ -92,24 +96,39 @@ module Webdrivers
92
96
  normalize_version(required_version)
93
97
  end
94
98
 
95
- file_name = System.platform == 'win' ? 'win32' : "#{System.platform}64"
99
+ file_name = System.platform == 'win' || System.wsl? ? 'win32' : "#{System.platform}64"
96
100
  url = "#{base_url}/#{version}/chromedriver_#{file_name}.zip"
97
101
  Webdrivers.logger.debug "chromedriver URL: #{url}"
98
102
  @download_url = url
99
103
  end
100
104
 
101
- # Returns release version from the currently installed Chrome version
105
+ # Returns major.minor.build version from the currently installed chromedriver version
106
+ #
107
+ # @example
108
+ # 73.0.3683.68 (major.minor.build.patch) -> 73.0.3683 (major.minor.build)
109
+ def current_build_version
110
+ build_ver = if current_version.nil? # Driver not found
111
+ nil
112
+ else
113
+ current_version.segments[0..2].join('.')
114
+ end
115
+ normalize_version(build_ver)
116
+ end
117
+
118
+ # Returns major.minor.build version from the currently installed Chrome version
102
119
  #
103
120
  # @example
104
- # 73.0.3683.75 -> 73.0.3683
105
- def release_version
106
- chrome = normalize_version(browser_version)
107
- normalize_version(chrome.segments[0..2].join('.'))
121
+ # 73.0.3683.75 (major.minor.build.patch) -> 73.0.3683 (major.minor.build)
122
+ def browser_build_version
123
+ normalize_version(browser_version.segments[0..2].join('.'))
108
124
  end
125
+ alias chrome_build_version browser_build_version
109
126
 
127
+ # Returns true if an executable driver binary exists
128
+ # and its build version matches the browser build version
110
129
  def sufficient_binary?
111
130
  super && current_version && (current_version < normalize_version('70.0.3538') ||
112
- current_version.segments.first == release_version.segments.first)
131
+ current_build_version == browser_build_version)
113
132
  end
114
133
  end
115
134
  end
@@ -21,7 +21,7 @@ module Webdrivers
21
21
  end
22
22
 
23
23
  DEFAULT_CACHE_TIME = 86_400 # 24 hours
24
- DEFAULT_INSTALL_DIR = File.expand_path(File.join(ENV['HOME'], '.webdrivers'))
24
+ DEFAULT_INSTALL_DIR = File.expand_path('~/.webdrivers')
25
25
 
26
26
  class << self
27
27
  attr_accessor :proxy_addr, :proxy_port, :proxy_user, :proxy_pass
@@ -157,9 +157,15 @@ module Webdrivers
157
157
  nil
158
158
  end
159
159
 
160
- def with_cache(file_name)
161
- if System.valid_cache?(file_name)
162
- normalize_version System.cached_version(file_name)
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
163
169
  else
164
170
  version = yield
165
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 Dev\\Application', '\\Microsoft\\Edge SxS\\Application']
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
 
@@ -26,10 +26,6 @@ module Webdrivers
26
26
  'https://msedgedriver.azureedge.net/'
27
27
  end
28
28
 
29
- def remove
30
- super
31
- end
32
-
33
29
  private
34
30
 
35
31
  def latest_point_release(version)
@@ -58,8 +54,8 @@ module Webdrivers
58
54
  else
59
55
  msg
60
56
  end
61
- rescue NetworkError
62
- "#{msg} A network issue is preventing determination of latest msedgedriver release."
57
+ rescue NetworkError
58
+ "#{msg} A network issue is preventing determination of latest msedgedriver release."
63
59
  end
64
60
 
65
61
  "#{msg} Please set `Webdrivers::Edgedriver.required_version = <desired driver version>` "\
@@ -44,16 +44,19 @@ module Webdrivers
44
44
  end
45
45
 
46
46
  def downloads
47
- doc = Nokogiri::XML.parse(Network.get(base_url))
48
- items = doc.css('Key').collect(&:text)
49
- items.select! { |item| item.include?('IEDriverServer_Win32') }
50
- ds = items.each_with_object({}) do |item, hash|
51
- key = normalize_version item[/([^_]+)\.zip/, 1]
52
- hash[key] = "#{base_url}#{item}"
47
+ ds = download_manifest.each_with_object({}) do |item, hash|
48
+ version = normalize_version item[/([^_]+)\.zip/, 1]
49
+ hash[version] = "#{base_url}#{item}"
53
50
  end
54
51
  Webdrivers.logger.debug "Versions now located on downloads site: #{ds.keys}"
55
52
  ds
56
53
  end
54
+
55
+ def download_manifest
56
+ doc = Nokogiri::XML.parse(Network.get(base_url))
57
+ items = doc.css('Key').collect(&:text)
58
+ items.select { |item| item.include?('IEDriverServer_Win32') }
59
+ end
57
60
  end
58
61
  end
59
62
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'net/http'
4
+
3
5
  module Webdrivers
4
6
  #
5
7
  # @api private
@@ -148,6 +148,25 @@ module Webdrivers
148
148
  end
149
149
  end
150
150
 
151
+ # @return [TrueClass, FalseClass]
152
+ def wsl?
153
+ platform == 'linux' && File.open('/proc/version').read.downcase.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
+
151
170
  def bitsize
152
171
  Selenium::WebDriver::Platform.bitsize
153
172
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Webdrivers
4
- VERSION = '4.1.3'
4
+ VERSION = '4.4.2'
5
5
  end
@@ -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 a network call if cached driver does not match the browser' do
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).once
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 call if cache is valid' do
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 a network call if cache is expired' do
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 a network call if cached driver does not match the browser' do
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(:browser_version).and_return(Gem::Version.new('73.0.3683.68'))
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).once
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 call if cache is valid' do
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', '77.0.207.0')
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('77.0.207.0')
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 a network call if cache is expired' do
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 call if cache is valid' do
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 call if cache is valid' do
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
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.1.3
4
+ version: 4.4.2
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: 2019-10-07 00:00:00.000000000 Z
13
+ date: 2020-12-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ffi
@@ -27,61 +27,61 @@ dependencies:
27
27
  - !ruby/object:Gem::Version
28
28
  version: '1.0'
29
29
  - !ruby/object:Gem::Dependency
30
- name: irb
30
+ name: rake
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ">="
33
+ - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '0'
35
+ version: '12.0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ">="
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0'
42
+ version: '12.0'
43
43
  - !ruby/object:Gem::Dependency
44
- name: rake
44
+ name: rspec
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '12.0'
49
+ version: '3.0'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: '12.0'
56
+ version: '3.0'
57
57
  - !ruby/object:Gem::Dependency
58
- name: rspec
58
+ name: rubocop
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '3.0'
63
+ version: '0.89'
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '3.0'
70
+ version: '0.89'
71
71
  - !ruby/object:Gem::Dependency
72
- name: rubocop
72
+ name: rubocop-packaging
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
- version: '0.66'
77
+ version: 0.5.0
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - "~>"
83
83
  - !ruby/object:Gem::Version
84
- version: '0.66'
84
+ version: 0.5.0
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: rubocop-performance
87
87
  requirement: !ruby/object:Gem::Requirement
@@ -102,14 +102,14 @@ dependencies:
102
102
  requirements:
103
103
  - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: '1.32'
105
+ version: '1.42'
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
- version: '1.32'
112
+ version: '1.42'
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: simplecov
115
115
  requirement: !ruby/object:Gem::Requirement
@@ -181,17 +181,9 @@ executables: []
181
181
  extensions: []
182
182
  extra_rdoc_files: []
183
183
  files:
184
- - ".github/ISSUE_TEMPLATE.md"
185
- - ".gitignore"
186
- - ".rubocop.yml"
187
- - ".travis.yml"
188
184
  - CHANGELOG.md
189
- - Gemfile
190
185
  - LICENSE.txt
191
186
  - README.md
192
- - Rakefile
193
- - appveyor.yml
194
- - gemfiles/Gemfile.edge
195
187
  - lib/webdrivers.rb
196
188
  - lib/webdrivers/Rakefile
197
189
  - lib/webdrivers/chrome_finder.rb
@@ -217,15 +209,17 @@ files:
217
209
  - spec/webdrivers/edgedriver_spec.rb
218
210
  - spec/webdrivers/geckodriver_spec.rb
219
211
  - spec/webdrivers/i_edriver_spec.rb
212
+ - spec/webdrivers/system_spec.rb
220
213
  - spec/webdrivers/webdrivers_spec.rb
221
214
  - spec/webdrivers_proxy_support_spec.rb
222
- - support/install_jruby.ps1
223
- - support/install_msedge.ps1
224
- - webdrivers.gemspec
225
215
  homepage: https://github.com/titusfortner/webdrivers
226
216
  licenses:
227
217
  - MIT
228
- metadata: {}
218
+ metadata:
219
+ bug_tracker_uri: https://github.com/titusfortner/webdrivers/issues
220
+ changelog_uri: https://github.com/titusfortner/webdrivers/blob/master/CHANGELOG.md
221
+ documentation_uri: https://www.rubydoc.info/gems/webdrivers/4.4.2
222
+ source_code_uri: https://github.com/titusfortner/webdrivers/tree/v4.4.2
229
223
  post_install_message:
230
224
  rdoc_options: []
231
225
  require_paths:
@@ -234,15 +228,25 @@ required_ruby_version: !ruby/object:Gem::Requirement
234
228
  requirements:
235
229
  - - ">="
236
230
  - !ruby/object:Gem::Version
237
- version: '0'
231
+ version: 2.4.0
238
232
  required_rubygems_version: !ruby/object:Gem::Requirement
239
233
  requirements:
240
234
  - - ">="
241
235
  - !ruby/object:Gem::Version
242
236
  version: '0'
243
237
  requirements: []
244
- rubygems_version: 3.0.4
238
+ rubygems_version: 3.1.4
245
239
  signing_key:
246
240
  specification_version: 4
247
241
  summary: Easy download and use of browser drivers.
248
- test_files: []
242
+ test_files:
243
+ - spec/spec_helper.rb
244
+ - spec/webdrivers/chrome_finder_spec.rb
245
+ - spec/webdrivers/edge_finder_spec.rb
246
+ - spec/webdrivers/webdrivers_spec.rb
247
+ - spec/webdrivers/system_spec.rb
248
+ - spec/webdrivers/edgedriver_spec.rb
249
+ - spec/webdrivers/i_edriver_spec.rb
250
+ - spec/webdrivers/geckodriver_spec.rb
251
+ - spec/webdrivers/chromedriver_spec.rb
252
+ - spec/webdrivers_proxy_support_spec.rb
@@ -1,16 +0,0 @@
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 DELETED
@@ -1,8 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- chromedriver.log
6
- /.idea/
7
- coverage/
8
- gemfiles/Gemfile.*.lock
@@ -1,47 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.4.6
3
-
4
- require:
5
- - rubocop-rspec
6
- - rubocop-performance
7
-
8
- Layout/SpaceInsideHashLiteralBraces:
9
- EnforcedStyle: no_space
10
-
11
- Layout/EndOfLine:
12
- EnforcedStyle: lf
13
-
14
- Metrics/LineLength:
15
- Max: 120
16
- IgnoredPatterns:
17
- - '\s+# rubocop:disable'
18
-
19
- Metrics/MethodLength:
20
- Max: 20
21
-
22
- Metrics/BlockLength:
23
- Exclude:
24
- - 'spec/**/*'
25
- - 'lib/webdrivers/tasks/*.rake'
26
-
27
- Metrics/ClassLength:
28
- Max: 116
29
- Exclude:
30
- - 'lib/webdrivers/system.rb'
31
-
32
- Metrics/CyclomaticComplexity:
33
- Max: 8
34
-
35
- Metrics/AbcSize:
36
- Max: 16
37
- Exclude:
38
- - 'lib/webdrivers/chromedriver.rb'
39
-
40
- Style/Documentation:
41
- Enabled: false
42
-
43
- RSpec/ExampleLength:
44
- Enabled: false
45
-
46
- RSpec/MultipleExpectations:
47
- Enabled: false
@@ -1,41 +0,0 @@
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
- jdk: openjdk8
28
- env: RAKE_TASK=spec
29
- - rvm: 2.6
30
- env: RAKE_TASK=spec
31
- gemfile: gemfiles/Gemfile.edge
32
- os: osx
33
- osx_image: xcode10.2
34
- addons:
35
- chrome: stable
36
- homebrew:
37
- taps: homebrew/cask-versions
38
- casks:
39
- - microsoft-edge-dev
40
- allow_failures:
41
- - gemfile: gemfiles/Gemfile.edge
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in webdrivers.gemspec
6
- gemspec
data/Rakefile DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
- require 'rubocop/rake_task'
6
-
7
- RuboCop::RakeTask.new
8
-
9
- RSpec::Core::RakeTask.new(:spec)
10
-
11
- task default: %i[rubocop spec]
@@ -1,45 +0,0 @@
1
- build: off
2
- cache:
3
- - vendor/bundle
4
- image:
5
- - Visual Studio 2017
6
- environment:
7
- matrix:
8
- - RUBY_VERSION: Ruby24
9
- RUBY_BIN: ruby
10
- RAKE_TASK: spec
11
- SCRIPT_CONTEXT: bundle exec
12
- - RUBY_VERSION: Ruby24
13
- RUBY_BIN: ruby
14
- RAKE_TASK: rubocop
15
- SCRIPT_CONTEXT: bundle exec
16
- - RUBY_VERSION: Ruby25
17
- RUBY_BIN: ruby
18
- RAKE_TASK: spec
19
- SCRIPT_CONTEXT: bundle exec
20
- - RUBY_VERSION: Ruby26
21
- RUBY_BIN: ruby
22
- RAKE_TASK: spec
23
- SCRIPT_CONTEXT: bundle exec
24
- - RUBY_VERSION: jruby-9.2.7.0
25
- RUBY_BIN: jruby
26
- RAKE_TASK: spec
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
33
- install:
34
- - ps: if ($env:RUBY_BIN -eq 'jruby') { support\install_jruby.ps1 }
35
- - ps: support\install_msedge.ps1
36
- - set PATH=C:\%RUBY_VERSION%\bin;%PATH%
37
- - '%RUBY_BIN% -S gem update --system'
38
- - '%RUBY_BIN% -S gem install bundler'
39
- - '%RUBY_BIN% -S bundle install'
40
- before_test:
41
- - '%RUBY_BIN% -v'
42
- - '%RUBY_BIN% -S gem -v'
43
- - '%RUBY_BIN% -S bundle -v'
44
- test_script:
45
- - '%SCRIPT_CONTEXT% rake %RAKE_TASK%'
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in webdrivers.gemspec
6
- gemspec path: '..'
7
- gem 'selenium-webdriver', github: 'seleniumhq/selenium', glob: 'rb/*.gemspec'
@@ -1,7 +0,0 @@
1
- $downloadLink = "https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.7.0/jruby-dist-9.2.7.0-bin.zip"
2
- $zipPath = "c:\jruby-dist-9.2.7.0-bin.zip"
3
-
4
- Write-Host "Installing $($env:RUBY_VERSION)" -ForegroundColor cyan
5
- appveyor DownloadFile "$($downloadLink)" -FileName "$($zipPath)"
6
- 7z x "$($zipPath)" -oc:\ -y # Unzip to c:\
7
- Write-Host "JRuby installed.`n" -ForegroundColor green
@@ -1,17 +0,0 @@
1
- $downloadDevLink = "https://go.microsoft.com/fwlink/?linkid=2069324&Channel=Dev&language=en-us&Consent=0&IID=85213fc4-6a13-57ae-9082-72910982ede8"
2
- $downloadCanaryLink = "https://go.microsoft.com/fwlink/?linkid=2084706&Channel=Canary&language=en-us&Consent=0&IID=85213fc4-6a13-57ae-9082-72910982ede8"
3
- $devSetup = "C:\MicrosoftEdgeSetupDev.exe"
4
- $canarySetup = "C:\MicrosoftEdgeSetupCanary.exe"
5
-
6
- # Note: We're purposely skipping the -Wait flag in Start-Process.
7
- # This is because Edge auto-launches after the setup is done and
8
- # Start-Process continues to indefinitely wait on that process.
9
- Write-Host "Installing Microsoft Edge (Dev)..." -ForegroundColor cyan
10
- Invoke-WebRequest $downloadDevLink -OutFile $devSetup # Download Dev
11
- Start-Process $devSetup # Run installer
12
- Write-Host "Microsoft Edge (Dev) installed.`n" -ForegroundColor green
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
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
5
- require 'webdrivers/version'
6
-
7
- Gem::Specification.new do |s|
8
- s.name = 'webdrivers'
9
- s.version = Webdrivers::VERSION
10
- s.authors = ['Titus Fortner', 'Lakshya Kapoor', 'Thomas Walpole']
11
- s.email = %w[titusfortner@gmail.com kapoorlakshya@gmail.com]
12
- s.homepage = 'https://github.com/titusfortner/webdrivers'
13
- s.summary = 'Easy download and use of browser drivers.'
14
- s.description = 'Run Selenium tests more easily with install and updates for all supported webdrivers.'
15
- s.licenses = ['MIT']
16
-
17
- s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
20
- s.require_paths = ['lib']
21
-
22
- s.add_development_dependency 'ffi', '~> 1.0' # For selenium-webdriver on Windows
23
- s.add_development_dependency 'irb'
24
- s.add_development_dependency 'rake', '~> 12.0'
25
- s.add_development_dependency 'rspec', '~> 3.0'
26
- s.add_development_dependency 'rubocop', '~>0.66'
27
- s.add_development_dependency 'rubocop-performance'
28
- s.add_development_dependency 'rubocop-rspec', '~>1.32'
29
- s.add_development_dependency 'simplecov', '~>0.16'
30
-
31
- s.add_runtime_dependency 'nokogiri', '~> 1.6'
32
- s.add_runtime_dependency 'rubyzip', '>= 1.3.0'
33
- s.add_runtime_dependency 'selenium-webdriver', '>= 3.0', '< 4.0'
34
- end