selenium-webdriver 4.32.0 → 4.38.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 +46 -5
- data/README.md +1 -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/atoms/findElements.js +19 -18
- data/lib/selenium/webdriver/atoms/isDisplayed.js +2 -2
- data/lib/selenium/webdriver/atoms.rb +2 -2
- data/lib/selenium/webdriver/bidi/browser.rb +64 -0
- data/lib/selenium/webdriver/bidi/browsing_context.rb +1 -1
- data/lib/selenium/webdriver/bidi/network/cookies.rb +5 -8
- data/lib/selenium/webdriver/bidi/network/intercepted_request.rb +16 -4
- data/lib/selenium/webdriver/bidi/network/intercepted_response.rb +20 -6
- data/lib/selenium/webdriver/bidi/network/url_pattern.rb +1 -1
- data/lib/selenium/webdriver/bidi/network.rb +12 -9
- data/lib/selenium/webdriver/bidi.rb +1 -1
- data/lib/selenium/webdriver/chrome/driver.rb +2 -2
- data/lib/selenium/webdriver/chromium/options.rb +2 -2
- data/lib/selenium/webdriver/common/child_process.rb +4 -0
- data/lib/selenium/webdriver/common/driver.rb +8 -8
- data/lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rb +7 -1
- data/lib/selenium/webdriver/common/error.rb +3 -3
- data/lib/selenium/webdriver/common/interactions/key_actions.rb +4 -4
- data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +10 -10
- data/lib/selenium/webdriver/common/interactions/pointer_input.rb +6 -6
- data/lib/selenium/webdriver/common/keys.rb +9 -0
- data/lib/selenium/webdriver/common/manager.rb +2 -0
- data/lib/selenium/webdriver/common/options.rb +20 -11
- data/lib/selenium/webdriver/common/platform.rb +1 -3
- data/lib/selenium/webdriver/common/proxy.rb +1 -0
- data/lib/selenium/webdriver/common/service.rb +10 -10
- data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +4 -4
- data/lib/selenium/webdriver/common/wait.rb +1 -1
- data/lib/selenium/webdriver/common/zipper.rb +12 -2
- data/lib/selenium/webdriver/edge/driver.rb +2 -2
- data/lib/selenium/webdriver/firefox/driver.rb +2 -2
- data/lib/selenium/webdriver/firefox/service.rb +2 -2
- data/lib/selenium/webdriver/ie/driver.rb +2 -2
- data/lib/selenium/webdriver/remote/driver.rb +2 -2
- data/lib/selenium/webdriver/safari/driver.rb +2 -2
- data/lib/selenium/webdriver/support/block_event_listener.rb +2 -2
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +3 -3
- data/lib/selenium/webdriver/version.rb +1 -1
- data/lib/selenium/webdriver.rb +4 -5
- data/selenium-webdriver.gemspec +2 -2
- metadata +7 -12
- data/lib/selenium/webdriver/bidi/log/base_log_entry.rb +0 -35
- data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +0 -35
- data/lib/selenium/webdriver/bidi/log/filter_by.rb +0 -40
- 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
|
@@ -68,9 +68,9 @@ module Selenium
|
|
|
68
68
|
# @api private
|
|
69
69
|
#
|
|
70
70
|
|
|
71
|
-
def initialize(bridge: nil, listener: nil, **
|
|
71
|
+
def initialize(bridge: nil, listener: nil, **)
|
|
72
72
|
@devtools = nil
|
|
73
|
-
bridge ||= create_bridge(**
|
|
73
|
+
bridge ||= create_bridge(**)
|
|
74
74
|
@bridge = listener ? Support::EventFiringBridge.new(bridge, listener) : bridge
|
|
75
75
|
add_extensions(@bridge.browser)
|
|
76
76
|
end
|
|
@@ -131,8 +131,8 @@ module Selenium
|
|
|
131
131
|
# @see ActionBuilder
|
|
132
132
|
#
|
|
133
133
|
|
|
134
|
-
def action(**
|
|
135
|
-
bridge.action(**
|
|
134
|
+
def action(**)
|
|
135
|
+
bridge.action(**)
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
#
|
|
@@ -225,8 +225,8 @@ module Selenium
|
|
|
225
225
|
# The value returned from the script.
|
|
226
226
|
#
|
|
227
227
|
|
|
228
|
-
def execute_script(script, *
|
|
229
|
-
bridge.execute_script(script, *
|
|
228
|
+
def execute_script(script, *)
|
|
229
|
+
bridge.execute_script(script, *)
|
|
230
230
|
end
|
|
231
231
|
|
|
232
232
|
# Execute an asynchronous piece of JavaScript in the context of the
|
|
@@ -244,8 +244,8 @@ module Selenium
|
|
|
244
244
|
# @return [WebDriver::Element,Integer,Float,Boolean,NilClass,String,Array]
|
|
245
245
|
#
|
|
246
246
|
|
|
247
|
-
def execute_async_script(script, *
|
|
248
|
-
bridge.execute_async_script(script, *
|
|
247
|
+
def execute_async_script(script, *)
|
|
248
|
+
bridge.execute_async_script(script, *)
|
|
249
249
|
end
|
|
250
250
|
|
|
251
251
|
#
|
|
@@ -39,7 +39,13 @@ module Selenium
|
|
|
39
39
|
|
|
40
40
|
begin
|
|
41
41
|
Zip::File.open("#{file_name}.zip") do |zip|
|
|
42
|
-
zip.each
|
|
42
|
+
zip.each do |entry|
|
|
43
|
+
if Zipper::RUBYZIP_V3
|
|
44
|
+
zip.extract(entry, file_name, destination_directory: target_directory)
|
|
45
|
+
else
|
|
46
|
+
zip.extract(entry, "#{target_directory}#{file_name}")
|
|
47
|
+
end
|
|
48
|
+
end
|
|
43
49
|
end
|
|
44
50
|
ensure
|
|
45
51
|
FileUtils.rm_f("#{file_name}.zip")
|
|
@@ -38,9 +38,9 @@ module Selenium
|
|
|
38
38
|
ERROR_URL = 'https://www.selenium.dev/documentation/webdriver/troubleshooting/errors'
|
|
39
39
|
|
|
40
40
|
URLS = {
|
|
41
|
-
NoSuchElementError: "#{ERROR_URL}#
|
|
42
|
-
StaleElementReferenceError: "#{ERROR_URL}#
|
|
43
|
-
InvalidSelectorError: "#{ERROR_URL}#
|
|
41
|
+
NoSuchElementError: "#{ERROR_URL}#nosuchelementexception",
|
|
42
|
+
StaleElementReferenceError: "#{ERROR_URL}#staleelementreferenceexception",
|
|
43
|
+
InvalidSelectorError: "#{ERROR_URL}#invalidselectorexception",
|
|
44
44
|
NoSuchDriverError: "#{ERROR_URL}/driver_location"
|
|
45
45
|
}.freeze
|
|
46
46
|
|
|
@@ -44,8 +44,8 @@ module Selenium
|
|
|
44
44
|
# @return [ActionBuilder] A self reference
|
|
45
45
|
#
|
|
46
46
|
|
|
47
|
-
def key_down(
|
|
48
|
-
key_action(
|
|
47
|
+
def key_down(*, device: nil)
|
|
48
|
+
key_action(*, action: :create_key_down, device: device)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
#
|
|
@@ -71,8 +71,8 @@ module Selenium
|
|
|
71
71
|
# @return [ActionBuilder] A self reference
|
|
72
72
|
#
|
|
73
73
|
|
|
74
|
-
def key_up(
|
|
75
|
-
key_action(
|
|
74
|
+
def key_up(*, device: nil)
|
|
75
|
+
key_action(*, action: :create_key_up, device: device)
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
#
|
|
@@ -46,8 +46,8 @@ module Selenium
|
|
|
46
46
|
# @return [ActionBuilder] A self reference.
|
|
47
47
|
#
|
|
48
48
|
|
|
49
|
-
def pointer_down(button = :left, device: nil, **
|
|
50
|
-
button_action(button, :create_pointer_down, device: device, **
|
|
49
|
+
def pointer_down(button = :left, device: nil, **)
|
|
50
|
+
button_action(button, :create_pointer_down, device: device, **)
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
#
|
|
@@ -63,8 +63,8 @@ module Selenium
|
|
|
63
63
|
# @return [ActionBuilder] A self reference.
|
|
64
64
|
#
|
|
65
65
|
|
|
66
|
-
def pointer_up(button = :left, device: nil, **
|
|
67
|
-
button_action(button, :create_pointer_up, device: device, **
|
|
66
|
+
def pointer_up(button = :left, device: nil, **)
|
|
67
|
+
button_action(button, :create_pointer_up, device: device, **)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
#
|
|
@@ -122,13 +122,13 @@ module Selenium
|
|
|
122
122
|
# @raise [MoveTargetOutOfBoundsError] if the provided offset is outside the document's boundaries.
|
|
123
123
|
#
|
|
124
124
|
|
|
125
|
-
def move_by(right_by, down_by, device: nil, duration: default_move_duration, **
|
|
125
|
+
def move_by(right_by, down_by, device: nil, duration: default_move_duration, **)
|
|
126
126
|
pointer = pointer_input(device)
|
|
127
127
|
pointer.create_pointer_move(duration: duration,
|
|
128
128
|
x: Integer(right_by),
|
|
129
129
|
y: Integer(down_by),
|
|
130
130
|
origin: Interactions::PointerMove::POINTER,
|
|
131
|
-
**
|
|
131
|
+
**)
|
|
132
132
|
tick(pointer)
|
|
133
133
|
self
|
|
134
134
|
end
|
|
@@ -150,13 +150,13 @@ module Selenium
|
|
|
150
150
|
# @raise [MoveTargetOutOfBoundsError] if the provided x or y value is outside the document's boundaries.
|
|
151
151
|
#
|
|
152
152
|
|
|
153
|
-
def move_to_location(x, y, device: nil, duration: default_move_duration, **
|
|
153
|
+
def move_to_location(x, y, device: nil, duration: default_move_duration, **)
|
|
154
154
|
pointer = pointer_input(device)
|
|
155
155
|
pointer.create_pointer_move(duration: duration,
|
|
156
156
|
x: Integer(x),
|
|
157
157
|
y: Integer(y),
|
|
158
158
|
origin: Interactions::PointerMove::VIEWPORT,
|
|
159
|
-
**
|
|
159
|
+
**)
|
|
160
160
|
tick(pointer)
|
|
161
161
|
self
|
|
162
162
|
end
|
|
@@ -336,9 +336,9 @@ module Selenium
|
|
|
336
336
|
|
|
337
337
|
private
|
|
338
338
|
|
|
339
|
-
def button_action(button, action, device: nil, **
|
|
339
|
+
def button_action(button, action, device: nil, **)
|
|
340
340
|
pointer = pointer_input(device)
|
|
341
|
-
pointer.send(action, button, **
|
|
341
|
+
pointer.send(action, button, **)
|
|
342
342
|
tick(pointer)
|
|
343
343
|
self
|
|
344
344
|
end
|
|
@@ -49,16 +49,16 @@ module Selenium
|
|
|
49
49
|
KIND[pointer]
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
def create_pointer_move(duration: 0, x: 0, y: 0, origin: nil, **
|
|
53
|
-
add_action(PointerMove.new(self, duration, x, y, origin: origin, **
|
|
52
|
+
def create_pointer_move(duration: 0, x: 0, y: 0, origin: nil, **)
|
|
53
|
+
add_action(PointerMove.new(self, duration, x, y, origin: origin, **))
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
def create_pointer_down(button, **
|
|
57
|
-
add_action(PointerPress.new(self, :down, button, **
|
|
56
|
+
def create_pointer_down(button, **)
|
|
57
|
+
add_action(PointerPress.new(self, :down, button, **))
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
def create_pointer_up(button, **
|
|
61
|
-
add_action(PointerPress.new(self, :up, button, **
|
|
60
|
+
def create_pointer_up(button, **)
|
|
61
|
+
add_action(PointerPress.new(self, :up, button, **))
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def create_pointer_cancel
|
|
@@ -75,6 +75,13 @@ module Selenium
|
|
|
75
75
|
subtract: "\ue027",
|
|
76
76
|
decimal: "\ue028",
|
|
77
77
|
divide: "\ue029",
|
|
78
|
+
numpad_multiply: "\ue024",
|
|
79
|
+
numpad_add: "\ue025",
|
|
80
|
+
numpad_comma: "\ue026",
|
|
81
|
+
numpad_subtract: "\ue027",
|
|
82
|
+
numpad_decimal: "\ue028",
|
|
83
|
+
numpad_divide: "\ue029",
|
|
84
|
+
numpad_enter: "\ue007",
|
|
78
85
|
f1: "\ue031",
|
|
79
86
|
f2: "\ue032",
|
|
80
87
|
f3: "\ue033",
|
|
@@ -95,6 +102,8 @@ module Selenium
|
|
|
95
102
|
right_control: "\ue051",
|
|
96
103
|
right_alt: "\ue052",
|
|
97
104
|
right_meta: "\ue053",
|
|
105
|
+
options: "\ue052",
|
|
106
|
+
function: "\ue051", # macOS Function key, same as right_control
|
|
98
107
|
numpad_page_up: "\ue054",
|
|
99
108
|
numpad_page_down: "\ue055",
|
|
100
109
|
numpad_end: "\ue056",
|
|
@@ -29,26 +29,26 @@ module Selenium
|
|
|
29
29
|
class << self
|
|
30
30
|
attr_reader :driver_path
|
|
31
31
|
|
|
32
|
-
def chrome(**
|
|
33
|
-
Chrome::Options.new(**
|
|
32
|
+
def chrome(**)
|
|
33
|
+
Chrome::Options.new(**)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
def firefox(**
|
|
37
|
-
Firefox::Options.new(**
|
|
36
|
+
def firefox(**)
|
|
37
|
+
Firefox::Options.new(**)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
def ie(**
|
|
41
|
-
IE::Options.new(**
|
|
40
|
+
def ie(**)
|
|
41
|
+
IE::Options.new(**)
|
|
42
42
|
end
|
|
43
43
|
alias internet_explorer ie
|
|
44
44
|
|
|
45
|
-
def edge(**
|
|
46
|
-
Edge::Options.new(**
|
|
45
|
+
def edge(**)
|
|
46
|
+
Edge::Options.new(**)
|
|
47
47
|
end
|
|
48
48
|
alias microsoftedge edge
|
|
49
49
|
|
|
50
|
-
def safari(**
|
|
51
|
-
Safari::Options.new(**
|
|
50
|
+
def safari(**)
|
|
51
|
+
Safari::Options.new(**)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def set_capabilities
|
|
@@ -131,11 +131,20 @@ module Selenium
|
|
|
131
131
|
|
|
132
132
|
def process_w3c_options(options)
|
|
133
133
|
w3c_options = options.select { |key, val| w3c?(key) && !val.nil? }
|
|
134
|
-
w3c_options[:unhandled_prompt_behavior] &&=
|
|
134
|
+
w3c_options[:unhandled_prompt_behavior] &&=
|
|
135
|
+
process_unhandled_prompt_behavior_value(w3c_options[:unhandled_prompt_behavior])
|
|
135
136
|
options.delete_if { |key, _val| w3c?(key) }
|
|
136
137
|
w3c_options
|
|
137
138
|
end
|
|
138
139
|
|
|
140
|
+
def process_unhandled_prompt_behavior_value(value)
|
|
141
|
+
if value.is_a?(Hash)
|
|
142
|
+
value.transform_values { |v| process_unhandled_prompt_behavior_value(v) }
|
|
143
|
+
else
|
|
144
|
+
value&.to_s&.tr('_', ' ')
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
139
148
|
def process_browser_options(_browser_options)
|
|
140
149
|
nil
|
|
141
150
|
end
|
|
@@ -28,27 +28,27 @@ module Selenium
|
|
|
28
28
|
class << self
|
|
29
29
|
attr_reader :driver_path
|
|
30
30
|
|
|
31
|
-
def chrome(**
|
|
32
|
-
Chrome::Service.new(**
|
|
31
|
+
def chrome(**)
|
|
32
|
+
Chrome::Service.new(**)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
def firefox(**
|
|
36
|
-
Firefox::Service.new(**
|
|
35
|
+
def firefox(**)
|
|
36
|
+
Firefox::Service.new(**)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
def ie(**
|
|
40
|
-
IE::Service.new(**
|
|
39
|
+
def ie(**)
|
|
40
|
+
IE::Service.new(**)
|
|
41
41
|
end
|
|
42
42
|
alias internet_explorer ie
|
|
43
43
|
|
|
44
|
-
def edge(**
|
|
45
|
-
Edge::Service.new(**
|
|
44
|
+
def edge(**)
|
|
45
|
+
Edge::Service.new(**)
|
|
46
46
|
end
|
|
47
47
|
alias microsoftedge edge
|
|
48
48
|
alias msedge edge
|
|
49
49
|
|
|
50
|
-
def safari(**
|
|
51
|
-
Safari::Service.new(**
|
|
50
|
+
def safari(**)
|
|
51
|
+
Safari::Service.new(**)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def driver_path=(path)
|
|
@@ -26,12 +26,12 @@ module Selenium
|
|
|
26
26
|
module WebDriver
|
|
27
27
|
class Credential
|
|
28
28
|
class << self
|
|
29
|
-
def resident(**
|
|
30
|
-
Credential.new(resident_credential: true, **
|
|
29
|
+
def resident(**)
|
|
30
|
+
Credential.new(resident_credential: true, **)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def non_resident(**
|
|
34
|
-
Credential.new(resident_credential: false, **
|
|
33
|
+
def non_resident(**)
|
|
34
|
+
Credential.new(resident_credential: false, **)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def encode(byte_array)
|
|
@@ -29,7 +29,7 @@ module Selenium
|
|
|
29
29
|
# @param [Hash] opts Options for this instance
|
|
30
30
|
# @option opts [Numeric] :timeout (5) Seconds to wait before timing out.
|
|
31
31
|
# @option opts [Numeric] :interval (0.2) Seconds to sleep between polls.
|
|
32
|
-
# @option opts [String] :message Exception
|
|
32
|
+
# @option opts [String] :message Exception message if timed out.
|
|
33
33
|
# @option opts [Array, Exception] :ignore Exceptions to ignore while polling (default: Error::NoSuchElementError)
|
|
34
34
|
#
|
|
35
35
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
# under the License.
|
|
19
19
|
|
|
20
20
|
require 'zip'
|
|
21
|
+
require 'zip/version' # Not required automatically
|
|
21
22
|
require 'tempfile'
|
|
22
23
|
require 'find'
|
|
23
24
|
require 'base64'
|
|
@@ -30,6 +31,7 @@ module Selenium
|
|
|
30
31
|
|
|
31
32
|
module Zipper
|
|
32
33
|
EXTENSIONS = %w[.zip .xpi].freeze
|
|
34
|
+
RUBYZIP_V3 = Zip::VERSION >= '3.0.0'
|
|
33
35
|
|
|
34
36
|
class << self
|
|
35
37
|
def unzip(path)
|
|
@@ -42,7 +44,11 @@ module Selenium
|
|
|
42
44
|
dirname = File.dirname(to)
|
|
43
45
|
|
|
44
46
|
FileUtils.mkdir_p dirname
|
|
45
|
-
|
|
47
|
+
if RUBYZIP_V3
|
|
48
|
+
zip.extract(entry, entry.name, destination_directory: destination)
|
|
49
|
+
else
|
|
50
|
+
zip.extract(entry, to)
|
|
51
|
+
end
|
|
46
52
|
end
|
|
47
53
|
end
|
|
48
54
|
|
|
@@ -75,7 +81,11 @@ module Selenium
|
|
|
75
81
|
# Don't use Tempfile since it lacks rb_file_s_rename permission on Windows.
|
|
76
82
|
Dir.mktmpdir do |tmp_dir|
|
|
77
83
|
zip_path = File.join(tmp_dir, 'webdriver-zip')
|
|
78
|
-
|
|
84
|
+
if RUBYZIP_V3
|
|
85
|
+
Zip::File.open(zip_path, create: true, &blk)
|
|
86
|
+
else
|
|
87
|
+
Zip::File.open(zip_path, Zip::File::CREATE, &blk)
|
|
88
|
+
end
|
|
79
89
|
end
|
|
80
90
|
end
|
|
81
91
|
|
|
@@ -30,9 +30,9 @@ module Selenium
|
|
|
30
30
|
class Driver < Chromium::Driver
|
|
31
31
|
include LocalDriver
|
|
32
32
|
|
|
33
|
-
def initialize(options: nil, service: nil, url: nil, **
|
|
33
|
+
def initialize(options: nil, service: nil, url: nil, **)
|
|
34
34
|
caps, url = initialize_local_driver(options, service, url)
|
|
35
|
-
super(caps: caps, url: url, **
|
|
35
|
+
super(caps: caps, url: url, **)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def browser
|
|
@@ -36,9 +36,9 @@ module Selenium
|
|
|
36
36
|
|
|
37
37
|
include LocalDriver
|
|
38
38
|
|
|
39
|
-
def initialize(options: nil, service: nil, url: nil, **
|
|
39
|
+
def initialize(options: nil, service: nil, url: nil, **)
|
|
40
40
|
caps, url = initialize_local_driver(options, service, url)
|
|
41
|
-
super(caps: caps, url: url, **
|
|
41
|
+
super(caps: caps, url: url, **)
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def browser
|
|
@@ -28,9 +28,9 @@ module Selenium
|
|
|
28
28
|
|
|
29
29
|
def initialize(path: nil, port: nil, log: nil, args: nil)
|
|
30
30
|
args ||= []
|
|
31
|
-
unless args.any? { |arg| arg.include?('--connect-existing') }
|
|
31
|
+
unless args.any? { |arg| arg.include?('--connect-existing') || arg.include?('--websocket-port') }
|
|
32
32
|
args << '--websocket-port'
|
|
33
|
-
args <<
|
|
33
|
+
args << '0'
|
|
34
34
|
end
|
|
35
35
|
super
|
|
36
36
|
end
|
|
@@ -31,9 +31,9 @@ module Selenium
|
|
|
31
31
|
|
|
32
32
|
include LocalDriver
|
|
33
33
|
|
|
34
|
-
def initialize(options: nil, service: nil, url: nil, **
|
|
34
|
+
def initialize(options: nil, service: nil, url: nil, **)
|
|
35
35
|
caps, url = initialize_local_driver(options, service, url)
|
|
36
|
-
super(caps: caps, url: url, **
|
|
36
|
+
super(caps: caps, url: url, **)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def browser
|
|
@@ -30,12 +30,12 @@ module Selenium
|
|
|
30
30
|
include DriverExtensions::HasSessionId
|
|
31
31
|
include DriverExtensions::HasFileDownloads
|
|
32
32
|
|
|
33
|
-
def initialize(capabilities: nil, options: nil, service: nil, url: nil, **
|
|
33
|
+
def initialize(capabilities: nil, options: nil, service: nil, url: nil, **)
|
|
34
34
|
raise ArgumentError, "Can not set :service object on #{self.class}" if service
|
|
35
35
|
|
|
36
36
|
url ||= "http://#{Platform.localhost}:4444/wd/hub"
|
|
37
37
|
caps = process_options(options, capabilities)
|
|
38
|
-
super(caps: caps, url: url, **
|
|
38
|
+
super(caps: caps, url: url, **)
|
|
39
39
|
@bridge.file_detector = ->((filename, *)) { File.exist?(filename) && filename.to_s }
|
|
40
40
|
command_list = @bridge.command_list
|
|
41
41
|
@bridge.extend(WebDriver::Remote::Features)
|
|
@@ -31,9 +31,9 @@ module Selenium
|
|
|
31
31
|
|
|
32
32
|
include LocalDriver
|
|
33
33
|
|
|
34
|
-
def initialize(options: nil, service: nil, url: nil, **
|
|
34
|
+
def initialize(options: nil, service: nil, url: nil, **)
|
|
35
35
|
caps, url = initialize_local_driver(options, service, url)
|
|
36
|
-
super(caps: caps, url: url, **
|
|
36
|
+
super(caps: caps, url: url, **)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def browser
|
|
@@ -25,8 +25,8 @@ module Selenium
|
|
|
25
25
|
@callback = callback
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
def method_missing(meth, *
|
|
29
|
-
@callback.call
|
|
28
|
+
def method_missing(meth, *) # rubocop:disable Style/MissingRespondToMissing
|
|
29
|
+
@callback.call(meth, *)
|
|
30
30
|
end
|
|
31
31
|
end # BlockEventListener
|
|
32
32
|
end # Support
|
|
@@ -112,10 +112,10 @@ module Selenium
|
|
|
112
112
|
@driver ||= Driver.new(bridge: self)
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
-
def dispatch(name, *
|
|
116
|
-
@listener.__send__(:"before_#{name}", *
|
|
115
|
+
def dispatch(name, *)
|
|
116
|
+
@listener.__send__(:"before_#{name}", *)
|
|
117
117
|
returned = yield
|
|
118
|
-
@listener.__send__(:"after_#{name}", *
|
|
118
|
+
@listener.__send__(:"after_#{name}", *)
|
|
119
119
|
|
|
120
120
|
returned
|
|
121
121
|
end
|
data/lib/selenium/webdriver.rb
CHANGED
|
@@ -21,7 +21,6 @@ require 'tmpdir'
|
|
|
21
21
|
require 'fileutils'
|
|
22
22
|
require 'date'
|
|
23
23
|
require 'json'
|
|
24
|
-
require 'set'
|
|
25
24
|
require 'uri'
|
|
26
25
|
require 'net/http'
|
|
27
26
|
|
|
@@ -85,8 +84,8 @@ module Selenium
|
|
|
85
84
|
# @see Selenium::WebDriver::Support::AbstractEventListener
|
|
86
85
|
#
|
|
87
86
|
|
|
88
|
-
def self.for(*
|
|
89
|
-
WebDriver::Driver.for(*
|
|
87
|
+
def self.for(*)
|
|
88
|
+
WebDriver::Driver.for(*)
|
|
90
89
|
end
|
|
91
90
|
|
|
92
91
|
#
|
|
@@ -95,9 +94,9 @@ module Selenium
|
|
|
95
94
|
# @return [Logger]
|
|
96
95
|
#
|
|
97
96
|
|
|
98
|
-
def self.logger(**
|
|
97
|
+
def self.logger(**)
|
|
99
98
|
level = $DEBUG || ENV.key?('DEBUG') ? :debug : :info
|
|
100
|
-
@logger ||= WebDriver::Logger.new('Selenium', default_level: level, **
|
|
99
|
+
@logger ||= WebDriver::Logger.new('Selenium', default_level: level, **)
|
|
101
100
|
end
|
|
102
101
|
end # WebDriver
|
|
103
102
|
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.2')
|
|
34
34
|
|
|
35
35
|
s.files = [
|
|
36
36
|
'CHANGES',
|
|
@@ -52,7 +52,7 @@ Gem::Specification.new do |s|
|
|
|
52
52
|
s.add_dependency 'base64', ['~> 0.2']
|
|
53
53
|
s.add_dependency 'logger', ['~> 1.4']
|
|
54
54
|
s.add_dependency 'rexml', ['~> 3.2', '>= 3.2.5']
|
|
55
|
-
s.add_dependency 'rubyzip', ['>= 1.2.2', '<
|
|
55
|
+
s.add_dependency 'rubyzip', ['>= 1.2.2', '< 4.0']
|
|
56
56
|
s.add_dependency 'websocket', ['~> 1.0']
|
|
57
57
|
|
|
58
58
|
s.add_development_dependency 'git', ['~> 1.19']
|
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.38.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: 2025-
|
|
13
|
+
date: 2025-10-25 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: base64
|
|
@@ -69,7 +69,7 @@ dependencies:
|
|
|
69
69
|
version: 1.2.2
|
|
70
70
|
- - "<"
|
|
71
71
|
- !ruby/object:Gem::Version
|
|
72
|
-
version: '
|
|
72
|
+
version: '4.0'
|
|
73
73
|
type: :runtime
|
|
74
74
|
prerelease: false
|
|
75
75
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -79,7 +79,7 @@ dependencies:
|
|
|
79
79
|
version: 1.2.2
|
|
80
80
|
- - "<"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '
|
|
82
|
+
version: '4.0'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: websocket
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -283,14 +283,9 @@ files:
|
|
|
283
283
|
- lib/selenium/webdriver/atoms/isDisplayed.js
|
|
284
284
|
- lib/selenium/webdriver/atoms/mutationListener.js
|
|
285
285
|
- lib/selenium/webdriver/bidi.rb
|
|
286
|
+
- lib/selenium/webdriver/bidi/browser.rb
|
|
286
287
|
- lib/selenium/webdriver/bidi/browsing_context.rb
|
|
287
|
-
- lib/selenium/webdriver/bidi/log/base_log_entry.rb
|
|
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
|
|
292
288
|
- lib/selenium/webdriver/bidi/log_handler.rb
|
|
293
|
-
- lib/selenium/webdriver/bidi/log_inspector.rb
|
|
294
289
|
- lib/selenium/webdriver/bidi/network.rb
|
|
295
290
|
- lib/selenium/webdriver/bidi/network/cookies.rb
|
|
296
291
|
- lib/selenium/webdriver/bidi/network/credentials.rb
|
|
@@ -475,14 +470,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
475
470
|
requirements:
|
|
476
471
|
- - ">="
|
|
477
472
|
- !ruby/object:Gem::Version
|
|
478
|
-
version: '3.
|
|
473
|
+
version: '3.2'
|
|
479
474
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
480
475
|
requirements:
|
|
481
476
|
- - ">"
|
|
482
477
|
- !ruby/object:Gem::Version
|
|
483
478
|
version: 1.3.1
|
|
484
479
|
requirements: []
|
|
485
|
-
rubygems_version: 3.
|
|
480
|
+
rubygems_version: 3.4.19
|
|
486
481
|
signing_key:
|
|
487
482
|
specification_version: 4
|
|
488
483
|
summary: Selenium is a browser automation tool for automated testing of webapps and
|