selenium-webdriver 3.142.7 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES +324 -5
- data/Gemfile +3 -1
- data/LICENSE +1 -1
- data/NOTICE +2 -0
- data/README.md +4 -5
- data/lib/selenium/server.rb +21 -29
- 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 +76 -78
- data/lib/selenium/webdriver/atoms/mutationListener.js +55 -0
- data/lib/selenium/webdriver/chrome/driver.rb +26 -83
- data/lib/selenium/webdriver/chrome/{bridge.rb → features.rb} +50 -12
- data/lib/selenium/webdriver/chrome/options.rb +129 -58
- data/lib/selenium/webdriver/chrome/profile.rb +6 -3
- data/lib/selenium/webdriver/chrome/service.rb +8 -15
- data/lib/selenium/webdriver/chrome.rb +10 -9
- data/lib/selenium/webdriver/common/action_builder.rb +97 -249
- data/lib/selenium/webdriver/common/driver.rb +112 -23
- data/lib/selenium/webdriver/common/driver_extensions/full_page_screenshot.rb +43 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_apple_permissions.rb +51 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_authentication.rb +89 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_casting.rb +77 -0
- data/lib/selenium/webdriver/common/driver_extensions/{has_touch_screen.rb → has_cdp.rb} +10 -8
- data/lib/selenium/webdriver/common/driver_extensions/has_context.rb +45 -0
- data/lib/selenium/webdriver/{firefox/util.rb → common/driver_extensions/has_devtools.rb} +16 -19
- data/lib/selenium/webdriver/common/driver_extensions/has_launching.rb +38 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +5 -8
- data/lib/selenium/webdriver/common/driver_extensions/has_log_events.rb +144 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_logs.rb +30 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb +17 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +6 -27
- data/lib/selenium/webdriver/common/driver_extensions/has_network_interception.rb +136 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_permissions.rb +11 -11
- data/lib/selenium/webdriver/common/driver_extensions/has_pinned_scripts.rb +77 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +1 -0
- data/lib/selenium/webdriver/common/driver_extensions/{rotatable.rb → prints_page.rb} +18 -20
- data/lib/selenium/webdriver/common/element.rb +82 -22
- data/lib/selenium/webdriver/common/error.rb +32 -196
- data/lib/selenium/webdriver/common/interactions/interaction.rb +4 -1
- data/lib/selenium/webdriver/common/interactions/key_actions.rb +5 -5
- data/lib/selenium/webdriver/common/interactions/pointer_actions.rb +13 -13
- data/lib/selenium/webdriver/common/log_entry.rb +2 -2
- data/lib/selenium/webdriver/common/logger.rb +50 -15
- data/lib/selenium/webdriver/common/manager.rb +15 -15
- data/lib/selenium/webdriver/common/options.rb +156 -23
- data/lib/selenium/webdriver/common/platform.rb +6 -1
- data/lib/selenium/webdriver/common/port_prober.rb +4 -6
- data/lib/selenium/webdriver/common/profile_helper.rb +10 -2
- data/lib/selenium/webdriver/common/proxy.rb +6 -3
- data/lib/selenium/webdriver/common/search_context.rb +7 -3
- data/lib/selenium/webdriver/common/service.rb +17 -125
- data/lib/selenium/webdriver/common/service_manager.rb +151 -0
- data/lib/selenium/webdriver/common/shadow_root.rb +87 -0
- data/lib/selenium/webdriver/common/socket_lock.rb +2 -2
- data/lib/selenium/webdriver/common/socket_poller.rb +2 -2
- data/lib/selenium/webdriver/common/takes_screenshot.rb +66 -0
- data/lib/selenium/webdriver/common/target_locator.rb +32 -4
- data/lib/selenium/webdriver/common/timeouts.rb +31 -4
- data/lib/selenium/webdriver/common/wait.rb +1 -1
- data/lib/selenium/webdriver/common/window.rb +0 -4
- data/lib/selenium/webdriver/common.rb +23 -17
- data/lib/selenium/webdriver/devtools/console_event.rb +38 -0
- data/lib/selenium/webdriver/devtools/exception_event.rb +36 -0
- data/lib/selenium/webdriver/devtools/mutation_event.rb +37 -0
- data/lib/selenium/webdriver/devtools/pinned_script.rb +59 -0
- data/lib/selenium/webdriver/devtools/request.rb +67 -0
- data/lib/selenium/webdriver/devtools/response.rb +66 -0
- data/lib/selenium/webdriver/devtools.rb +182 -0
- data/lib/selenium/webdriver/edge/driver.rb +7 -29
- data/lib/selenium/webdriver/edge/features.rb +44 -0
- data/lib/selenium/webdriver/edge/options.rb +11 -48
- data/lib/selenium/webdriver/{common/w3c_manager.rb → edge/profile.rb} +7 -19
- data/lib/selenium/webdriver/edge/service.rb +10 -26
- data/lib/selenium/webdriver/edge.rb +11 -14
- data/lib/selenium/webdriver/firefox/driver.rb +31 -19
- data/lib/selenium/webdriver/firefox/extension.rb +8 -0
- data/lib/selenium/webdriver/firefox/features.rb +66 -0
- data/lib/selenium/webdriver/firefox/options.rb +70 -49
- data/lib/selenium/webdriver/firefox/profile.rb +21 -71
- data/lib/selenium/webdriver/firefox/service.rb +5 -9
- data/lib/selenium/webdriver/firefox.rb +22 -20
- data/lib/selenium/webdriver/ie/driver.rb +1 -47
- data/lib/selenium/webdriver/ie/options.rb +13 -44
- data/lib/selenium/webdriver/ie/service.rb +13 -15
- data/lib/selenium/webdriver/ie.rb +8 -7
- data/lib/selenium/webdriver/remote/bridge.rb +558 -86
- data/lib/selenium/webdriver/remote/capabilities.rb +159 -123
- data/lib/selenium/webdriver/remote/commands.rb +163 -0
- data/lib/selenium/webdriver/remote/driver.rb +22 -12
- data/lib/selenium/webdriver/remote/http/common.rb +0 -5
- data/lib/selenium/webdriver/remote/http/default.rb +17 -20
- data/lib/selenium/webdriver/remote/http/persistent.rb +11 -6
- data/lib/selenium/webdriver/remote/response.rb +16 -47
- data/lib/selenium/webdriver/remote.rb +15 -13
- data/lib/selenium/webdriver/safari/driver.rb +3 -31
- data/lib/selenium/webdriver/safari/{bridge.rb → features.rb} +3 -3
- data/lib/selenium/webdriver/safari/options.rb +10 -29
- data/lib/selenium/webdriver/safari/service.rb +4 -8
- data/lib/selenium/webdriver/safari.rb +17 -9
- data/lib/selenium/webdriver/support/block_event_listener.rb +1 -1
- data/lib/selenium/webdriver/support/cdp/domain.rb.erb +63 -0
- data/lib/selenium/webdriver/support/cdp_client_generator.rb +108 -0
- data/lib/selenium/webdriver/support/color.rb +2 -2
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +4 -4
- data/lib/selenium/webdriver/support/guards/guard.rb +89 -0
- data/lib/selenium/webdriver/{firefox/marionette/bridge.rb → support/guards/guard_condition.rb} +22 -19
- data/lib/selenium/webdriver/support/guards.rb +95 -0
- data/lib/selenium/webdriver/support/relative_locator.rb +51 -0
- data/lib/selenium/webdriver/support/select.rb +3 -3
- data/lib/selenium/webdriver/support.rb +1 -0
- data/lib/selenium/webdriver/version.rb +1 -1
- data/lib/selenium/webdriver.rb +12 -12
- data/selenium-webdriver.gemspec +28 -12
- metadata +128 -69
- data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +0 -64
- data/lib/selenium/webdriver/common/keyboard.rb +0 -70
- 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/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
@@ -1,223 +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
|
-
module Remote
|
23
|
-
module OSS
|
24
|
-
|
25
|
-
#
|
26
|
-
# https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#command-reference
|
27
|
-
# @api private
|
28
|
-
#
|
29
|
-
|
30
|
-
class Bridge
|
31
|
-
|
32
|
-
COMMANDS = {
|
33
|
-
get_capabilities: [:get, 'session/:session_id'],
|
34
|
-
status: [:get, 'status'],
|
35
|
-
|
36
|
-
#
|
37
|
-
# basic driver
|
38
|
-
#
|
39
|
-
|
40
|
-
get_current_url: [:get, 'session/:session_id/url'],
|
41
|
-
get: [:post, 'session/:session_id/url'],
|
42
|
-
go_forward: [:post, 'session/:session_id/forward'],
|
43
|
-
go_back: [:post, 'session/:session_id/back'],
|
44
|
-
refresh: [:post, 'session/:session_id/refresh'],
|
45
|
-
quit: [:delete, 'session/:session_id'],
|
46
|
-
close: [:delete, 'session/:session_id/window'],
|
47
|
-
get_page_source: [:get, 'session/:session_id/source'],
|
48
|
-
get_title: [:get, 'session/:session_id/title'],
|
49
|
-
find_element: [:post, 'session/:session_id/element'],
|
50
|
-
find_elements: [:post, 'session/:session_id/elements'],
|
51
|
-
get_active_element: [:post, 'session/:session_id/element/active'],
|
52
|
-
|
53
|
-
#
|
54
|
-
# window handling
|
55
|
-
#
|
56
|
-
|
57
|
-
get_current_window_handle: [:get, 'session/:session_id/window_handle'],
|
58
|
-
get_window_handles: [:get, 'session/:session_id/window_handles'],
|
59
|
-
set_window_size: [:post, 'session/:session_id/window/:window_handle/size'],
|
60
|
-
set_window_position: [:post, 'session/:session_id/window/:window_handle/position'],
|
61
|
-
get_window_size: [:get, 'session/:session_id/window/:window_handle/size'],
|
62
|
-
get_window_position: [:get, 'session/:session_id/window/:window_handle/position'],
|
63
|
-
maximize_window: [:post, 'session/:session_id/window/:window_handle/maximize'],
|
64
|
-
|
65
|
-
#
|
66
|
-
# script execution
|
67
|
-
#
|
68
|
-
|
69
|
-
execute_script: [:post, 'session/:session_id/execute'],
|
70
|
-
execute_async_script: [:post, 'session/:session_id/execute_async'],
|
71
|
-
|
72
|
-
#
|
73
|
-
# screenshot
|
74
|
-
#
|
75
|
-
|
76
|
-
screenshot: [:get, 'session/:session_id/screenshot'],
|
77
|
-
|
78
|
-
#
|
79
|
-
# alerts
|
80
|
-
#
|
81
|
-
|
82
|
-
dismiss_alert: [:post, 'session/:session_id/dismiss_alert'],
|
83
|
-
accept_alert: [:post, 'session/:session_id/accept_alert'],
|
84
|
-
get_alert_text: [:get, 'session/:session_id/alert_text'],
|
85
|
-
set_alert_value: [:post, 'session/:session_id/alert_text'],
|
86
|
-
set_authentication: [:post, 'session/:session_id/alert/credentials'],
|
87
|
-
|
88
|
-
#
|
89
|
-
# target locator
|
90
|
-
#
|
91
|
-
|
92
|
-
switch_to_frame: [:post, 'session/:session_id/frame'],
|
93
|
-
switch_to_parent_frame: [:post, 'session/:session_id/frame/parent'],
|
94
|
-
switch_to_window: [:post, 'session/:session_id/window'],
|
95
|
-
|
96
|
-
#
|
97
|
-
# options
|
98
|
-
#
|
99
|
-
|
100
|
-
get_cookies: [:get, 'session/:session_id/cookie'],
|
101
|
-
add_cookie: [:post, 'session/:session_id/cookie'],
|
102
|
-
delete_all_cookies: [:delete, 'session/:session_id/cookie'],
|
103
|
-
delete_cookie: [:delete, 'session/:session_id/cookie/:name'],
|
104
|
-
|
105
|
-
#
|
106
|
-
# timeouts
|
107
|
-
#
|
108
|
-
|
109
|
-
implicitly_wait: [:post, 'session/:session_id/timeouts/implicit_wait'],
|
110
|
-
set_script_timeout: [:post, 'session/:session_id/timeouts/async_script'],
|
111
|
-
set_timeout: [:post, 'session/:session_id/timeouts'],
|
112
|
-
|
113
|
-
#
|
114
|
-
# element
|
115
|
-
#
|
116
|
-
|
117
|
-
describe_element: [:get, 'session/:session_id/element/:id'],
|
118
|
-
find_child_element: [:post, 'session/:session_id/element/:id/element'],
|
119
|
-
find_child_elements: [:post, 'session/:session_id/element/:id/elements'],
|
120
|
-
click_element: [:post, 'session/:session_id/element/:id/click'],
|
121
|
-
submit_element: [:post, 'session/:session_id/element/:id/submit'],
|
122
|
-
get_element_value: [:get, 'session/:session_id/element/:id/value'],
|
123
|
-
send_keys_to_element: [:post, 'session/:session_id/element/:id/value'],
|
124
|
-
upload_file: [:post, 'session/:session_id/file'],
|
125
|
-
get_element_tag_name: [:get, 'session/:session_id/element/:id/name'],
|
126
|
-
clear_element: [:post, 'session/:session_id/element/:id/clear'],
|
127
|
-
is_element_selected: [:get, 'session/:session_id/element/:id/selected'],
|
128
|
-
is_element_enabled: [:get, 'session/:session_id/element/:id/enabled'],
|
129
|
-
get_element_attribute: [:get, 'session/:session_id/element/:id/attribute/:name'],
|
130
|
-
element_equals: [:get, 'session/:session_id/element/:id/equals/:other'],
|
131
|
-
is_element_displayed: [:get, 'session/:session_id/element/:id/displayed'],
|
132
|
-
get_element_location: [:get, 'session/:session_id/element/:id/location'],
|
133
|
-
get_element_location_once_scrolled_into_view: [:get, 'session/:session_id/element/:id/location_in_view'],
|
134
|
-
get_element_size: [:get, 'session/:session_id/element/:id/size'],
|
135
|
-
drag_element: [:post, 'session/:session_id/element/:id/drag'],
|
136
|
-
get_element_value_of_css_property: [:get, 'session/:session_id/element/:id/css/:property_name'],
|
137
|
-
get_element_text: [:get, 'session/:session_id/element/:id/text'],
|
138
|
-
|
139
|
-
#
|
140
|
-
# rotatable
|
141
|
-
#
|
142
|
-
|
143
|
-
get_screen_orientation: [:get, 'session/:session_id/orientation'],
|
144
|
-
set_screen_orientation: [:post, 'session/:session_id/orientation'],
|
145
|
-
|
146
|
-
#
|
147
|
-
# interactions API
|
148
|
-
#
|
149
|
-
|
150
|
-
click: [:post, 'session/:session_id/click'],
|
151
|
-
double_click: [:post, 'session/:session_id/doubleclick'],
|
152
|
-
mouse_down: [:post, 'session/:session_id/buttondown'],
|
153
|
-
mouse_up: [:post, 'session/:session_id/buttonup'],
|
154
|
-
mouse_move_to: [:post, 'session/:session_id/moveto'],
|
155
|
-
send_modifier_key_to_active_element: [:post, 'session/:session_id/modifier'],
|
156
|
-
send_keys_to_active_element: [:post, 'session/:session_id/keys'],
|
157
|
-
|
158
|
-
#
|
159
|
-
# html 5
|
160
|
-
#
|
161
|
-
|
162
|
-
execute_sql: [:post, 'session/:session_id/execute_sql'],
|
163
|
-
|
164
|
-
get_location: [:get, 'session/:session_id/location'],
|
165
|
-
set_location: [:post, 'session/:session_id/location'],
|
166
|
-
|
167
|
-
get_app_cache: [:get, 'session/:session_id/application_cache'],
|
168
|
-
get_app_cache_status: [:get, 'session/:session_id/application_cache/status'],
|
169
|
-
clear_app_cache: [:delete, 'session/:session_id/application_cache/clear'],
|
170
|
-
|
171
|
-
get_network_connection: [:get, 'session/:session_id/network_connection'],
|
172
|
-
set_network_connection: [:post, 'session/:session_id/network_connection'],
|
173
|
-
|
174
|
-
get_local_storage_item: [:get, 'session/:session_id/local_storage/key/:key'],
|
175
|
-
remove_local_storage_item: [:delete, 'session/:session_id/local_storage/key/:key'],
|
176
|
-
get_local_storage_keys: [:get, 'session/:session_id/local_storage'],
|
177
|
-
set_local_storage_item: [:post, 'session/:session_id/local_storage'],
|
178
|
-
clear_local_storage: [:delete, 'session/:session_id/local_storage'],
|
179
|
-
get_local_storage_size: [:get, 'session/:session_id/local_storage/size'],
|
180
|
-
|
181
|
-
get_session_storage_item: [:get, 'session/:session_id/session_storage/key/:key'],
|
182
|
-
remove_session_storage_item: [:delete, 'session/:session_id/session_storage/key/:key'],
|
183
|
-
get_session_storage_keys: [:get, 'session/:session_id/session_storage'],
|
184
|
-
set_session_storage_item: [:post, 'session/:session_id/session_storage'],
|
185
|
-
clear_session_storage: [:delete, 'session/:session_id/session_storage'],
|
186
|
-
get_session_storage_size: [:get, 'session/:session_id/session_storage/size'],
|
187
|
-
|
188
|
-
#
|
189
|
-
# ime
|
190
|
-
#
|
191
|
-
|
192
|
-
ime_get_available_engines: [:get, 'session/:session_id/ime/available_engines'],
|
193
|
-
ime_get_active_engine: [:get, 'session/:session_id/ime/active_engine'],
|
194
|
-
ime_is_activated: [:get, 'session/:session_id/ime/activated'],
|
195
|
-
ime_deactivate: [:post, 'session/:session_id/ime/deactivate'],
|
196
|
-
ime_activate_engine: [:post, 'session/:session_id/ime/activate'],
|
197
|
-
|
198
|
-
#
|
199
|
-
# touch
|
200
|
-
#
|
201
|
-
|
202
|
-
touch_single_tap: [:post, 'session/:session_id/touch/click'],
|
203
|
-
touch_double_tap: [:post, 'session/:session_id/touch/doubleclick'],
|
204
|
-
touch_long_press: [:post, 'session/:session_id/touch/longclick'],
|
205
|
-
touch_down: [:post, 'session/:session_id/touch/down'],
|
206
|
-
touch_up: [:post, 'session/:session_id/touch/up'],
|
207
|
-
touch_move: [:post, 'session/:session_id/touch/move'],
|
208
|
-
touch_scroll: [:post, 'session/:session_id/touch/scroll'],
|
209
|
-
touch_flick: [:post, 'session/:session_id/touch/flick'],
|
210
|
-
|
211
|
-
#
|
212
|
-
# logs
|
213
|
-
#
|
214
|
-
|
215
|
-
get_available_log_types: [:get, 'session/:session_id/log/types'],
|
216
|
-
get_log: [:post, 'session/:session_id/log']
|
217
|
-
}.freeze
|
218
|
-
|
219
|
-
end # Bridge
|
220
|
-
end # OSS
|
221
|
-
end # Remote
|
222
|
-
end # WebDriver
|
223
|
-
end # Selenium
|