webdrivers 4.7.0 → 5.0.0

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: 124d154092dc8915735f459f0476c7700e47300bec986e9b88ba214b2db8b92c
4
- data.tar.gz: 9db15712e5227ef9b92db34a7d1714ba9613ca2bd30563b85cf5dbeee5322063
3
+ metadata.gz: f4c9d9a6544732e58eb7a88d34e39b188b5ff658caaa14fbdff15931a69d1e2d
4
+ data.tar.gz: 92a4997e99508bb79374838461cd2fee48591185b271dd6ce170628c51a02c2c
5
5
  SHA512:
6
- metadata.gz: 727a676f6b025291ecc30fff84b16159820607f4dba0c1216b3c1487f56b5bb4da8679b69b464a5234dc78d872da4b63112b11d60efd3fbb72cfbaf61ea57223
7
- data.tar.gz: 744f5a8173676d02b2f94ff3eda885ec77d47a4e2e04cbfaa04876262e500e906313f6280d0a12e93274ba7f558886a035879d72b0264903fc695c2139b4ca83
6
+ metadata.gz: fb469a584a66b14097ec87b6a8f2ad30e2cbefdaeef91efd2a50f16ff0451c8a748f8607d53d06ceed3506d61e54ef31b9997e068f9e55dfe9136f8012570234
7
+ data.tar.gz: ed61ff78edd17f205673242eeba0fa76dcb2df9675a7d8dc4c813e8dd056799a44b13c1a10b238eeb36bae96cc188ca20c4edd71aebf9ec48e9a78e613136f17
data/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
+ # 5.0.0 (2021-10-19)
2
+ * Require Selenium 4+
3
+ * Remove custom Logger and use the one in Selenium 4
4
+
1
5
  # 4.7.0 (2021-10-14)
2
6
  * Add support for Selenium 4.x #218 (thanks yahonda )
3
7
  * Allow Edge on Linux
4
8
  * Update required Selenium > 3.141 because of a change in 4.6
5
- * Require Selenium 2.6+
9
+ * Require Ruby 2.6+
6
10
  * Fix IE downloads with the change in location of assets
7
11
 
8
12
  # 4.6.1 (2021-08-19)
data/README.md CHANGED
@@ -22,7 +22,7 @@ notes at the bottom.
22
22
  In your Gemfile:
23
23
 
24
24
  ```ruby
25
- gem 'webdrivers', '~> 4.0', require: false
25
+ gem 'webdrivers', '~> 5.0', require: false
26
26
  ```
27
27
 
28
28
  In your project:
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rubygems/package'
4
- require 'webdrivers/logger'
5
4
  require 'webdrivers/network'
6
5
  require 'webdrivers/system'
7
6
  require 'selenium-webdriver'
7
+ require 'webdrivers/logger'
8
8
  require 'webdrivers/version'
9
9
 
10
10
  module Webdrivers
@@ -1,11 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'forwardable'
4
- require 'logger'
5
-
6
- # Code adapted from Selenium Implementation
7
- # https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/common/logger.rb
8
-
9
3
  module Webdrivers
10
4
  #
11
5
  # @example Enable full logging
@@ -18,94 +12,9 @@ module Webdrivers
18
12
  # Webdrivers.logger.info('This is info message')
19
13
  # Webdrivers.logger.warn('This is warning message')
20
14
  #
21
- class Logger
22
- extend Forwardable
23
- include ::Logger::Severity
24
-
25
- def_delegators :@logger, :debug, :debug?,
26
- :info, :info?,
27
- :warn, :warn?,
28
- :error, :error?,
29
- :fatal, :fatal?,
30
- :level
31
-
15
+ class Logger < Selenium::WebDriver::Logger
32
16
  def initialize
