selenium-webdriver 4.35.0 → 4.47.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/CHANGES +111 -0
- data/Gemfile +1 -4
- data/LICENSE +1 -1
- data/NOTICE +1 -1
- data/README.md +43 -23
- data/bin/linux/selenium-manager +0 -0
- data/bin/macos/selenium-manager +0 -0
- data/bin/selenium-manager-THIRD-PARTY-NOTICES.txt +5971 -0
- data/bin/selenium-manager.cdx.json +11629 -0
- data/bin/windows/selenium-manager.exe +0 -0
- data/lib/selenium/server.rb +30 -5
- data/lib/selenium/webdriver/atoms/findElements.js +272 -54
- data/lib/selenium/webdriver/atoms/getAttribute.js +152 -6
- data/lib/selenium/webdriver/atoms/isDisplayed.js +385 -28
- data/lib/selenium/webdriver/bidi/browser.rb +71 -0
- data/lib/selenium/webdriver/bidi/browsing_context.rb +3 -2
- data/lib/selenium/webdriver/bidi/{log/filter_by.rb → error.rb} +20 -16
- data/lib/selenium/webdriver/bidi/log_handler.rb +5 -0
- data/lib/selenium/webdriver/bidi/network/cookies.rb +13 -9
- data/lib/selenium/webdriver/bidi/network/credentials.rb +4 -0
- data/lib/selenium/webdriver/bidi/network/headers.rb +4 -0
- data/lib/selenium/webdriver/bidi/network/intercepted_auth.rb +4 -0
- data/lib/selenium/webdriver/bidi/network/intercepted_item.rb +4 -0
- data/lib/selenium/webdriver/bidi/network/intercepted_request.rb +20 -4
- data/lib/selenium/webdriver/bidi/network/intercepted_response.rb +24 -6
- data/lib/selenium/webdriver/bidi/network/url_pattern.rb +4 -0
- data/lib/selenium/webdriver/bidi/network.rb +18 -9
- data/lib/selenium/webdriver/bidi/protocol/bluetooth.rb +495 -0
- data/lib/selenium/webdriver/bidi/protocol/browser.rb +250 -0
- data/lib/selenium/webdriver/bidi/protocol/browsing_context.rb +798 -0
- data/lib/selenium/webdriver/bidi/{log/base_log_entry.rb → protocol/domain.rb} +22 -11
- data/lib/selenium/webdriver/bidi/protocol/emulation.rb +448 -0
- data/lib/selenium/webdriver/bidi/protocol/error_code.rb +66 -0
- data/lib/selenium/webdriver/bidi/protocol/input.rb +354 -0
- data/lib/selenium/webdriver/bidi/protocol/log.rb +115 -0
- data/lib/selenium/webdriver/bidi/protocol/network.rb +720 -0
- data/lib/selenium/webdriver/bidi/protocol/permissions.rb +75 -0
- data/lib/selenium/webdriver/bidi/protocol/script.rb +1052 -0
- data/lib/selenium/webdriver/bidi/protocol/session.rb +286 -0
- data/lib/selenium/webdriver/bidi/protocol/speculation.rb +58 -0
- data/lib/selenium/webdriver/bidi/protocol/storage.rb +183 -0
- data/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb +88 -0
- data/lib/selenium/webdriver/bidi/protocol/web_extension.rb +132 -0
- data/lib/selenium/webdriver/bidi/protocol.rb +42 -0
- data/lib/selenium/webdriver/bidi/serialization/record.rb +402 -0
- data/lib/selenium/webdriver/bidi/serialization/union.rb +156 -0
- data/lib/selenium/webdriver/bidi/serialization.rb +90 -0
- data/lib/selenium/webdriver/bidi/session.rb +4 -0
- data/lib/selenium/webdriver/bidi/support/bidi_generate.rb +1420 -0
- data/lib/selenium/webdriver/bidi/support/check_generated.rb +63 -0
- data/lib/selenium/webdriver/bidi/transport.rb +57 -0
- data/lib/selenium/webdriver/bidi.rb +4 -1
- data/lib/selenium/webdriver/chrome/driver.rb +4 -3
- data/lib/selenium/webdriver/chrome/service.rb +13 -0
- data/lib/selenium/webdriver/chromium/driver.rb +0 -1
- data/lib/selenium/webdriver/chromium/options.rb +23 -1
- data/lib/selenium/webdriver/chromium/profile.rb +6 -0
- data/lib/selenium/webdriver/common/child_process.rb +2 -1
- data/lib/selenium/webdriver/common/client_config.rb +97 -0
- data/lib/selenium/webdriver/common/driver.rb +13 -7
- data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -7
- data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -7
- data/lib/selenium/webdriver/common/driver_extensions/{has_bidi.rb → has_session_events.rb} +19 -7
- data/lib/selenium/webdriver/common/driver_finder.rb +35 -25
- data/lib/selenium/webdriver/common/error.rb +10 -3
- data/lib/selenium/webdriver/common/local_driver.rb +29 -12
- data/lib/selenium/webdriver/common/logger.rb +28 -0
- data/lib/selenium/webdriver/common/manager.rb +2 -0
- data/lib/selenium/webdriver/common/options.rb +41 -2
- data/lib/selenium/webdriver/common/platform.rb +1 -3
- data/lib/selenium/webdriver/common/proxy.rb +1 -9
- data/lib/selenium/webdriver/common/selenium_manager.rb +2 -1
- data/lib/selenium/webdriver/common/service.rb +4 -8
- data/lib/selenium/webdriver/common/service_manager.rb +36 -4
- data/lib/selenium/webdriver/common/socket_poller.rb +1 -1
- data/lib/selenium/webdriver/common/takes_screenshot.rb +1 -1
- data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +1 -1
- data/lib/selenium/webdriver/common/wait.rb +4 -1
- data/lib/selenium/webdriver/common/websocket_connection.rb +73 -37
- data/lib/selenium/webdriver/common.rb +2 -1
- data/lib/selenium/webdriver/devtools/response.rb +3 -3
- data/lib/selenium/webdriver/devtools.rb +1 -1
- data/lib/selenium/webdriver/edge/driver.rb +4 -3
- data/lib/selenium/webdriver/edge/service.rb +14 -0
- data/lib/selenium/webdriver/firefox/driver.rb +4 -6
- data/lib/selenium/webdriver/firefox/options.rb +19 -0
- data/lib/selenium/webdriver/firefox/profile.rb +13 -6
- data/lib/selenium/webdriver/firefox/service.rb +31 -2
- data/lib/selenium/webdriver/ie/driver.rb +4 -3
- data/lib/selenium/webdriver/ie/service.rb +10 -0
- data/lib/selenium/webdriver/remote/bidi_bridge.rb +44 -10
- data/lib/selenium/webdriver/remote/bridge.rb +20 -14
- data/lib/selenium/webdriver/remote/driver.rb +15 -4
- data/lib/selenium/webdriver/remote/features.rb +26 -1
- data/lib/selenium/webdriver/remote/http/common.rb +57 -12
- data/lib/selenium/webdriver/remote/http/curb.rb +6 -8
- data/lib/selenium/webdriver/remote/http/default.rb +56 -39
- data/lib/selenium/webdriver/safari/driver.rb +4 -3
- data/lib/selenium/webdriver/safari/options.rb +23 -4
- data/lib/selenium/webdriver/safari.rb +1 -6
- data/lib/selenium/webdriver/support/block_event_listener.rb +5 -1
- data/lib/selenium/webdriver/support/color.rb +14 -14
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +5 -1
- data/lib/selenium/webdriver/support/guards/guard.rb +30 -14
- data/lib/selenium/webdriver/support/guards.rb +11 -4
- data/lib/selenium/webdriver/version.rb +1 -1
- data/lib/selenium/webdriver.rb +7 -2
- data/selenium-webdriver.gemspec +1 -1
- metadata +33 -11
- data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +0 -35
- data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +0 -33
- data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +0 -33
- data/lib/selenium/webdriver/bidi/log_inspector.rb +0 -147
|
@@ -25,8 +25,10 @@ module Selenium
|
|
|
25
25
|
|
|
26
26
|
# @see https://developer.apple.com/documentation/webkit/about_webdriver_for_safari
|
|
27
27
|
CAPABILITIES = {automatic_inspection: 'safari:automaticInspection',
|
|
28
|
-
automatic_profiling: 'safari:automaticProfiling'
|
|
29
|
-
|
|
28
|
+
automatic_profiling: 'safari:automaticProfiling',
|
|
29
|
+
experimental_web_socket_url: 'safari:experimentalWebSocketUrl'}.freeze
|
|
30
|
+
BROWSER = 'safari'
|
|
31
|
+
TECHNOLOGY_PREVIEW = 'Safari Technology Preview'
|
|
30
32
|
|
|
31
33
|
def add_option(name, value = nil)
|
|
32
34
|
key = name.is_a?(Hash) ? name.keys.first : name
|
|
@@ -35,9 +37,26 @@ module Selenium
|
|
|
35
37
|
super
|
|
36
38
|
end
|
|
37
39
|
|
|
38
|
-
def
|
|
39
|
-
@options[:browser_name] =
|
|
40
|
+
def browser_name=(value)
|
|
41
|
+
@options[:browser_name] = value
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def browser_name
|
|
45
|
+
@options[:browser_name] = Safari.technology_preview? ? TECHNOLOGY_PREVIEW : BROWSER
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
#
|
|
49
|
+
# Enables WebDriver BiDi for Safari, which also requires the experimental capability, and
|
|
50
|
+
# warns that Safari's BiDi support is experimental.
|
|
51
|
+
#
|
|
52
|
+
# @return [Boolean]
|
|
53
|
+
#
|
|
54
|
+
|
|
55
|
+
def enable_bidi!
|
|
40
56
|
super
|
|
57
|
+
WebDriver.logger.warn("Safari's WebDriver BiDi support is experimental and may be incomplete",
|
|
58
|
+
id: :safari_bidi)
|
|
59
|
+
@options[:experimental_web_socket_url] = true
|
|
41
60
|
end
|
|
42
61
|
end # Options
|
|
43
62
|
end # Safari
|
|
@@ -33,7 +33,6 @@ module Selenium
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def technology_preview!
|
|
36
|
-
Service.driver_path = technology_preview
|
|
37
36
|
@use_technology_preview = true
|
|
38
37
|
end
|
|
39
38
|
|
|
@@ -47,11 +46,7 @@ module Selenium
|
|
|
47
46
|
end
|
|
48
47
|
|
|
49
48
|
def path
|
|
50
|
-
@path ||=
|
|
51
|
-
return @path if File.file?(@path) && File.executable?(@path)
|
|
52
|
-
raise Error::WebDriverError, 'Safari is only supported on Mac' unless Platform.os.mac?
|
|
53
|
-
|
|
54
|
-
raise Error::WebDriverError, 'Unable to find Safari'
|
|
49
|
+
@path ||= nil
|
|
55
50
|
end
|
|
56
51
|
end
|
|
57
52
|
end # Safari
|
|
@@ -25,9 +25,13 @@ module Selenium
|
|
|
25
25
|
@callback = callback
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
def method_missing(meth, *)
|
|
28
|
+
def method_missing(meth, *)
|
|
29
29
|
@callback.call(meth, *)
|
|
30
30
|
end
|
|
31
|
+
|
|
32
|
+
def respond_to_missing?(_meth, _include_private = false)
|
|
33
|
+
true
|
|
34
|
+
end
|
|
31
35
|
end # BlockEventListener
|
|
32
36
|
end # Support
|
|
33
37
|
end # WebDriver
|
|
@@ -72,26 +72,26 @@ module Selenium
|
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
def self.from_hsl(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if
|
|
82
|
-
r =
|
|
75
|
+
def self.from_hsl(hue, sat, light, alpha)
|
|
76
|
+
hue = Float(hue) / 360
|
|
77
|
+
sat = Float(sat) / 100
|
|
78
|
+
light = Float(light) / 100
|
|
79
|
+
alpha = Float(alpha || 1)
|
|
80
|
+
|
|
81
|
+
if sat.zero?
|
|
82
|
+
r = light
|
|
83
83
|
g = r
|
|
84
84
|
b = r
|
|
85
85
|
else
|
|
86
|
-
luminocity2 =
|
|
87
|
-
luminocity1 = (
|
|
86
|
+
luminocity2 = light < 0.5 ? light * (sat + 1) : light + sat - (light * sat)
|
|
87
|
+
luminocity1 = (light * 2) - luminocity2
|
|
88
88
|
|
|
89
|
-
r = hue_to_rgb(luminocity1, luminocity2,
|
|
90
|
-
g = hue_to_rgb(luminocity1, luminocity2,
|
|
91
|
-
b = hue_to_rgb(luminocity1, luminocity2,
|
|
89
|
+
r = hue_to_rgb(luminocity1, luminocity2, hue + (1.0 / 3.0))
|
|
90
|
+
g = hue_to_rgb(luminocity1, luminocity2, hue)
|
|
91
|
+
b = hue_to_rgb(luminocity1, luminocity2, hue - (1.0 / 3.0))
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
-
new (r * 255).round, (g * 255).round, (b * 255).round,
|
|
94
|
+
new (r * 255).round, (g * 255).round, (b * 255).round, alpha
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
def self.hue_to_rgb(lum1, lum2, hue)
|
|
@@ -120,9 +120,13 @@ module Selenium
|
|
|
120
120
|
returned
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
-
def method_missing(meth, ...)
|
|
123
|
+
def method_missing(meth, ...)
|
|
124
124
|
@delegate.__send__(meth, ...)
|
|
125
125
|
end
|
|
126
|
+
|
|
127
|
+
def respond_to_missing?(meth, include_private = false)
|
|
128
|
+
@delegate.respond_to?(meth, include_private) || super
|
|
129
|
+
end
|
|
126
130
|
end # EventFiringBridge
|
|
127
131
|
end # Support
|
|
128
132
|
end # WebDriver
|
|
@@ -30,7 +30,7 @@ module Selenium
|
|
|
30
30
|
attr_reader :guarded, :type, :messages, :reason, :tracker
|
|
31
31
|
|
|
32
32
|
def initialize(guarded, type, guards = nil)
|
|
33
|
-
@guarded = guarded
|
|
33
|
+
@guarded = guarded.dup
|
|
34
34
|
@tracker = guards&.bug_tracker || ''
|
|
35
35
|
@messages = guards&.messages || {}
|
|
36
36
|
@messages[:unknown] = 'TODO: Investigate why this is failing and file a bug report'
|
|
@@ -47,40 +47,56 @@ module Selenium
|
|
|
47
47
|
when Symbol
|
|
48
48
|
messages[reason]
|
|
49
49
|
else
|
|
50
|
-
"
|
|
50
|
+
"#{type.to_s.tr('_', ' ')} #{guarded};"
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
case type
|
|
54
|
-
when :exclude
|
|
54
|
+
when :skip_if, :exclude
|
|
55
55
|
"Test skipped because it breaks test run; #{details}"
|
|
56
56
|
when :flaky
|
|
57
57
|
"Test skipped because it is unreliable in this configuration; #{details}"
|
|
58
|
-
when :exclusive
|
|
58
|
+
when :skip_unless, :exclusive
|
|
59
59
|
"Test does not apply to this configuration; #{details}"
|
|
60
|
-
|
|
60
|
+
when :pending_if, :pending_unless, :except, :only
|
|
61
61
|
"Test guarded; #{details}"
|
|
62
|
+
else
|
|
63
|
+
raise ArgumentError, "unknown guard type: #{type}"
|
|
62
64
|
end
|
|
63
65
|
end
|
|
64
66
|
|
|
65
|
-
#
|
|
67
|
+
# Test is expected to fail on the configurations specified (marked pending).
|
|
66
68
|
def except?
|
|
67
|
-
@type == :except
|
|
69
|
+
@type == :pending_if || @type == :except
|
|
68
70
|
end
|
|
69
71
|
|
|
70
|
-
#
|
|
72
|
+
# Test is expected to fail on every configuration except those specified (marked pending).
|
|
71
73
|
def only?
|
|
72
|
-
@type == :only
|
|
74
|
+
@type == :pending_unless || @type == :only
|
|
73
75
|
end
|
|
74
76
|
|
|
75
|
-
#
|
|
76
|
-
# or it is flaky and unreliable
|
|
77
|
+
# Test is skipped on the configurations specified because it breaks the run or is unreliable.
|
|
77
78
|
def exclude?
|
|
78
|
-
@type == :exclude || @type == :flaky
|
|
79
|
+
@type == :skip_if || @type == :exclude || @type == :flaky
|
|
79
80
|
end
|
|
80
81
|
|
|
81
|
-
# Test
|
|
82
|
+
# Test is skipped on every configuration except those specified (it only applies there).
|
|
82
83
|
def exclusive?
|
|
83
|
-
@type == :exclusive
|
|
84
|
+
@type == :skip_unless || @type == :exclusive
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# A pending guard that only applies when the failure matches an expected exception.
|
|
88
|
+
def exception?
|
|
89
|
+
(except? || only?) && !@guarded[:exception].nil?
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Whether the exception is the guard's `exception:` class and matches its optional `message:`
|
|
93
|
+
# (Regexp pattern or exact String), following RSpec's `raise_error` semantics.
|
|
94
|
+
def matches_exception?(exception)
|
|
95
|
+
spec = @guarded[:exception]
|
|
96
|
+
return false unless spec && exception.is_a?(spec[:class])
|
|
97
|
+
|
|
98
|
+
message = spec[:message]
|
|
99
|
+
message.nil? || (message.is_a?(Regexp) ? message.match?(exception.message) : message == exception.message)
|
|
84
100
|
end
|
|
85
101
|
end # Guard
|
|
86
102
|
end # Guards
|
|
@@ -24,7 +24,8 @@ module Selenium
|
|
|
24
24
|
module WebDriver
|
|
25
25
|
module Support
|
|
26
26
|
class Guards
|
|
27
|
-
GUARD_TYPES = %i[
|
|
27
|
+
GUARD_TYPES = %i[pending_if pending_unless skip_if skip_unless flaky
|
|
28
|
+
except only exclude exclusive].freeze
|
|
28
29
|
|
|
29
30
|
attr_reader :messages
|
|
30
31
|
attr_accessor :bug_tracker
|
|
@@ -40,7 +41,7 @@ module Selenium
|
|
|
40
41
|
def add_condition(name, condition = false, &block)
|
|
41
42
|
condition = false if condition.nil?
|
|
42
43
|
@guard_conditions << GuardCondition.new(name, condition, &block)
|
|
43
|
-
WebDriver.logger.debug "Running with Guard '#{name}' set to: #{condition}"
|
|
44
|
+
WebDriver.logger.debug "Running with Guard '#{name}' set to: #{condition}", id: :guard
|
|
44
45
|
end
|
|
45
46
|
|
|
46
47
|
def add_message(name, message)
|
|
@@ -51,12 +52,18 @@ module Selenium
|
|
|
51
52
|
if !skipping_guard.nil?
|
|
52
53
|
[:skip, skipping_guard.message]
|
|
53
54
|
elsif !pending_guard.nil? && ENV.fetch('SKIP_PENDING', nil)
|
|
54
|
-
[:skip, pending_guard.message]
|
|
55
|
-
elsif !pending_guard.nil?
|
|
55
|
+
[:skip, "(skipped by SKIP_PENDING) #{pending_guard.message}"]
|
|
56
|
+
elsif !pending_guard.nil? && !pending_guard.exception?
|
|
56
57
|
[:pending, pending_guard.message]
|
|
57
58
|
end
|
|
58
59
|
end
|
|
59
60
|
|
|
61
|
+
# The deferred `exception:` pending guard, evaluated against the failure after the run, else nil.
|
|
62
|
+
def pending_exception_guard
|
|
63
|
+
guard = pending_guard
|
|
64
|
+
guard if disposition.nil? && guard&.exception?
|
|
65
|
+
end
|
|
66
|
+
|
|
60
67
|
def satisfied?(guard)
|
|
61
68
|
@guard_conditions.all? { |condition| condition.satisfied?(guard) }
|
|
62
69
|
end
|
data/lib/selenium/webdriver.rb
CHANGED
|
@@ -95,8 +95,13 @@ module Selenium
|
|
|
95
95
|
#
|
|
96
96
|
|
|
97
97
|
def self.logger(**)
|
|
98
|
-
level = $DEBUG || ENV.key?('DEBUG') ? :debug : :info
|
|
99
|
-
@logger ||= WebDriver::Logger.new('Selenium', default_level: level, **)
|
|
98
|
+
level = $DEBUG || ENV.key?('DEBUG') || ENV.key?('SE_DEBUG') ? :debug : :info
|
|
99
|
+
@logger ||= WebDriver::Logger.new('Selenium', default_level: level, **).tap do |logger|
|
|
100
|
+
if ENV.key?('SE_DEBUG')
|
|
101
|
+
logger.debug!
|
|
102
|
+
logger.stderr!
|
|
103
|
+
end
|
|
104
|
+
end
|
|
100
105
|
end
|
|
101
106
|
end # WebDriver
|
|
102
107
|
end # Selenium
|
data/selenium-webdriver.gemspec
CHANGED
|
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
s.required_rubygems_version = Gem::Requirement.new('> 1.3.1') if s.respond_to? :required_rubygems_version=
|
|
33
|
-
s.required_ruby_version = Gem::Requirement.new('>= 3.
|
|
33
|
+
s.required_ruby_version = Gem::Requirement.new('>= 3.3')
|
|
34
34
|
|
|
35
35
|
s.files = [
|
|
36
36
|
'CHANGES',
|
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.
|
|
4
|
+
version: 4.47.0
|
|
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:
|
|
13
|
+
date: 2026-08-10 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: base64
|
|
@@ -273,6 +273,8 @@ files:
|
|
|
273
273
|
- README.md
|
|
274
274
|
- bin/linux/selenium-manager
|
|
275
275
|
- bin/macos/selenium-manager
|
|
276
|
+
- bin/selenium-manager-THIRD-PARTY-NOTICES.txt
|
|
277
|
+
- bin/selenium-manager.cdx.json
|
|
276
278
|
- bin/windows/selenium-manager.exe
|
|
277
279
|
- lib/selenium-webdriver.rb
|
|
278
280
|
- lib/selenium/server.rb
|
|
@@ -283,14 +285,10 @@ files:
|
|
|
283
285
|
- lib/selenium/webdriver/atoms/isDisplayed.js
|
|
284
286
|
- lib/selenium/webdriver/atoms/mutationListener.js
|
|
285
287
|
- lib/selenium/webdriver/bidi.rb
|
|
288
|
+
- lib/selenium/webdriver/bidi/browser.rb
|
|
286
289
|
- lib/selenium/webdriver/bidi/browsing_context.rb
|
|
287
|
-
- lib/selenium/webdriver/bidi/
|
|
288
|
-
- lib/selenium/webdriver/bidi/log/console_log_entry.rb
|
|
289
|
-
- lib/selenium/webdriver/bidi/log/filter_by.rb
|
|
290
|
-
- lib/selenium/webdriver/bidi/log/generic_log_entry.rb
|
|
291
|
-
- lib/selenium/webdriver/bidi/log/javascript_log_entry.rb
|
|
290
|
+
- lib/selenium/webdriver/bidi/error.rb
|
|
292
291
|
- lib/selenium/webdriver/bidi/log_handler.rb
|
|
293
|
-
- lib/selenium/webdriver/bidi/log_inspector.rb
|
|
294
292
|
- lib/selenium/webdriver/bidi/network.rb
|
|
295
293
|
- lib/selenium/webdriver/bidi/network/cookies.rb
|
|
296
294
|
- lib/selenium/webdriver/bidi/network/credentials.rb
|
|
@@ -300,8 +298,31 @@ files:
|
|
|
300
298
|
- lib/selenium/webdriver/bidi/network/intercepted_request.rb
|
|
301
299
|
- lib/selenium/webdriver/bidi/network/intercepted_response.rb
|
|
302
300
|
- lib/selenium/webdriver/bidi/network/url_pattern.rb
|
|
301
|
+
- lib/selenium/webdriver/bidi/protocol.rb
|
|
302
|
+
- lib/selenium/webdriver/bidi/protocol/bluetooth.rb
|
|
303
|
+
- lib/selenium/webdriver/bidi/protocol/browser.rb
|
|
304
|
+
- lib/selenium/webdriver/bidi/protocol/browsing_context.rb
|
|
305
|
+
- lib/selenium/webdriver/bidi/protocol/domain.rb
|
|
306
|
+
- lib/selenium/webdriver/bidi/protocol/emulation.rb
|
|
307
|
+
- lib/selenium/webdriver/bidi/protocol/error_code.rb
|
|
308
|
+
- lib/selenium/webdriver/bidi/protocol/input.rb
|
|
309
|
+
- lib/selenium/webdriver/bidi/protocol/log.rb
|
|
310
|
+
- lib/selenium/webdriver/bidi/protocol/network.rb
|
|
311
|
+
- lib/selenium/webdriver/bidi/protocol/permissions.rb
|
|
312
|
+
- lib/selenium/webdriver/bidi/protocol/script.rb
|
|
313
|
+
- lib/selenium/webdriver/bidi/protocol/session.rb
|
|
314
|
+
- lib/selenium/webdriver/bidi/protocol/speculation.rb
|
|
315
|
+
- lib/selenium/webdriver/bidi/protocol/storage.rb
|
|
316
|
+
- lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb
|
|
317
|
+
- lib/selenium/webdriver/bidi/protocol/web_extension.rb
|
|
318
|
+
- lib/selenium/webdriver/bidi/serialization.rb
|
|
319
|
+
- lib/selenium/webdriver/bidi/serialization/record.rb
|
|
320
|
+
- lib/selenium/webdriver/bidi/serialization/union.rb
|
|
303
321
|
- lib/selenium/webdriver/bidi/session.rb
|
|
304
322
|
- lib/selenium/webdriver/bidi/struct.rb
|
|
323
|
+
- lib/selenium/webdriver/bidi/support/bidi_generate.rb
|
|
324
|
+
- lib/selenium/webdriver/bidi/support/check_generated.rb
|
|
325
|
+
- lib/selenium/webdriver/bidi/transport.rb
|
|
305
326
|
- lib/selenium/webdriver/chrome.rb
|
|
306
327
|
- lib/selenium/webdriver/chrome/driver.rb
|
|
307
328
|
- lib/selenium/webdriver/chrome/features.rb
|
|
@@ -317,13 +338,13 @@ files:
|
|
|
317
338
|
- lib/selenium/webdriver/common/action_builder.rb
|
|
318
339
|
- lib/selenium/webdriver/common/alert.rb
|
|
319
340
|
- lib/selenium/webdriver/common/child_process.rb
|
|
341
|
+
- lib/selenium/webdriver/common/client_config.rb
|
|
320
342
|
- lib/selenium/webdriver/common/driver.rb
|
|
321
343
|
- lib/selenium/webdriver/common/driver_extensions/downloads_files.rb
|
|
322
344
|
- lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb
|
|
323
345
|
- lib/selenium/webdriver/common/driver_extensions/has_addons.rb
|
|
324
346
|
- lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb
|
|
325
347
|
- lib/selenium/webdriver/common/driver_extensions/has_authentication.rb
|
|
326
|
-
- lib/selenium/webdriver/common/driver_extensions/has_bidi.rb
|
|
327
348
|
- lib/selenium/webdriver/common/driver_extensions/has_casting.rb
|
|
328
349
|
- lib/selenium/webdriver/common/driver_extensions/has_cdp.rb
|
|
329
350
|
- lib/selenium/webdriver/common/driver_extensions/has_context.rb
|
|
@@ -338,6 +359,7 @@ files:
|
|
|
338
359
|
- lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb
|
|
339
360
|
- lib/selenium/webdriver/common/driver_extensions/has_permissions.rb
|
|
340
361
|
- lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb
|
|
362
|
+
- lib/selenium/webdriver/common/driver_extensions/has_session_events.rb
|
|
341
363
|
- lib/selenium/webdriver/common/driver_extensions/has_session_id.rb
|
|
342
364
|
- lib/selenium/webdriver/common/driver_extensions/prints_page.rb
|
|
343
365
|
- lib/selenium/webdriver/common/driver_extensions/uploads_files.rb
|
|
@@ -475,14 +497,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
475
497
|
requirements:
|
|
476
498
|
- - ">="
|
|
477
499
|
- !ruby/object:Gem::Version
|
|
478
|
-
version: '3.
|
|
500
|
+
version: '3.3'
|
|
479
501
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
480
502
|
requirements:
|
|
481
503
|
- - ">"
|
|
482
504
|
- !ruby/object:Gem::Version
|
|
483
505
|
version: 1.3.1
|
|
484
506
|
requirements: []
|
|
485
|
-
rubygems_version: 3.
|
|
507
|
+
rubygems_version: 3.5.22
|
|
486
508
|
signing_key:
|
|
487
509
|
specification_version: 4
|
|
488
510
|
summary: Selenium is a browser automation tool for automated testing of webapps and
|
|
@@ -1,35 +0,0 @@
|
|
|
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 ConsoleLogEntry < GenericLogEntry
|
|
24
|
-
attr_accessor :method, :realm, :args
|
|
25
|
-
|
|
26
|
-
def initialize(method:, realm:, args:, **)
|
|
27
|
-
super(**)
|
|
28
|
-
@method = method
|
|
29
|
-
@realm = realm
|
|
30
|
-
@args = args
|
|
31
|
-
end
|
|
32
|
-
end # ConsoleLogEntry
|
|
33
|
-
end # BiDi
|
|
34
|
-
end # WebDriver
|
|
35
|
-
end # Selenium
|
|
@@ -1,33 +0,0 @@
|
|
|
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 GenericLogEntry < BaseLogEntry
|
|
24
|
-
attr_accessor :type
|
|
25
|
-
|
|
26
|
-
def initialize(level:, text:, timestamp:, type:, stack_trace:)
|
|
27
|
-
super(level: level, text: text, timestamp: timestamp, stack_trace: stack_trace)
|
|
28
|
-
@type = type
|
|
29
|
-
end
|
|
30
|
-
end # GenericLogEntry
|
|
31
|
-
end # BiDi
|
|
32
|
-
end # WebDriver
|
|
33
|
-
end # Selenium
|
|
@@ -1,33 +0,0 @@
|
|
|
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 JavascriptLogEntry < GenericLogEntry
|
|
24
|
-
attr_accessor :type
|
|
25
|
-
|
|
26
|
-
def initialize(level:, text:, timestamp:, type:, stack_trace:)
|
|
27
|
-
super
|
|
28
|
-
@type = 'javascript'
|
|
29
|
-
end
|
|
30
|
-
end # JavascriptLogEntry
|
|
31
|
-
end # BiDi
|
|
32
|
-
end # WebDriver
|
|
33
|
-
end # Selenium
|
|
@@ -1,147 +0,0 @@
|
|
|
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
|
-
# This file is automatically generated. Any changes will be lost!
|
|
21
|
-
|
|
22
|
-
require_relative 'log/base_log_entry'
|
|
23
|
-
require_relative 'log/generic_log_entry'
|
|
24
|
-
require_relative 'log/console_log_entry'
|
|
25
|
-
require_relative 'log/javascript_log_entry'
|
|
26
|
-
require_relative 'log/filter_by'
|
|
27
|
-
|
|
28
|
-
module Selenium
|
|
29
|
-
module WebDriver
|
|
30
|
-
class BiDi
|
|
31
|
-
class LogInspector
|
|
32
|
-
EVENTS = {
|
|
33
|
-
entry_added: 'entryAdded'
|
|
34
|
-
}.freeze
|
|
35
|
-
|
|
36
|
-
LOG_LEVEL = {
|
|
37
|
-
DEBUG: 'debug',
|
|
38
|
-
ERROR: 'error',
|
|
39
|
-
INFO: 'info',
|
|
40
|
-
WARNING: 'warning'
|
|
41
|
-
}.freeze
|
|
42
|
-
|
|
43
|
-
def initialize(driver, browsing_context_ids = nil)
|
|
44
|
-
WebDriver.logger.deprecate('LogInspector class',
|
|
45
|
-
'Script class with driver.script',
|
|
46
|
-
id: :log_inspector)
|
|
47
|
-
|
|
48
|
-
unless driver.capabilities.web_socket_url
|
|
49
|
-
raise Error::WebDriverError,
|
|
50
|
-
'WebDriver instance must support BiDi protocol'
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
@bidi = driver.bidi
|
|
54
|
-
@bidi.session.subscribe('log.entryAdded', browsing_context_ids)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def on_console_entry(filter_by = nil, &block)
|
|
58
|
-
check_valid_filter(filter_by)
|
|
59
|
-
|
|
60
|
-
on_log do |params|
|
|
61
|
-
type = params['type']
|
|
62
|
-
console_log_events(params, filter_by, &block) if type.eql?('console')
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def on_javascript_log(filter_by = nil, &block)
|
|
67
|
-
check_valid_filter(filter_by)
|
|
68
|
-
|
|
69
|
-
on_log do |params|
|
|
70
|
-
type = params['type']
|
|
71
|
-
javascript_log_events(params, filter_by, &block) if type.eql?('javascript')
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def on_javascript_exception(&block)
|
|
76
|
-
on_log do |params|
|
|
77
|
-
type = params['type']
|
|
78
|
-
javascript_log_events(params, FilterBy.log_level('error'), &block) if type.eql?('javascript')
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def on_log(filter_by = nil, &block)
|
|
83
|
-
unless filter_by.nil?
|
|
84
|
-
check_valid_filter(filter_by)
|
|
85
|
-
|
|
86
|
-
on(:entry_added) do |params|
|
|
87
|
-
yield(params) if params['level'] == filter_by.level
|
|
88
|
-
end
|
|
89
|
-
return
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
on(:entry_added, &block)
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
private
|
|
96
|
-
|
|
97
|
-
def on(event, &block)
|
|
98
|
-
event = EVENTS[event] if event.is_a?(Symbol)
|
|
99
|
-
@bidi.add_callback("log.#{event}", &block)
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def check_valid_filter(filter_by)
|
|
103
|
-
return if filter_by.nil? || filter_by.instance_of?(FilterBy)
|
|
104
|
-
|
|
105
|
-
raise "Pass valid FilterBy object. Received: #{filter_by.inspect}"
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
def console_log_events(params, filter_by)
|
|
109
|
-
event = ConsoleLogEntry.new(
|
|
110
|
-
level: params['level'],
|
|
111
|
-
text: params['text'],
|
|
112
|
-
timestamp: params['timestamp'],
|
|
113
|
-
type: params['type'],
|
|
114
|
-
method: params['method'],
|
|
115
|
-
realm: params['realm'],
|
|
116
|
-
args: params['args'],
|
|
117
|
-
stack_trace: params['stackTrace']
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
unless filter_by.nil?
|
|
121
|
-
yield(event) if params['level'] == filter_by.level
|
|
122
|
-
return
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
yield(event)
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
def javascript_log_events(params, filter_by)
|
|
129
|
-
event = JavascriptLogEntry.new(
|
|
130
|
-
level: params['level'],
|
|
131
|
-
text: params['text'],
|
|
132
|
-
timestamp: params['timestamp'],
|
|
133
|
-
type: params['type'],
|
|
134
|
-
stack_trace: params['stackTrace']
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
unless filter_by.nil?
|
|
138
|
-
yield(event) if params['level'] == filter_by.level
|
|
139
|
-
return
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
yield(event)
|
|
143
|
-
end
|
|
144
|
-
end # LogInspector
|
|
145
|
-
end # Bidi
|
|
146
|
-
end # WebDriver
|
|
147
|
-
end # Selenium
|