selenium-webdriver 3.142.7 → 4.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES +685 -5
- data/Gemfile +6 -1
- data/LICENSE +1 -1
- data/NOTICE +2 -0
- data/README.md +4 -5
- 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 +93 -90
- data/lib/selenium/webdriver/atoms/findElements.js +122 -0
- data/lib/selenium/webdriver/atoms/getAttribute.js +100 -7
- data/lib/selenium/webdriver/atoms/isDisplayed.js +77 -78
- data/lib/selenium/webdriver/atoms/mutationListener.js +55 -0
- data/lib/selenium/webdriver/atoms.rb +5 -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 +51 -0
- data/lib/selenium/webdriver/{common/keyboard.rb → bidi.rb} +21 -35
- data/lib/selenium/webdriver/chrome/driver.rb +9 -86
- data/lib/selenium/webdriver/chrome/features.rb +48 -0
- data/lib/selenium/webdriver/chrome/options.rb +9 -158
- data/lib/selenium/webdriver/chrome/profile.rb +3 -80
- data/lib/selenium/webdriver/chrome/service.rb +7 -29
- data/lib/selenium/webdriver/chrome.rb +5 -20
- data/lib/selenium/webdriver/chromium/driver.rb +60 -0
- data/lib/selenium/webdriver/{chrome/bridge.rb → chromium/features.rb} +48 -17
- data/lib/selenium/webdriver/chromium/options.rb +243 -0
- data/lib/selenium/webdriver/chromium/profile.rb +113 -0
- data/lib/selenium/webdriver/chromium.rb +29 -0
- data/lib/selenium/webdriver/common/action_builder.rb +126 -238
- data/lib/selenium/webdriver/common/child_process.rb +124 -0
- data/lib/selenium/webdriver/common/driver.rb +82 -43
- data/lib/selenium/webdriver/common/driver_extensions/downloads_files.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/{has_location.rb → full_page_screenshot.rb} +13 -11
- data/lib/selenium/webdriver/common/driver_extensions/has_addons.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +49 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +87 -0
- data/lib/selenium/webdriver/common/driver_extensions/{has_touch_screen.rb → has_bidi.rb} +9 -9
- data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +86 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_cdp.rb +36 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +42 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_debugger.rb +0 -2
- data/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb +41 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_file_downloads.rb +65 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +36 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +143 -0
- data/lib/selenium/webdriver/common/driver_extensions/{has_remote_status.rb → has_logs.rb} +4 -4
- data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +16 -1
- data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +69 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +11 -13
- data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +75 -0
- data/lib/selenium/webdriver/common/driver_extensions/{rotatable.rb → prints_page.rb} +18 -20
- data/lib/selenium/webdriver/common/driver_finder.rb +45 -0
- data/lib/selenium/webdriver/common/element.rb +89 -29
- data/lib/selenium/webdriver/common/error.rb +53 -194
- data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +2 -2
- data/lib/selenium/webdriver/common/interactions/input_device.rb +10 -4
- data/lib/selenium/webdriver/common/interactions/interaction.rb +12 -22
- data/lib/selenium/webdriver/common/interactions/interactions.rb +24 -4
- data/lib/selenium/webdriver/common/interactions/key_actions.rb +10 -6
- data/lib/selenium/webdriver/common/interactions/key_input.rb +11 -27
- data/lib/selenium/webdriver/common/interactions/none_input.rb +10 -8
- data/lib/selenium/webdriver/common/interactions/pause.rb +49 -0
- data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +71 -82
- data/lib/selenium/webdriver/common/interactions/pointer_cancel.rb +45 -0
- data/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb +63 -0
- data/lib/selenium/webdriver/common/interactions/pointer_input.rb +15 -84
- data/lib/selenium/webdriver/common/interactions/pointer_move.rb +60 -0
- data/lib/selenium/webdriver/common/interactions/pointer_press.rb +85 -0
- data/lib/selenium/webdriver/common/interactions/scroll.rb +59 -0
- data/lib/selenium/webdriver/common/interactions/scroll_origin.rb +48 -0
- data/lib/selenium/webdriver/common/interactions/typing_interaction.rb +54 -0
- data/lib/selenium/webdriver/common/interactions/wheel_actions.rb +113 -0
- data/lib/selenium/webdriver/common/{w3c_manager.rb → interactions/wheel_input.rb} +14 -17
- data/lib/selenium/webdriver/common/keys.rb +1 -0
- data/lib/selenium/webdriver/common/local_driver.rb +46 -0
- data/lib/selenium/webdriver/common/log_entry.rb +2 -2
- data/lib/selenium/webdriver/common/logger.rb +119 -19
- data/lib/selenium/webdriver/common/manager.rb +11 -38
- data/lib/selenium/webdriver/common/options.rb +154 -23
- data/lib/selenium/webdriver/common/platform.rb +15 -52
- data/lib/selenium/webdriver/common/port_prober.rb +4 -6
- data/lib/selenium/webdriver/common/profile_helper.rb +11 -9
- data/lib/selenium/webdriver/common/proxy.rb +8 -5
- data/lib/selenium/webdriver/common/search_context.rb +7 -9
- data/lib/selenium/webdriver/common/selenium_manager.rb +140 -0
- data/lib/selenium/webdriver/common/service.rb +26 -143
- data/lib/selenium/webdriver/common/service_manager.rb +144 -0
- data/lib/selenium/webdriver/common/shadow_root.rb +86 -0
- data/lib/selenium/webdriver/common/socket_lock.rb +4 -4
- data/lib/selenium/webdriver/common/socket_poller.rb +4 -4
- data/lib/selenium/webdriver/common/takes_screenshot.rb +65 -0
- data/lib/selenium/webdriver/common/target_locator.rb +31 -4
- data/lib/selenium/webdriver/common/timeouts.rb +31 -4
- data/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +85 -0
- data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb +72 -0
- data/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator_options.rb +62 -0
- data/lib/selenium/webdriver/common/wait.rb +1 -1
- data/lib/selenium/webdriver/common/websocket_connection.rb +164 -0
- data/lib/selenium/webdriver/common/window.rb +6 -10
- data/lib/selenium/webdriver/common/zipper.rb +4 -10
- data/lib/selenium/webdriver/common.rb +43 -20
- data/lib/selenium/webdriver/devtools/console_event.rb +36 -0
- data/lib/selenium/webdriver/devtools/exception_event.rb +34 -0
- data/lib/selenium/webdriver/devtools/mutation_event.rb +35 -0
- data/lib/selenium/webdriver/devtools/network_interceptor.rb +173 -0
- data/lib/selenium/webdriver/devtools/pinned_script.rb +57 -0
- data/lib/selenium/webdriver/devtools/request.rb +65 -0
- data/lib/selenium/webdriver/devtools/response.rb +64 -0
- data/lib/selenium/webdriver/devtools.rb +96 -0
- data/lib/selenium/webdriver/edge/driver.rb +11 -27
- data/lib/selenium/webdriver/edge/features.rb +48 -0
- data/lib/selenium/webdriver/edge/options.rb +18 -43
- data/lib/selenium/webdriver/edge/profile.rb +33 -0
- data/lib/selenium/webdriver/edge/service.rb +8 -23
- data/lib/selenium/webdriver/edge.rb +11 -16
- data/lib/selenium/webdriver/firefox/driver.rb +38 -19
- data/lib/selenium/webdriver/firefox/extension.rb +8 -0
- data/lib/selenium/webdriver/firefox/features.rb +70 -0
- data/lib/selenium/webdriver/firefox/options.rb +73 -61
- data/lib/selenium/webdriver/firefox/profile.rb +20 -72
- data/lib/selenium/webdriver/firefox/service.rb +3 -25
- data/lib/selenium/webdriver/firefox/util.rb +1 -1
- data/lib/selenium/webdriver/firefox.rb +17 -28
- data/lib/selenium/webdriver/ie/driver.rb +5 -45
- data/lib/selenium/webdriver/ie/features.rb +34 -0
- data/lib/selenium/webdriver/ie/options.rb +14 -44
- data/lib/selenium/webdriver/ie/service.rb +3 -27
- data/lib/selenium/webdriver/ie.rb +4 -16
- data/lib/selenium/webdriver/remote/bridge/commands.rb +164 -0
- data/lib/selenium/webdriver/remote/bridge.rb +574 -88
- data/lib/selenium/webdriver/remote/capabilities.rb +144 -158
- data/lib/selenium/webdriver/remote/driver.rb +45 -14
- data/lib/selenium/webdriver/remote/features.rb +75 -0
- data/lib/selenium/webdriver/remote/http/common.rb +3 -8
- data/lib/selenium/webdriver/remote/http/curb.rb +1 -3
- data/lib/selenium/webdriver/remote/http/default.rb +24 -33
- data/lib/selenium/webdriver/remote/response.rb +17 -49
- data/lib/selenium/webdriver/remote/server_error.rb +1 -1
- data/lib/selenium/webdriver/remote.rb +15 -12
- data/lib/selenium/webdriver/safari/driver.rb +7 -29
- data/lib/selenium/webdriver/safari/{bridge.rb → features.rb} +7 -5
- data/lib/selenium/webdriver/safari/options.rb +12 -27
- data/lib/selenium/webdriver/safari/service.rb +13 -11
- data/lib/selenium/webdriver/safari.rb +14 -20
- data/lib/selenium/webdriver/support/block_event_listener.rb +1 -1
- data/lib/selenium/webdriver/support/color.rb +24 -24
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +5 -5
- data/lib/selenium/webdriver/support/guards/guard.rb +90 -0
- data/lib/selenium/webdriver/{firefox/marionette/bridge.rb → support/guards/guard_condition.rb} +21 -20
- data/lib/selenium/webdriver/support/guards.rb +95 -0
- data/lib/selenium/webdriver/support/relative_locator.rb +50 -0
- data/lib/selenium/webdriver/support/select.rb +6 -4
- data/lib/selenium/webdriver/support.rb +1 -0
- data/lib/selenium/webdriver/version.rb +1 -1
- data/lib/selenium/webdriver.rb +19 -17
- data/selenium-webdriver.gemspec +36 -18
- metadata +161 -91
- data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
- data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +0 -58
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +0 -64
- data/lib/selenium/webdriver/common/mouse.rb +0 -89
- data/lib/selenium/webdriver/common/touch_action_builder.rb +0 -78
- data/lib/selenium/webdriver/common/touch_screen.rb +0 -123
- data/lib/selenium/webdriver/common/w3c_action_builder.rb +0 -212
- data/lib/selenium/webdriver/edge/bridge.rb +0 -76
- data/lib/selenium/webdriver/firefox/binary.rb +0 -187
- data/lib/selenium/webdriver/firefox/extension/prefs.json +0 -69
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/lib/selenium/webdriver/firefox/launcher.rb +0 -111
- data/lib/selenium/webdriver/firefox/legacy/driver.rb +0 -83
- data/lib/selenium/webdriver/firefox/marionette/driver.rb +0 -90
- data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/remote/http/persistent.rb +0 -60
- data/lib/selenium/webdriver/remote/oss/bridge.rb +0 -594
- data/lib/selenium/webdriver/remote/oss/commands.rb +0 -223
- data/lib/selenium/webdriver/remote/w3c/bridge.rb +0 -605
- data/lib/selenium/webdriver/remote/w3c/capabilities.rb +0 -310
- data/lib/selenium/webdriver/remote/w3c/commands.rb +0 -157
@@ -0,0 +1,164 @@
|
|
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
|
+
module Remote
|
23
|
+
#
|
24
|
+
# https://w3c.github.io/webdriver/#endpoints
|
25
|
+
# @api private
|
26
|
+
#
|
27
|
+
|
28
|
+
class Bridge
|
29
|
+
COMMANDS = {
|
30
|
+
status: [:get, 'status'],
|
31
|
+
|
32
|
+
#
|
33
|
+
# session handling
|
34
|
+
#
|
35
|
+
|
36
|
+
new_session: [:post, 'session'],
|
37
|
+
delete_session: [:delete, 'session/:session_id'],
|
38
|
+
|
39
|
+
#
|
40
|
+
# basic driver
|
41
|
+
#
|
42
|
+
|
43
|
+
get: [:post, 'session/:session_id/url'],
|
44
|
+
get_current_url: [:get, 'session/:session_id/url'],
|
45
|
+
back: [:post, 'session/:session_id/back'],
|
46
|
+
forward: [:post, 'session/:session_id/forward'],
|
47
|
+
refresh: [:post, 'session/:session_id/refresh'],
|
48
|
+
get_title: [:get, 'session/:session_id/title'],
|
49
|
+
|
50
|
+
#
|
51
|
+
# window and Frame handling
|
52
|
+
#
|
53
|
+
|
54
|
+
get_window_handle: [:get, 'session/:session_id/window'],
|
55
|
+
new_window: [:post, 'session/:session_id/window/new'],
|
56
|
+
close_window: [:delete, 'session/:session_id/window'],
|
57
|
+
switch_to_window: [:post, 'session/:session_id/window'],
|
58
|
+
get_window_handles: [:get, 'session/:session_id/window/handles'],
|
59
|
+
fullscreen_window: [:post, 'session/:session_id/window/fullscreen'],
|
60
|
+
minimize_window: [:post, 'session/:session_id/window/minimize'],
|
61
|
+
maximize_window: [:post, 'session/:session_id/window/maximize'],
|
62
|
+
set_window_rect: [:post, 'session/:session_id/window/rect'],
|
63
|
+
get_window_rect: [:get, 'session/:session_id/window/rect'],
|
64
|
+
switch_to_frame: [:post, 'session/:session_id/frame'],
|
65
|
+
switch_to_parent_frame: [:post, 'session/:session_id/frame/parent'],
|
66
|
+
|
67
|
+
#
|
68
|
+
# element
|
69
|
+
#
|
70
|
+
|
71
|
+
find_element: [:post, 'session/:session_id/element'],
|
72
|
+
find_elements: [:post, 'session/:session_id/elements'],
|
73
|
+
find_child_element: [:post, 'session/:session_id/element/:id/element'],
|
74
|
+
find_child_elements: [:post, 'session/:session_id/element/:id/elements'],
|
75
|
+
find_shadow_child_element: [:post, 'session/:session_id/shadow/:id/element'],
|
76
|
+
find_shadow_child_elements: [:post, 'session/:session_id/shadow/:id/elements'],
|
77
|
+
get_active_element: [:get, 'session/:session_id/element/active'],
|
78
|
+
get_element_shadow_root: [:get, 'session/:session_id/element/:id/shadow'],
|
79
|
+
is_element_selected: [:get, 'session/:session_id/element/:id/selected'],
|
80
|
+
get_element_attribute: [:get, 'session/:session_id/element/:id/attribute/:name'],
|
81
|
+
get_element_property: [:get, 'session/:session_id/element/:id/property/:name'],
|
82
|
+
get_element_css_value: [:get, 'session/:session_id/element/:id/css/:property_name'],
|
83
|
+
get_element_aria_role: [:get, 'session/:session_id/element/:id/computedrole'],
|
84
|
+
get_element_aria_label: [:get, 'session/:session_id/element/:id/computedlabel'],
|
85
|
+
get_element_text: [:get, 'session/:session_id/element/:id/text'],
|
86
|
+
get_element_tag_name: [:get, 'session/:session_id/element/:id/name'],
|
87
|
+
get_element_rect: [:get, 'session/:session_id/element/:id/rect'],
|
88
|
+
is_element_enabled: [:get, 'session/:session_id/element/:id/enabled'],
|
89
|
+
|
90
|
+
#
|
91
|
+
# document handling
|
92
|
+
#
|
93
|
+
|
94
|
+
get_page_source: [:get, 'session/:session_id/source'],
|
95
|
+
execute_script: [:post, 'session/:session_id/execute/sync'],
|
96
|
+
execute_async_script: [:post, 'session/:session_id/execute/async'],
|
97
|
+
|
98
|
+
#
|
99
|
+
# cookies
|
100
|
+
#
|
101
|
+
|
102
|
+
get_all_cookies: [:get, 'session/:session_id/cookie'],
|
103
|
+
get_cookie: [:get, 'session/:session_id/cookie/:name'],
|
104
|
+
add_cookie: [:post, 'session/:session_id/cookie'],
|
105
|
+
delete_cookie: [:delete, 'session/:session_id/cookie/:name'],
|
106
|
+
delete_all_cookies: [:delete, 'session/:session_id/cookie'],
|
107
|
+
|
108
|
+
#
|
109
|
+
# timeouts
|
110
|
+
#
|
111
|
+
|
112
|
+
get_timeouts: [:get, 'session/:session_id/timeouts'],
|
113
|
+
set_timeout: [:post, 'session/:session_id/timeouts'],
|
114
|
+
|
115
|
+
#
|
116
|
+
# actions
|
117
|
+
#
|
118
|
+
|
119
|
+
actions: [:post, 'session/:session_id/actions'],
|
120
|
+
release_actions: [:delete, 'session/:session_id/actions'],
|
121
|
+
print_page: [:post, 'session/:session_id/print'],
|
122
|
+
|
123
|
+
#
|
124
|
+
# Element Operations
|
125
|
+
#
|
126
|
+
|
127
|
+
element_click: [:post, 'session/:session_id/element/:id/click'],
|
128
|
+
element_clear: [:post, 'session/:session_id/element/:id/clear'],
|
129
|
+
element_send_keys: [:post, 'session/:session_id/element/:id/value'],
|
130
|
+
|
131
|
+
#
|
132
|
+
# alerts
|
133
|
+
#
|
134
|
+
|
135
|
+
dismiss_alert: [:post, 'session/:session_id/alert/dismiss'],
|
136
|
+
accept_alert: [:post, 'session/:session_id/alert/accept'],
|
137
|
+
get_alert_text: [:get, 'session/:session_id/alert/text'],
|
138
|
+
send_alert_text: [:post, 'session/:session_id/alert/text'],
|
139
|
+
|
140
|
+
#
|
141
|
+
# screenshot
|
142
|
+
#
|
143
|
+
|
144
|
+
take_screenshot: [:get, 'session/:session_id/screenshot'],
|
145
|
+
take_element_screenshot: [:get, 'session/:session_id/element/:id/screenshot'],
|
146
|
+
|
147
|
+
#
|
148
|
+
# virtual-authenticator
|
149
|
+
#
|
150
|
+
|
151
|
+
add_virtual_authenticator: [:post, 'session/:session_id/webauthn/authenticator'],
|
152
|
+
remove_virtual_authenticator: [:delete, 'session/:session_id/webauthn/authenticator/:authenticatorId'],
|
153
|
+
add_credential: [:post, 'session/:session_id/webauthn/authenticator/:authenticatorId/credential'],
|
154
|
+
get_credentials: [:get, 'session/:session_id/webauthn/authenticator/:authenticatorId/credentials'],
|
155
|
+
remove_credential: [:delete,
|
156
|
+
'session/:session_id/webauthn/authenticator/:authenticatorId/credentials/:credentialId'],
|
157
|
+
remove_all_credentials: [:delete, 'session/:session_id/webauthn/authenticator/:authenticatorId/credentials'],
|
158
|
+
set_user_verified: [:post, 'session/:session_id/webauthn/authenticator/:authenticatorId/uv']
|
159
|
+
|
160
|
+
}.freeze
|
161
|
+
end # Bridge
|
162
|
+
end # Remote
|
163
|
+
end # WebDriver
|
164
|
+
end # Selenium
|