selenium-webdriver 4.8.0 → 4.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +13 -1
- data/bin/linux/selenium-manager +0 -0
- data/bin/macos/selenium-manager +0 -0
- data/bin/windows/selenium-manager.exe +0 -0
- data/lib/selenium/webdriver/bidi/log/filter_by.rb +40 -0
- data/lib/selenium/webdriver/bidi/log_inspector.rb +35 -32
- data/lib/selenium/webdriver/bidi.rb +1 -1
- data/lib/selenium/webdriver/common/driver.rb +6 -2
- data/lib/selenium/webdriver/remote/{commands.rb → bridge/commands.rb} +0 -0
- data/lib/selenium/webdriver/remote/bridge.rb +1 -0
- data/lib/selenium/webdriver/remote.rb +0 -1
- data/lib/selenium/webdriver/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9777fa00d3b0216e227ce5194d19da4268b8c7805b27d57782fa33f27d13e66c
|
4
|
+
data.tar.gz: 0c5fa5ecf085aa83a0d2ba6ef690c98a637ee6667656a0e2edb129a2850307a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d10526d84df80cd437990f38cb9b4445b19c67141115ba53ae5b300d668f5e8ef87f11b8efa70b231535bc817d2d276e21e83c70564fed3165a6627a08a17abe
|
7
|
+
data.tar.gz: 9175b92a1ca431f2ffde1d1005c2a6e712c7a2c0808c58581f51a440d33e3307fd1693ae8fd098571ddd68d8bc06d5257e9ec3467b071758a25db9aab990232e
|
data/CHANGES
CHANGED
@@ -1,4 +1,16 @@
|
|
1
|
-
4.8.
|
1
|
+
4.8.1 (2023-02-17)
|
2
|
+
=========================
|
3
|
+
Ruby:
|
4
|
+
* Fix autoload of WebDriver::Remote::Bridge::COMMANDS
|
5
|
+
* Subclass is setting value before the superclass is setting it to nil
|
6
|
+
* Updating Selenium Manager binaries for 4.8.1 release
|
7
|
+
|
8
|
+
BiDi:
|
9
|
+
* Released selenium-devtools 0.110.0 (supports CDP v85, v108, v109, v110)
|
10
|
+
* Close BiDi session on closing the last top-level browsing context
|
11
|
+
* Add filtering capability to LogInspector
|
12
|
+
|
13
|
+
4.8.0 (2023-01-23)
|
2
14
|
=========================
|
3
15
|
Ruby:
|
4
16
|
* Allow updating instance variables on service classes
|
data/bin/linux/selenium-manager
CHANGED
Binary file
|
data/bin/macos/selenium-manager
CHANGED
Binary file
|
Binary file
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
4
|
+
# or more contributor license agreements. See the NOTICE file
|
5
|
+
# distributed with this work for additional information
|
6
|
+
# regarding copyright ownership. The SFC licenses this file
|
7
|
+
# to you under the Apache License, Version 2.0 (the
|
8
|
+
# "License"); you may not use this file except in compliance
|
9
|
+
# with the License. You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
14
|
+
# software distributed under the License is distributed on an
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
16
|
+
# KIND, either express or implied. See the License for the
|
17
|
+
# specific language governing permissions and limitations
|
18
|
+
# under the License.
|
19
|
+
|
20
|
+
module Selenium
|
21
|
+
module WebDriver
|
22
|
+
class BiDi
|
23
|
+
class FilterBy
|
24
|
+
attr_accessor :level
|
25
|
+
|
26
|
+
def initialize(level)
|
27
|
+
@level = level
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.log_level(level = nil)
|
31
|
+
unless %w[debug error info warning].include?(level)
|
32
|
+
raise Error::WebDriverError,
|
33
|
+
"Valid log levels are 'debug', 'error', 'info' and 'warning'. Received: #{level}"
|
34
|
+
end
|
35
|
+
FilterBy.new(level)
|
36
|
+
end
|
37
|
+
end # FilterBy
|
38
|
+
end # BiDi
|
39
|
+
end # WebDriver
|
40
|
+
end # Selenium
|
@@ -23,6 +23,7 @@ require_relative 'log/base_log_entry'
|
|
23
23
|
require_relative 'log/generic_log_entry'
|
24
24
|
require_relative 'log/console_log_entry'
|
25
25
|
require_relative 'log/javascript_log_entry'
|
26
|
+
require_relative 'log/filter_by'
|
26
27
|
|
27
28
|
module Selenium
|
28
29
|
module WebDriver
|
@@ -49,43 +50,41 @@ module Selenium
|
|
49
50
|
@bidi.session.subscribe('log.entryAdded', browsing_context_ids)
|
50
51
|
end
|
51
52
|
|
52
|
-
def on_console_entry(&block)
|
53
|
-
|
54
|
-
log_listeners[:console] << block
|
55
|
-
return if enabled
|
53
|
+
def on_console_entry(filter_by = nil, &block)
|
54
|
+
check_valid_filter(filter_by)
|
56
55
|
|
57
56
|
on_log do |params|
|
58
57
|
type = params['type']
|
59
|
-
console_log_events(params) if type.eql?('console')
|
58
|
+
console_log_events(params, filter_by, &block) if type.eql?('console')
|
60
59
|
end
|
61
60
|
end
|
62
61
|
|
63
|
-
def on_javascript_log(&block)
|
64
|
-
|
65
|
-
log_listeners[:javascript] << block
|
66
|
-
return if enabled
|
62
|
+
def on_javascript_log(filter_by = nil, &block)
|
63
|
+
check_valid_filter(filter_by)
|
67
64
|
|
68
65
|
on_log do |params|
|
69
66
|
type = params['type']
|
70
|
-
javascript_log_events(params) if type.eql?('javascript')
|
67
|
+
javascript_log_events(params, filter_by, &block) if type.eql?('javascript')
|
71
68
|
end
|
72
69
|
end
|
73
70
|
|
74
71
|
def on_javascript_exception(&block)
|
75
|
-
enabled = log_listeners[:js_exception].any?
|
76
|
-
log_listeners[:js_exception] << block
|
77
|
-
log_listeners[:javascript] << block
|
78
|
-
return if enabled
|
79
|
-
|
80
72
|
on_log do |params|
|
81
73
|
type = params['type']
|
82
|
-
|
83
|
-
|
84
|
-
javascript_log_events(params) if type.eql?('javascript') && level.eql?(LOG_LEVEL[:ERROR])
|
74
|
+
javascript_log_events(params, FilterBy.log_level('error'), &block) if type.eql?('javascript')
|
85
75
|
end
|
86
76
|
end
|
87
77
|
|
88
|
-
def on_log(&block)
|
78
|
+
def on_log(filter_by = nil, &block)
|
79
|
+
unless filter_by.nil?
|
80
|
+
check_valid_filter(filter_by)
|
81
|
+
|
82
|
+
on(:entry_added) do |params|
|
83
|
+
yield(params) if params['level'] == filter_by.level
|
84
|
+
end
|
85
|
+
return
|
86
|
+
end
|
87
|
+
|
89
88
|
on(:entry_added, &block)
|
90
89
|
end
|
91
90
|
|
@@ -96,11 +95,13 @@ module Selenium
|
|
96
95
|
@bidi.callbacks["log.#{event}"] << block
|
97
96
|
end
|
98
97
|
|
99
|
-
def
|
100
|
-
|
98
|
+
def check_valid_filter(filter_by)
|
99
|
+
return if filter_by.nil? || filter_by.instance_of?(FilterBy)
|
100
|
+
|
101
|
+
raise "Pass valid FilterBy object. Received: #{filter_by.inspect}"
|
101
102
|
end
|
102
103
|
|
103
|
-
def console_log_events(params)
|
104
|
+
def console_log_events(params, filter_by)
|
104
105
|
event = ConsoleLogEntry.new(
|
105
106
|
level: params['level'],
|
106
107
|
text: params['text'],
|
@@ -111,12 +112,16 @@ module Selenium
|
|
111
112
|
args: params['args'],
|
112
113
|
stack_trace: params['stackTrace']
|
113
114
|
)
|
114
|
-
|
115
|
-
|
115
|
+
|
116
|
+
unless filter_by.nil?
|
117
|
+
yield(event) if params['level'] == filter_by.level
|
118
|
+
return
|
116
119
|
end
|
120
|
+
|
121
|
+
yield(event)
|
117
122
|
end
|
118
123
|
|
119
|
-
def javascript_log_events(params)
|
124
|
+
def javascript_log_events(params, filter_by)
|
120
125
|
event = JavascriptLogEntry.new(
|
121
126
|
level: params['level'],
|
122
127
|
text: params['text'],
|
@@ -124,15 +129,13 @@ module Selenium
|
|
124
129
|
type: params['type'],
|
125
130
|
stack_trace: params['stackTrace']
|
126
131
|
)
|
127
|
-
log_listeners[:javascript].each do |listener|
|
128
|
-
listener.call(event)
|
129
|
-
end
|
130
132
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
listener.call(event)
|
133
|
+
unless filter_by.nil?
|
134
|
+
yield(event) if params['level'] == filter_by.level
|
135
|
+
return
|
135
136
|
end
|
137
|
+
|
138
|
+
yield(event)
|
136
139
|
end
|
137
140
|
end # LogInspector
|
138
141
|
end # Bidi
|
@@ -69,8 +69,8 @@ module Selenium
|
|
69
69
|
#
|
70
70
|
|
71
71
|
def initialize(bridge: nil, listener: nil, **opts)
|
72
|
-
@service_manager = nil
|
73
72
|
@devtools = nil
|
73
|
+
@bidi = nil
|
74
74
|
bridge ||= create_bridge(**opts)
|
75
75
|
add_extensions(bridge.browser)
|
76
76
|
@bridge = listener ? Support::EventFiringBridge.new(bridge, listener) : bridge
|
@@ -174,6 +174,7 @@ module Selenium
|
|
174
174
|
ensure
|
175
175
|
@service_manager&.stop
|
176
176
|
@devtools&.close
|
177
|
+
@bidi&.close
|
177
178
|
end
|
178
179
|
|
179
180
|
#
|
@@ -181,7 +182,10 @@ module Selenium
|
|
181
182
|
#
|
182
183
|
|
183
184
|
def close
|
184
|
-
|
185
|
+
# If no top-level browsing contexts are open after calling close,
|
186
|
+
# it indicates that the WebDriver session is closed.
|
187
|
+
# If the WebDriver session is closed, the BiDi session also needs to be closed.
|
188
|
+
bridge.close.tap { |handles| @bidi&.close if handles&.empty? }
|
185
189
|
end
|
186
190
|
|
187
191
|
#
|
File without changes
|
@@ -27,7 +27,6 @@ module Selenium
|
|
27
27
|
autoload :Driver, 'selenium/webdriver/remote/driver'
|
28
28
|
autoload :Response, 'selenium/webdriver/remote/response'
|
29
29
|
autoload :Capabilities, 'selenium/webdriver/remote/capabilities'
|
30
|
-
autoload :COMMANDS, 'selenium/webdriver/remote/commands'
|
31
30
|
|
32
31
|
module Http
|
33
32
|
autoload :Common, 'selenium/webdriver/remote/http/common'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-webdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.8.
|
4
|
+
version: 4.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Rodionov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-02-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rexml
|
@@ -225,6 +225,7 @@ files:
|
|
225
225
|
- lib/selenium/webdriver/bidi/browsing_context_info.rb
|
226
226
|
- lib/selenium/webdriver/bidi/log/base_log_entry.rb
|
227
227
|
- lib/selenium/webdriver/bidi/log/console_log_entry.rb
|
228
|
+
- lib/selenium/webdriver/bidi/log/filter_by.rb
|
228
229
|
- lib/selenium/webdriver/bidi/log/generic_log_entry.rb
|
229
230
|
- lib/selenium/webdriver/bidi/log/javascript_log_entry.rb
|
230
231
|
- lib/selenium/webdriver/bidi/log_inspector.rb
|
@@ -352,8 +353,8 @@ files:
|
|
352
353
|
- lib/selenium/webdriver/ie/service.rb
|
353
354
|
- lib/selenium/webdriver/remote.rb
|
354
355
|
- lib/selenium/webdriver/remote/bridge.rb
|
356
|
+
- lib/selenium/webdriver/remote/bridge/commands.rb
|
355
357
|
- lib/selenium/webdriver/remote/capabilities.rb
|
356
|
-
- lib/selenium/webdriver/remote/commands.rb
|
357
358
|
- lib/selenium/webdriver/remote/driver.rb
|
358
359
|
- lib/selenium/webdriver/remote/http/common.rb
|
359
360
|
- lib/selenium/webdriver/remote/http/curb.rb
|