33
- @logger = create_logger($stdout)
34
- end
35
-
36
- def output=(io)
37
- # `Logger#reopen` was added in Ruby 2.3
38
- if @logger.respond_to?(:reopen)
39
- @logger.reopen(io)
40
- else
41
- @logger = create_logger(io)
42
- end
43
- end
44
-
45
- #
46
- # For Ruby < 2.3 compatibility
47
- # Based on https://github.com/ruby/ruby/blob/ruby_2_3/lib/logger.rb#L250
48
- #
49
-
50
- def level=(severity)
51
- if severity.is_a?(Integer)
52
- @logger.level = severity
53
- else
54
- case severity.to_s.downcase
55
- when 'debug'
56
- @logger.level = DEBUG
57
- when 'info'
58
- @logger.level = INFO
59
- when 'warn'
60
- @logger.level = WARN
61
- when 'error'
62
- @logger.level = ERROR
63
- when 'fatal'
64
- @logger.level = FATAL
65
- when 'unknown'
66
- @logger.level = UNKNOWN
67
- else
68
- raise ArgumentError, "invalid log level: #{severity}"
69
- end
70
- end
71
- end
72
-
73
- #
74
- # Returns IO object used by logger internally.
75
- #
76
- # Normally, we would have never needed it, but we want to
77
- # use it as IO object for all child processes to ensure their
78
- # output is redirected there.
79
- #
80
- # It is only used in debug level, in other cases output is suppressed.
81
- #
82
- # @api private
83
- #
84
- def io
85
- @logger.instance_variable_get(:@logdev).instance_variable_get(:@dev)
86
- end
87
-
88
- #
89
- # Marks code as deprecated with replacement.
90
- #
91
- # @param [String] old
92
- # @param [String] new
93
- #
94
- def deprecate(old, new)
95
- warn "[DEPRECATION] #{old} is deprecated. Use #{new} instead."
96
- end
97
-
98
- private
99
-
100
- def create_logger(output)
101
- logger = ::Logger.new(output)
102
- logger.progname = 'Webdrivers'
103
- logger.level = ($DEBUG ? DEBUG : WARN)
104
- logger.formatter = proc do |severity, time, progname, msg|
105
- "#{time.strftime('%F %T')} #{severity} #{progname} #{msg}\n"
106
- end
107
-
108
- logger
17
+ super('Webdrivers')
109
18
  end
110
19
  end
111
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Webdrivers
4
- VERSION = '4.7.0'
4
+ VERSION = '5.0.0'
5
5
  end
@@ -5,13 +5,7 @@ require 'spec_helper'
5
5
  describe Webdrivers::EdgeFinder do
6
6
  let(:edge_finder) { described_class }
7
7
 
8
- before(:all) do # rubocop:disable RSpec/BeforeAfterAll
9
- if Selenium::WebDriver::VERSION[0].to_i < 4
10
- skip 'The current selenium-webdriver does not include Chromium based Edge support'
11
- elsif Webdrivers::System.platform == 'linux'
12
- skip 'Edge is not yet supported on Linux'
13
- end
14
- end
8
+ before { skip 'Edge is not yet supported on Linux' if Webdrivers::System.platform == 'linux' }
15
9
 
16
10
  context 'when the user relies on the gem to figure out the location of Edge' do
17
11
  it 'determines the location correctly based on the current OS' do
@@ -5,16 +5,11 @@ require 'spec_helper'
5
5
  describe Webdrivers::Edgedriver do
6
6
  let(:edgedriver) { described_class }
7
7
 
8
- before(:all) do # rubocop:disable RSpec/BeforeAfterAll
9
- if Selenium::WebDriver::VERSION[0].to_i < 4
10
- skip 'The current selenium-webdriver does not include Chromium based Edge support'
11
- elsif Webdrivers::System.platform == 'linux'
12
- skip 'Edge is not yet supported on Linux'
13
- end
8
+ before do
9
+ skip 'Edge is not yet supported on Linux' if Webdrivers::System.platform == 'linux'
10
+ edgedriver.remove
14
11
  end
15
12
 
16
- before { edgedriver.remove }
17
-
18
13
  describe '#update' do
19
14
  context 'when evaluating #correct_binary?' do
20
15
  it 'does not download when latest version and current version match' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdrivers
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.0
4
+ version: 5.0.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: 2021-10-14 00:00:00.000000000 Z
13
+ date: 2021-10-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ffi
@@ -156,22 +156,16 @@ dependencies:
156
156
  name: selenium-webdriver
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
- - - ">"
160
- - !ruby/object:Gem::Version
161
- version: '3.141'
162
- - - "<"
159
+ - - "~>"
163
160
  - !ruby/object:Gem::Version
164
- version: '5.0'
161
+ version: '4.0'
165
162
  type: :runtime
166
163
  prerelease: false
167
164
  version_requirements: !ruby/object:Gem::Requirement
168
165
  requirements:
169
- - - ">"
170
- - !ruby/object:Gem::Version
171
- version: '3.141'
172
- - - "<"
166
+ - - "~>"
173
167
  - !ruby/object:Gem::Version
174
- version: '5.0'
168
+ version: '4.0'
175
169
  description: Run Selenium tests more easily with install and updates for all supported
176
170
  webdrivers.
177
171
  email:
@@ -218,8 +212,8 @@ licenses:
218
212
  metadata:
219
213
  bug_tracker_uri: https://github.com/titusfortner/webdrivers/issues
220
214
  changelog_uri: https://github.com/titusfortner/webdrivers/blob/master/CHANGELOG.md
221
- documentation_uri: https://www.rubydoc.info/gems/webdrivers/4.7.0
222
- source_code_uri: https://github.com/titusfortner/webdrivers/tree/v4.7.0
215
+ documentation_uri: https://www.rubydoc.info/gems/webdrivers/5.0.0
216
+ source_code_uri: https://github.com/titusfortner/webdrivers/tree/v5.0.0
223
217
  post_install_message:
224
218
  rdoc_options: []
225
219
  require_paths: