selenium-webdriver 4.4.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 +98 -1
- data/LICENSE +1 -1
- data/NOTICE +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/server.rb +20 -16
- data/lib/selenium/webdriver/atoms/findElements.js +0 -0
- data/lib/selenium/webdriver/atoms/getAttribute.js +0 -0
- data/lib/selenium/webdriver/atoms/isDisplayed.js +0 -0
- data/lib/selenium/webdriver/atoms/mutationListener.js +0 -0
- data/lib/selenium/webdriver/atoms.rb +2 -3
- data/lib/selenium/webdriver/bidi/browsing_context.rb +88 -0
- data/lib/selenium/webdriver/bidi/browsing_context_info.rb +35 -0
- data/lib/selenium/webdriver/bidi/log/base_log_entry.rb +35 -0
- data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +35 -0
- data/lib/selenium/webdriver/bidi/log/filter_by.rb +40 -0
- data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +33 -0
- data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +33 -0
- data/lib/selenium/webdriver/bidi/log_inspector.rb +143 -0
- data/lib/selenium/webdriver/bidi/navigate_result.rb +33 -0
- data/lib/selenium/webdriver/bidi/session.rb +13 -0
- data/lib/selenium/webdriver/bidi.rb +3 -2
- data/lib/selenium/webdriver/chrome/driver.rb +19 -28
- data/lib/selenium/webdriver/chrome/features.rb +5 -72
- data/lib/selenium/webdriver/chrome/options.rb +3 -237
- data/lib/selenium/webdriver/chrome/profile.rb +3 -83
- data/lib/selenium/webdriver/chrome/service.rb +4 -19
- data/lib/selenium/webdriver/chromium/driver.rb +61 -0
- data/lib/selenium/webdriver/chromium/features.rb +103 -0
- data/lib/selenium/webdriver/chromium/options.rb +261 -0
- data/lib/selenium/webdriver/chromium/profile.rb +113 -0
- data/lib/selenium/webdriver/chromium/service.rb +42 -0
- data/lib/selenium/webdriver/chromium.rb +32 -0
- data/lib/selenium/webdriver/common/action_builder.rb +11 -48
- data/lib/selenium/webdriver/common/child_process.rb +124 -0
- data/lib/selenium/webdriver/common/driver.rb +39 -26
- data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +0 -1
- data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_bidi.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +0 -1
- data/lib/selenium/webdriver/common/driver_extensions/has_cdp.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_debugger.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +1 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +0 -1
- data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +0 -2
- data/lib/selenium/webdriver/common/element.rb +7 -7
- data/lib/selenium/webdriver/common/error.rb +0 -2
- data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +2 -2
- data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +3 -3
- data/lib/selenium/webdriver/common/interactions/pointer_move.rb +2 -2
- data/lib/selenium/webdriver/common/interactions/scroll.rb +7 -5
- data/lib/selenium/webdriver/common/logger.rb +10 -2
- data/lib/selenium/webdriver/common/options.rb +30 -8
- data/lib/selenium/webdriver/common/platform.rb +4 -1
- data/lib/selenium/webdriver/common/profile_helper.rb +1 -1
- data/lib/selenium/webdriver/common/proxy.rb +1 -1
- data/lib/selenium/webdriver/common/selenium_manager.rb +89 -0
- data/lib/selenium/webdriver/common/service.rb +16 -8
- data/lib/selenium/webdriver/common/service_manager.rb +2 -10
- data/lib/selenium/webdriver/common/shadow_root.rb +1 -2
- data/lib/selenium/webdriver/common/socket_lock.rb +2 -2
- data/lib/selenium/webdriver/common/takes_screenshot.rb +2 -3
- data/lib/selenium/webdriver/common/target_locator.rb +2 -3
- data/lib/selenium/webdriver/common/timeouts.rb +2 -2
- data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +8 -6
- data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb +0 -1
- data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb +16 -16
- data/lib/selenium/webdriver/common/websocket_connection.rb +10 -2
- data/lib/selenium/webdriver/common.rb +2 -0
- data/lib/selenium/webdriver/devtools/console_event.rb +0 -2
- data/lib/selenium/webdriver/devtools/exception_event.rb +0 -2
- data/lib/selenium/webdriver/devtools/mutation_event.rb +0 -2
- data/lib/selenium/webdriver/devtools/network_interceptor.rb +3 -6
- data/lib/selenium/webdriver/devtools/pinned_script.rb +0 -2
- data/lib/selenium/webdriver/devtools/request.rb +0 -2
- data/lib/selenium/webdriver/devtools/response.rb +0 -2
- data/lib/selenium/webdriver/devtools.rb +0 -1
- data/lib/selenium/webdriver/edge/driver.rb +20 -3
- data/lib/selenium/webdriver/edge/features.rb +3 -4
- data/lib/selenium/webdriver/edge/options.rb +3 -5
- data/lib/selenium/webdriver/edge/profile.rb +2 -2
- data/lib/selenium/webdriver/edge/service.rb +2 -2
- data/lib/selenium/webdriver/firefox/driver.rb +19 -2
- data/lib/selenium/webdriver/firefox/features.rb +5 -2
- data/lib/selenium/webdriver/firefox/options.rb +6 -2
- data/lib/selenium/webdriver/firefox/profile.rb +6 -6
- data/lib/selenium/webdriver/firefox/service.rb +0 -1
- data/lib/selenium/webdriver/ie/driver.rb +20 -1
- data/lib/selenium/webdriver/ie/service.rb +1 -2
- data/lib/selenium/webdriver/remote/{commands.rb → bridge/commands.rb} +0 -2
- data/lib/selenium/webdriver/remote/bridge.rb +9 -15
- data/lib/selenium/webdriver/remote/capabilities.rb +34 -12
- data/lib/selenium/webdriver/remote/driver.rb +13 -13
- data/lib/selenium/webdriver/remote/http/curb.rb +0 -2
- data/lib/selenium/webdriver/remote/http/default.rb +1 -0
- data/lib/selenium/webdriver/remote/response.rb +0 -1
- data/lib/selenium/webdriver/remote.rb +0 -1
- data/lib/selenium/webdriver/safari/driver.rb +20 -1
- data/lib/selenium/webdriver/safari/features.rb +0 -2
- data/lib/selenium/webdriver/safari/options.rb +5 -1
- data/lib/selenium/webdriver/safari.rb +1 -1
- data/lib/selenium/webdriver/support/color.rb +15 -15
- data/lib/selenium/webdriver/support/guards/guard.rb +0 -2
- data/lib/selenium/webdriver/support/guards/guard_condition.rb +0 -2
- data/lib/selenium/webdriver/support/relative_locator.rb +0 -1
- data/lib/selenium/webdriver/support/select.rb +3 -1
- data/lib/selenium/webdriver/version.rb +1 -1
- data/lib/selenium/webdriver.rb +3 -4
- data/selenium-webdriver.gemspec +8 -9
- metadata +31 -74
- data/lib/selenium/webdriver/support/cdp/domain.rb.erb +0 -63
- data/lib/selenium/webdriver/support/cdp_client_generator.rb +0 -108
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,101 @@
|
|
1
|
-
4.
|
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)
|
14
|
+
=========================
|
15
|
+
Ruby:
|
16
|
+
* Allow updating instance variables on service classes
|
17
|
+
* Deprecate extract_service_args processing in service classes
|
18
|
+
* Fix bug preventing sending nil to #send_keys with Remote Driver
|
19
|
+
* Fix bug with IE specific methods not available to IE Driver
|
20
|
+
* Created Chromium superclass for Chrome and Edge
|
21
|
+
* Deprecated platform and version setters/getters in Capabilities class
|
22
|
+
* Revamped driver constructor logic
|
23
|
+
* Fix bug preventing using Safari Technology Preview when using SafariOptions
|
24
|
+
* Fix bug preventing more than one driver type to access Selenium Manager
|
25
|
+
* Defaults to using Options instead of Capabilities
|
26
|
+
* Make Options classes more strict for allowed arguments and types
|
27
|
+
* Removed previously deprecated actions class parameters
|
28
|
+
* Removed Location struct
|
29
|
+
* Add comment with name of large JS executions (#11038)
|
30
|
+
* update logger with link on how to use it (#11478)
|
31
|
+
* Deprecate #add_option for Option classes in favor of constructor and attr_accessor
|
32
|
+
* Deprecate all unrecognized capabilities for Options classes
|
33
|
+
* Deprecate support for :capabilities for local drivers
|
34
|
+
* Deprecate browser class methods for Capabilities
|
35
|
+
* Deprecate #headless! for Chrome and Firefox
|
36
|
+
|
37
|
+
BiDi:
|
38
|
+
* Released selenium-devtools 0.109.0 (supports CDP v85, v107, v108, v109)
|
39
|
+
* Add LogInspector (#11368)
|
40
|
+
* Add Browsing context commands (#11446)
|
41
|
+
|
42
|
+
4.7.1 (2022-12-02)
|
43
|
+
=========================
|
44
|
+
Ruby:
|
45
|
+
* Fix bug preventing selenium manager from using Internet Explorer
|
46
|
+
|
47
|
+
4.7.0 (2022-12-01)
|
48
|
+
=========================
|
49
|
+
BiDi:
|
50
|
+
* Released selenium-devtools 0.108.0 (supports CDP v85, v106, v107, v108)
|
51
|
+
* Fix bug with socket stability
|
52
|
+
|
53
|
+
Ruby:
|
54
|
+
* Remove dependency on ChildProcess gem in favor of native Process.spawn (#11251)
|
55
|
+
* Add support for Selenium Manager to work with IE Driver
|
56
|
+
* Improve error handling for Selenium Manager
|
57
|
+
|
58
|
+
Safari:
|
59
|
+
* Fix bug preventing Safari Options from being used with Safari Technology Preview
|
60
|
+
|
61
|
+
4.6.1 (2022-11-04)
|
62
|
+
=========================
|
63
|
+
Ruby:
|
64
|
+
* fix bug preventing selenium-manager from being executable by default
|
65
|
+
|
66
|
+
4.6.0 (2022-11-04)
|
67
|
+
=========================
|
68
|
+
BiDi:
|
69
|
+
* Released selenium-devtools 0.107.0 (supports CDP v85, v105, v106, v107)
|
70
|
+
|
71
|
+
Ruby:
|
72
|
+
* firefox scroll by amount is only failing on mac
|
73
|
+
* add initial support for selenium manager
|
74
|
+
* Revert "[rb] do not allow Select class to work with disabled selects"
|
75
|
+
* Make sure selenium-manager is packed into gem
|
76
|
+
* Fix platform list in #scroll_by guard
|
77
|
+
|
78
|
+
4.5.0 (2022-09-28)
|
79
|
+
=========================
|
80
|
+
|
81
|
+
BiDi:
|
82
|
+
* Released selenium-devtools 0.105.0 (supports CDP v85, v103, v104, v105)
|
83
|
+
* Released selenium-devtools 0.106.0 (supports CDP v85, v104, v105, v106)
|
84
|
+
* Add HasBiDi support to Chrome
|
85
|
+
|
86
|
+
Ruby:
|
87
|
+
* Fix bug in Platform code
|
88
|
+
* Update Select class to error when elements are disabled (#10812)
|
89
|
+
|
90
|
+
Firefox:
|
91
|
+
* Add support for installing unsigned add-ons (#10265, thanks TamsilAmani!)
|
92
|
+
* Change accept_insecure_certificates to true by default (to match other bindings)
|
93
|
+
* Set debugger_address option to true by default
|
94
|
+
|
95
|
+
Server:
|
96
|
+
* Add support for initializing server class with arguments and log level
|
97
|
+
|
98
|
+
4.4.0 (2022-08-09)
|
2
99
|
=========================
|
3
100
|
|
4
101
|
BiDi:
|
data/LICENSE
CHANGED
@@ -187,7 +187,7 @@
|
|
187
187
|
same "printed page" as the copyright notice for easier
|
188
188
|
identification within third-party archives.
|
189
189
|
|
190
|
-
Copyright
|
190
|
+
Copyright 2023 Software Freedom Conservancy (SFC)
|
191
191
|
|
192
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
193
193
|
you may not use this file except in compliance with the License.
|
data/NOTICE
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
Copyright 2011-
|
1
|
+
Copyright 2011-2023 Software Freedom Conservancy
|
2
2
|
Copyright 2004-2011 Selenium committers
|
Binary file
|
Binary file
|
Binary file
|
data/lib/selenium/server.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
# specific language governing permissions and limitations
|
18
18
|
# under the License.
|
19
19
|
|
20
|
-
require '
|
20
|
+
require 'selenium/webdriver/common/child_process'
|
21
21
|
require 'selenium/webdriver/common/socket_poller'
|
22
22
|
require 'net/http'
|
23
23
|
|
@@ -182,15 +182,21 @@ module Selenium
|
|
182
182
|
def initialize(jar, opts = {})
|
183
183
|
raise Errno::ENOENT, jar unless File.exist?(jar)
|
184
184
|
|
185
|
-
@jar
|
186
|
-
@host
|
187
|
-
@role
|
188
|
-
@port
|
189
|
-
@timeout
|
185
|
+
@jar = jar
|
186
|
+
@host = '127.0.0.1'
|
187
|
+
@role = opts.fetch(:role, 'standalone')
|
188
|
+
@port = opts.fetch(:port, 4444)
|
189
|
+
@timeout = opts.fetch(:timeout, 30)
|
190
190
|
@background = opts.fetch(:background, false)
|
191
|
-
@
|
192
|
-
@
|
193
|
-
|
191
|
+
@additional_args = opts.fetch(:args, [])
|
192
|
+
@log = opts[:log]
|
193
|
+
if opts[:log_level]
|
194
|
+
@log ||= true
|
195
|
+
@additional_args << '--log-level'
|
196
|
+
@additional_args << opts[:log_level].to_s
|
197
|
+
end
|
198
|
+
|
199
|
+
@log_file = nil
|
194
200
|
end
|
195
201
|
|
196
202
|
def start
|
@@ -204,6 +210,7 @@ module Selenium
|
|
204
210
|
begin
|
205
211
|
Net::HTTP.get(@host, '/selenium-server/driver/?cmd=shutDownSeleniumServer', @port)
|
206
212
|
rescue Errno::ECONNREFUSED
|
213
|
+
nil
|
207
214
|
end
|
208
215
|
|
209
216
|
stop_process if @process
|
@@ -231,7 +238,7 @@ module Selenium
|
|
231
238
|
|
232
239
|
begin
|
233
240
|
@process.poll_for_exit(5)
|
234
|
-
rescue ChildProcess::TimeoutError
|
241
|
+
rescue WebDriver::ChildProcess::TimeoutError
|
235
242
|
@process.stop
|
236
243
|
end
|
237
244
|
rescue Errno::ECHILD
|
@@ -246,16 +253,13 @@ module Selenium
|
|
246
253
|
properties = @additional_args.dup - @additional_args.delete_if { |arg| arg[/^-D/] }
|
247
254
|
args = ['-jar', @jar, @role, '--port', @port.to_s]
|
248
255
|
server_command = ['java'] + properties + args + @additional_args
|
249
|
-
cp = ChildProcess.build(*server_command)
|
256
|
+
cp = WebDriver::ChildProcess.build(*server_command)
|
250
257
|
WebDriver.logger.debug("Executing Process #{server_command}")
|
251
258
|
|
252
|
-
io = cp.io
|
253
|
-
|
254
259
|
if @log.is_a?(String)
|
255
|
-
|
256
|
-
io.stdout = io.stderr = @log_file
|
260
|
+
cp.io = @log
|
257
261
|
elsif @log
|
258
|
-
io
|
262
|
+
cp.io = :out
|
259
263
|
end
|
260
264
|
|
261
265
|
cp.detach = @background
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -20,7 +20,6 @@
|
|
20
20
|
module Selenium
|
21
21
|
module WebDriver
|
22
22
|
module Atoms
|
23
|
-
|
24
23
|
private
|
25
24
|
|
26
25
|
def read_atom(function)
|
@@ -28,10 +27,10 @@ module Selenium
|
|
28
27
|
end
|
29
28
|
|
30
29
|
def execute_atom(function_name, *arguments)
|
31
|
-
script = format("return (%<atom>s).apply(null, arguments)",
|
30
|
+
script = format("/* #{function_name} */return (%<atom>s).apply(null, arguments)",
|
31
|
+
atom: read_atom(function_name))
|
32
32
|
execute_script(script, *arguments)
|
33
33
|
end
|
34
|
-
|
35
34
|
end # Atoms
|
36
35
|
end # WebDriver
|
37
36
|
end # Selenium
|
@@ -0,0 +1,88 @@
|
|
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
|
+
require_relative 'navigate_result'
|
21
|
+
require_relative 'browsing_context_info'
|
22
|
+
|
23
|
+
module Selenium
|
24
|
+
module WebDriver
|
25
|
+
class BiDi
|
26
|
+
class BrowsingContext
|
27
|
+
attr_accessor :id
|
28
|
+
|
29
|
+
READINESS_STATE = {
|
30
|
+
none: 'none',
|
31
|
+
interactive: 'interactive',
|
32
|
+
complete: 'complete'
|
33
|
+
}.freeze
|
34
|
+
|
35
|
+
def initialize(driver:, browsing_context_id: nil, type: nil, reference_context: nil)
|
36
|
+
unless driver.capabilities.web_socket_url
|
37
|
+
raise Error::WebDriverError,
|
38
|
+
'WebDriver instance must support BiDi protocol'
|
39
|
+
end
|
40
|
+
|
41
|
+
unless type.nil? || %i[window tab].include?(type)
|
42
|
+
raise ArgumentError,
|
43
|
+
"Valid types are :window & :tab. Received: #{type.inspect}"
|
44
|
+
end
|
45
|
+
|
46
|
+
@bidi = driver.bidi
|
47
|
+
@id = browsing_context_id.nil? ? create(type, reference_context)['context'] : browsing_context_id
|
48
|
+
end
|
49
|
+
|
50
|
+
def navigate(url:, readiness_state: nil)
|
51
|
+
unless readiness_state.nil? || READINESS_STATE.key?(readiness_state)
|
52
|
+
raise ArgumentError,
|
53
|
+
"Valid readiness states are :none, :interactive & :complete. Received: #{readiness_state.inspect}"
|
54
|
+
end
|
55
|
+
|
56
|
+
navigate_result = @bidi.send_cmd('browsingContext.navigate', context: @id, url: url,
|
57
|
+
wait: READINESS_STATE[readiness_state])
|
58
|
+
|
59
|
+
NavigateResult.new(
|
60
|
+
url: navigate_result['url'],
|
61
|
+
navigation_id: navigate_result['navigation']
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
def get_tree(max_depth: nil)
|
66
|
+
result = @bidi.send_cmd('browsingContext.getTree', root: @id, maxDepth: max_depth).dig('contexts', 0)
|
67
|
+
|
68
|
+
BrowsingContextInfo.new(
|
69
|
+
id: result['context'],
|
70
|
+
url: result['url'],
|
71
|
+
children: result['children'],
|
72
|
+
parent_context: result['parent']
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
def close
|
77
|
+
@bidi.send_cmd('browsingContext.close', context: @id)
|
78
|
+
end
|
79
|
+
|
80
|
+
private
|
81
|
+
|
82
|
+
def create(type, reference_context)
|
83
|
+
@bidi.send_cmd('browsingContext.create', type: type.to_s, referenceContext: reference_context)
|
84
|
+
end
|
85
|
+
end # BrowsingContext
|
86
|
+
end # BiDi
|
87
|
+
end # WebDriver
|
88
|
+
end # Selenium
|
@@ -0,0 +1,35 @@
|
|
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 BrowsingContextInfo
|
24
|
+
attr_accessor :id, :url, :children, :parent_browsing_context
|
25
|
+
|
26
|
+
def initialize(id:, url:, children:, parent_context:)
|
27
|
+
@id = id
|
28
|
+
@url = url
|
29
|
+
@children = children
|
30
|
+
@parent_browsing_context = parent_context
|
31
|
+
end
|
32
|
+
end # BrowsingContextInfo
|
33
|
+
end # BiDi
|
34
|
+
end # WebDriver
|
35
|
+
end # Selenium
|
@@ -0,0 +1,35 @@
|
|
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 BaseLogEntry
|
24
|
+
attr_accessor :level, :text, :timestamp, :stack_trace
|
25
|
+
|
26
|
+
def initialize(level:, text:, timestamp:, stack_trace:)
|
27
|
+
@level = level
|
28
|
+
@text = text
|
29
|
+
@timestamp = timestamp
|
30
|
+
@stack_trace = stack_trace
|
31
|
+
end
|
32
|
+
end # BaseLogEntry
|
33
|
+
end # BiDi
|
34
|
+
end # WebDriver
|
35
|
+
end # Selenium
|
@@ -0,0 +1,35 @@
|
|
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:, **opts)
|
27
|
+
super(**opts)
|
28
|
+
@method = method
|
29
|
+
@realm = realm
|
30
|
+
@args = args
|
31
|
+
end
|
32
|
+
end # ConsoleLogEntry
|
33
|
+
end # BiDi
|
34
|
+
end # WebDriver
|
35
|
+
end # Selenium
|
@@ -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
|
@@ -0,0 +1,33 @@
|
|
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
|
@@ -0,0 +1,33 @@
|
|
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(level: level, text: text, timestamp: timestamp, type: type, stack_trace: stack_trace)
|
28
|
+
@type = 'javascript'
|
29
|
+
end
|
30
|
+
end # JavascriptLogEntry
|
31
|
+
end # BiDi
|
32
|
+
end # WebDriver
|
33
|
+
end # Selenium
|