selenium-webdriver 4.0.0.alpha5 → 4.0.0.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +38 -0
- data/LICENSE +1 -1
- data/lib/selenium/webdriver/atoms/findElements.js +1 -1
- data/lib/selenium/webdriver/chrome/bridge.rb +4 -6
- data/lib/selenium/webdriver/chrome/driver.rb +4 -0
- data/lib/selenium/webdriver/chrome/options.rb +24 -19
- data/lib/selenium/webdriver/common.rb +1 -0
- data/lib/selenium/webdriver/common/driver.rb +55 -23
- data/lib/selenium/webdriver/common/logger.rb +1 -1
- data/lib/selenium/webdriver/common/manager.rb +5 -0
- data/lib/selenium/webdriver/common/options.rb +32 -9
- data/lib/selenium/webdriver/common/port_prober.rb +4 -6
- data/lib/selenium/webdriver/common/service.rb +12 -106
- data/lib/selenium/webdriver/common/service_manager.rb +151 -0
- data/lib/selenium/webdriver/devtools.rb +118 -0
- data/lib/selenium/webdriver/devtools/accessibility.rb +62 -0
- data/lib/selenium/webdriver/devtools/animation.rb +98 -0
- data/lib/selenium/webdriver/devtools/application_cache.rb +64 -0
- data/lib/selenium/webdriver/devtools/audits.rb +61 -0
- data/lib/selenium/webdriver/devtools/background_service.rb +67 -0
- data/lib/selenium/webdriver/devtools/browser.rb +123 -0
- data/lib/selenium/webdriver/devtools/cache_storage.rb +73 -0
- data/lib/selenium/webdriver/devtools/cast.rb +70 -0
- data/lib/selenium/webdriver/devtools/console.rb +57 -0
- data/lib/selenium/webdriver/devtools/css.rb +165 -0
- data/lib/selenium/webdriver/devtools/database.rb +64 -0
- data/lib/selenium/webdriver/devtools/debugger.rb +229 -0
- data/lib/selenium/webdriver/devtools/device_orientation.rb +53 -0
- data/lib/selenium/webdriver/devtools/dom.rb +320 -0
- data/lib/selenium/webdriver/devtools/domdebugger.rb +93 -0
- data/lib/selenium/webdriver/devtools/domsnapshot.rb +65 -0
- data/lib/selenium/webdriver/devtools/domstorage.rb +79 -0
- data/lib/selenium/webdriver/devtools/emulation.rb +180 -0
- data/lib/selenium/webdriver/devtools/fetch.rb +97 -0
- data/lib/selenium/webdriver/devtools/headless_experimental.rb +61 -0
- data/lib/selenium/webdriver/devtools/heap_profiler.rb +107 -0
- data/lib/selenium/webdriver/devtools/indexed_db.rb +100 -0
- data/lib/selenium/webdriver/devtools/input.rb +140 -0
- data/lib/selenium/webdriver/devtools/inspector.rb +55 -0
- data/lib/selenium/webdriver/devtools/io.rb +59 -0
- data/lib/selenium/webdriver/devtools/layer_tree.rb +95 -0
- data/lib/selenium/webdriver/devtools/log.rb +66 -0
- data/lib/selenium/webdriver/devtools/media.rb +57 -0
- data/lib/selenium/webdriver/devtools/memory.rb +86 -0
- data/lib/selenium/webdriver/devtools/network.rb +228 -0
- data/lib/selenium/webdriver/devtools/overlay.rb +157 -0
- data/lib/selenium/webdriver/devtools/page.rb +374 -0
- data/lib/selenium/webdriver/devtools/performance.rb +63 -0
- data/lib/selenium/webdriver/devtools/profiler.rb +111 -0
- data/lib/selenium/webdriver/devtools/runtime.rb +193 -0
- data/lib/selenium/webdriver/devtools/schema.rb +46 -0
- data/lib/selenium/webdriver/devtools/security.rb +71 -0
- data/lib/selenium/webdriver/devtools/service_worker.rb +116 -0
- data/lib/selenium/webdriver/devtools/storage.rb +95 -0
- data/lib/selenium/webdriver/devtools/system_info.rb +50 -0
- data/lib/selenium/webdriver/devtools/target.rb +141 -0
- data/lib/selenium/webdriver/devtools/tethering.rb +55 -0
- data/lib/selenium/webdriver/devtools/tracing.rb +76 -0
- data/lib/selenium/webdriver/devtools/web_audio.rb +70 -0
- data/lib/selenium/webdriver/devtools/web_authn.rb +94 -0
- data/lib/selenium/webdriver/edge_chrome/bridge.rb +9 -2
- data/lib/selenium/webdriver/edge_chrome/driver.rb +4 -0
- data/lib/selenium/webdriver/edge_chrome/options.rb +2 -0
- data/lib/selenium/webdriver/edge_html/options.rb +2 -9
- data/lib/selenium/webdriver/firefox/bridge.rb +1 -1
- data/lib/selenium/webdriver/firefox/driver.rb +4 -0
- data/lib/selenium/webdriver/firefox/options.rb +5 -10
- data/lib/selenium/webdriver/ie/options.rb +7 -10
- data/lib/selenium/webdriver/remote/bridge.rb +3 -13
- data/lib/selenium/webdriver/remote/capabilities.rb +11 -6
- data/lib/selenium/webdriver/safari/bridge.rb +1 -1
- data/lib/selenium/webdriver/safari/driver.rb +4 -0
- data/lib/selenium/webdriver/safari/options.rb +1 -8
- data/lib/selenium/webdriver/support/cdp_client_generator.rb +77 -0
- data/lib/selenium/webdriver/support/color.rb +2 -2
- data/lib/selenium/webdriver/version.rb +1 -1
- data/selenium-webdriver.gemspec +2 -2
- metadata +53 -5
@@ -0,0 +1,53 @@
|
|
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
|
+
module Selenium
|
22
|
+
module WebDriver
|
23
|
+
class DevTools
|
24
|
+
def device_orientation
|
25
|
+
@device_orientation ||= DeviceOrientation.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class DeviceOrientation
|
29
|
+
|
30
|
+
def initialize(devtools)
|
31
|
+
@devtools = devtools
|
32
|
+
end
|
33
|
+
|
34
|
+
def on(event, &block)
|
35
|
+
event = EVENTS[event] if event.is_a?(Symbol)
|
36
|
+
@devtools.callbacks["DeviceOrientation.#{event}"] << block
|
37
|
+
end
|
38
|
+
|
39
|
+
def clear_device_orientation_override
|
40
|
+
@devtools.send_cmd('DeviceOrientation.clearDeviceOrientationOverride')
|
41
|
+
end
|
42
|
+
|
43
|
+
def set_device_orientation_override(alpha:, beta:, gamma:)
|
44
|
+
@devtools.send_cmd('DeviceOrientation.setDeviceOrientationOverride',
|
45
|
+
alpha: alpha,
|
46
|
+
beta: beta,
|
47
|
+
gamma: gamma)
|
48
|
+
end
|
49
|
+
|
50
|
+
end # DeviceOrientation
|
51
|
+
end # DevTools
|
52
|
+
end # WebDriver
|
53
|
+
end # Selenium
|
@@ -0,0 +1,320 @@
|
|
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
|
+
module Selenium
|
22
|
+
module WebDriver
|
23
|
+
class DevTools
|
24
|
+
def dom
|
25
|
+
@dom ||= DOM.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class DOM
|
29
|
+
EVENTS = {
|
30
|
+
attribute_modified: 'attributeModified',
|
31
|
+
attribute_removed: 'attributeRemoved',
|
32
|
+
character_data_modified: 'characterDataModified',
|
33
|
+
child_node_count_updated: 'childNodeCountUpdated',
|
34
|
+
child_node_inserted: 'childNodeInserted',
|
35
|
+
child_node_removed: 'childNodeRemoved',
|
36
|
+
distributed_nodes_updated: 'distributedNodesUpdated',
|
37
|
+
document_updated: 'documentUpdated',
|
38
|
+
inline_style_invalidated: 'inlineStyleInvalidated',
|
39
|
+
pseudo_element_added: 'pseudoElementAdded',
|
40
|
+
pseudo_element_removed: 'pseudoElementRemoved',
|
41
|
+
set_child_nodes: 'setChildNodes',
|
42
|
+
shadow_root_popped: 'shadowRootPopped',
|
43
|
+
shadow_root_pushed: 'shadowRootPushed',
|
44
|
+
}
|
45
|
+
|
46
|
+
def initialize(devtools)
|
47
|
+
@devtools = devtools
|
48
|
+
end
|
49
|
+
|
50
|
+
def on(event, &block)
|
51
|
+
event = EVENTS[event] if event.is_a?(Symbol)
|
52
|
+
@devtools.callbacks["DOM.#{event}"] << block
|
53
|
+
end
|
54
|
+
|
55
|
+
def collect_class_names_from_subtree(node_id:)
|
56
|
+
@devtools.send_cmd('DOM.collectClassNamesFromSubtree',
|
57
|
+
nodeId: node_id)
|
58
|
+
end
|
59
|
+
|
60
|
+
def copy_to(node_id:, target_node_id:, insert_before_node_id: nil)
|
61
|
+
@devtools.send_cmd('DOM.copyTo',
|
62
|
+
nodeId: node_id,
|
63
|
+
targetNodeId: target_node_id,
|
64
|
+
insertBeforeNodeId: insert_before_node_id)
|
65
|
+
end
|
66
|
+
|
67
|
+
def describe_node(node_id: nil, backend_node_id: nil, object_id: nil, depth: nil, pierce: nil)
|
68
|
+
@devtools.send_cmd('DOM.describeNode',
|
69
|
+
nodeId: node_id,
|
70
|
+
backendNodeId: backend_node_id,
|
71
|
+
objectId: object_id,
|
72
|
+
depth: depth,
|
73
|
+
pierce: pierce)
|
74
|
+
end
|
75
|
+
|
76
|
+
def scroll_into_view_if_needed(node_id: nil, backend_node_id: nil, object_id: nil, rect: nil)
|
77
|
+
@devtools.send_cmd('DOM.scrollIntoViewIfNeeded',
|
78
|
+
nodeId: node_id,
|
79
|
+
backendNodeId: backend_node_id,
|
80
|
+
objectId: object_id,
|
81
|
+
rect: rect)
|
82
|
+
end
|
83
|
+
|
84
|
+
def disable
|
85
|
+
@devtools.send_cmd('DOM.disable')
|
86
|
+
end
|
87
|
+
|
88
|
+
def discard_search_results(search_id:)
|
89
|
+
@devtools.send_cmd('DOM.discardSearchResults',
|
90
|
+
searchId: search_id)
|
91
|
+
end
|
92
|
+
|
93
|
+
def enable
|
94
|
+
@devtools.send_cmd('DOM.enable')
|
95
|
+
end
|
96
|
+
|
97
|
+
def focus(node_id: nil, backend_node_id: nil, object_id: nil)
|
98
|
+
@devtools.send_cmd('DOM.focus',
|
99
|
+
nodeId: node_id,
|
100
|
+
backendNodeId: backend_node_id,
|
101
|
+
objectId: object_id)
|
102
|
+
end
|
103
|
+
|
104
|
+
def get_attributes(node_id:)
|
105
|
+
@devtools.send_cmd('DOM.getAttributes',
|
106
|
+
nodeId: node_id)
|
107
|
+
end
|
108
|
+
|
109
|
+
def get_box_model(node_id: nil, backend_node_id: nil, object_id: nil)
|
110
|
+
@devtools.send_cmd('DOM.getBoxModel',
|
111
|
+
nodeId: node_id,
|
112
|
+
backendNodeId: backend_node_id,
|
113
|
+
objectId: object_id)
|
114
|
+
end
|
115
|
+
|
116
|
+
def get_content_quads(node_id: nil, backend_node_id: nil, object_id: nil)
|
117
|
+
@devtools.send_cmd('DOM.getContentQuads',
|
118
|
+
nodeId: node_id,
|
119
|
+
backendNodeId: backend_node_id,
|
120
|
+
objectId: object_id)
|
121
|
+
end
|
122
|
+
|
123
|
+
def get_document(depth: nil, pierce: nil)
|
124
|
+
@devtools.send_cmd('DOM.getDocument',
|
125
|
+
depth: depth,
|
126
|
+
pierce: pierce)
|
127
|
+
end
|
128
|
+
|
129
|
+
def get_flattened_document(depth: nil, pierce: nil)
|
130
|
+
@devtools.send_cmd('DOM.getFlattenedDocument',
|
131
|
+
depth: depth,
|
132
|
+
pierce: pierce)
|
133
|
+
end
|
134
|
+
|
135
|
+
def get_node_for_location(x:, y:, include_user_agent_shadow_dom: nil, ignore_pointer_events_none: nil)
|
136
|
+
@devtools.send_cmd('DOM.getNodeForLocation',
|
137
|
+
x: x,
|
138
|
+
y: y,
|
139
|
+
includeUserAgentShadowDOM: include_user_agent_shadow_dom,
|
140
|
+
ignorePointerEventsNone: ignore_pointer_events_none)
|
141
|
+
end
|
142
|
+
|
143
|
+
def get_outer_html(node_id: nil, backend_node_id: nil, object_id: nil)
|
144
|
+
@devtools.send_cmd('DOM.getOuterHTML',
|
145
|
+
nodeId: node_id,
|
146
|
+
backendNodeId: backend_node_id,
|
147
|
+
objectId: object_id)
|
148
|
+
end
|
149
|
+
|
150
|
+
def get_relayout_boundary(node_id:)
|
151
|
+
@devtools.send_cmd('DOM.getRelayoutBoundary',
|
152
|
+
nodeId: node_id)
|
153
|
+
end
|
154
|
+
|
155
|
+
def get_search_results(search_id:, from_index:, to_index:)
|
156
|
+
@devtools.send_cmd('DOM.getSearchResults',
|
157
|
+
searchId: search_id,
|
158
|
+
fromIndex: from_index,
|
159
|
+
toIndex: to_index)
|
160
|
+
end
|
161
|
+
|
162
|
+
def hide_highlight
|
163
|
+
@devtools.send_cmd('DOM.hideHighlight')
|
164
|
+
end
|
165
|
+
|
166
|
+
def highlight_node
|
167
|
+
@devtools.send_cmd('DOM.highlightNode')
|
168
|
+
end
|
169
|
+
|
170
|
+
def highlight_rect
|
171
|
+
@devtools.send_cmd('DOM.highlightRect')
|
172
|
+
end
|
173
|
+
|
174
|
+
def mark_undoable_state
|
175
|
+
@devtools.send_cmd('DOM.markUndoableState')
|
176
|
+
end
|
177
|
+
|
178
|
+
def move_to(node_id:, target_node_id:, insert_before_node_id: nil)
|
179
|
+
@devtools.send_cmd('DOM.moveTo',
|
180
|
+
nodeId: node_id,
|
181
|
+
targetNodeId: target_node_id,
|
182
|
+
insertBeforeNodeId: insert_before_node_id)
|
183
|
+
end
|
184
|
+
|
185
|
+
def perform_search(query:, include_user_agent_shadow_dom: nil)
|
186
|
+
@devtools.send_cmd('DOM.performSearch',
|
187
|
+
query: query,
|
188
|
+
includeUserAgentShadowDOM: include_user_agent_shadow_dom)
|
189
|
+
end
|
190
|
+
|
191
|
+
def push_node_by_path_to_frontend(path:)
|
192
|
+
@devtools.send_cmd('DOM.pushNodeByPathToFrontend',
|
193
|
+
path: path)
|
194
|
+
end
|
195
|
+
|
196
|
+
def push_nodes_by_backend_ids_to_frontend(backend_node_ids:)
|
197
|
+
@devtools.send_cmd('DOM.pushNodesByBackendIdsToFrontend',
|
198
|
+
backendNodeIds: backend_node_ids)
|
199
|
+
end
|
200
|
+
|
201
|
+
def query_selector(node_id:, selector:)
|
202
|
+
@devtools.send_cmd('DOM.querySelector',
|
203
|
+
nodeId: node_id,
|
204
|
+
selector: selector)
|
205
|
+
end
|
206
|
+
|
207
|
+
def query_selector_all(node_id:, selector:)
|
208
|
+
@devtools.send_cmd('DOM.querySelectorAll',
|
209
|
+
nodeId: node_id,
|
210
|
+
selector: selector)
|
211
|
+
end
|
212
|
+
|
213
|
+
def redo
|
214
|
+
@devtools.send_cmd('DOM.redo')
|
215
|
+
end
|
216
|
+
|
217
|
+
def remove_attribute(node_id:, name:)
|
218
|
+
@devtools.send_cmd('DOM.removeAttribute',
|
219
|
+
nodeId: node_id,
|
220
|
+
name: name)
|
221
|
+
end
|
222
|
+
|
223
|
+
def remove_node(node_id:)
|
224
|
+
@devtools.send_cmd('DOM.removeNode',
|
225
|
+
nodeId: node_id)
|
226
|
+
end
|
227
|
+
|
228
|
+
def request_child_nodes(node_id:, depth: nil, pierce: nil)
|
229
|
+
@devtools.send_cmd('DOM.requestChildNodes',
|
230
|
+
nodeId: node_id,
|
231
|
+
depth: depth,
|
232
|
+
pierce: pierce)
|
233
|
+
end
|
234
|
+
|
235
|
+
def request_node(object_id:)
|
236
|
+
@devtools.send_cmd('DOM.requestNode',
|
237
|
+
objectId: object_id)
|
238
|
+
end
|
239
|
+
|
240
|
+
def resolve_node(node_id: nil, backend_node_id: nil, object_group: nil, execution_context_id: nil)
|
241
|
+
@devtools.send_cmd('DOM.resolveNode',
|
242
|
+
nodeId: node_id,
|
243
|
+
backendNodeId: backend_node_id,
|
244
|
+
objectGroup: object_group,
|
245
|
+
executionContextId: execution_context_id)
|
246
|
+
end
|
247
|
+
|
248
|
+
def set_attribute_value(node_id:, name:, value:)
|
249
|
+
@devtools.send_cmd('DOM.setAttributeValue',
|
250
|
+
nodeId: node_id,
|
251
|
+
name: name,
|
252
|
+
value: value)
|
253
|
+
end
|
254
|
+
|
255
|
+
def set_attributes_as_text(node_id:, text:, name: nil)
|
256
|
+
@devtools.send_cmd('DOM.setAttributesAsText',
|
257
|
+
nodeId: node_id,
|
258
|
+
text: text,
|
259
|
+
name: name)
|
260
|
+
end
|
261
|
+
|
262
|
+
def set_file_input_files(files:, node_id: nil, backend_node_id: nil, object_id: nil)
|
263
|
+
@devtools.send_cmd('DOM.setFileInputFiles',
|
264
|
+
files: files,
|
265
|
+
nodeId: node_id,
|
266
|
+
backendNodeId: backend_node_id,
|
267
|
+
objectId: object_id)
|
268
|
+
end
|
269
|
+
|
270
|
+
def set_node_stack_traces_enabled(enable:)
|
271
|
+
@devtools.send_cmd('DOM.setNodeStackTracesEnabled',
|
272
|
+
enable: enable)
|
273
|
+
end
|
274
|
+
|
275
|
+
def get_node_stack_traces(node_id:)
|
276
|
+
@devtools.send_cmd('DOM.getNodeStackTraces',
|
277
|
+
nodeId: node_id)
|
278
|
+
end
|
279
|
+
|
280
|
+
def get_file_info(object_id:)
|
281
|
+
@devtools.send_cmd('DOM.getFileInfo',
|
282
|
+
objectId: object_id)
|
283
|
+
end
|
284
|
+
|
285
|
+
def set_inspected_node(node_id:)
|
286
|
+
@devtools.send_cmd('DOM.setInspectedNode',
|
287
|
+
nodeId: node_id)
|
288
|
+
end
|
289
|
+
|
290
|
+
def set_node_name(node_id:, name:)
|
291
|
+
@devtools.send_cmd('DOM.setNodeName',
|
292
|
+
nodeId: node_id,
|
293
|
+
name: name)
|
294
|
+
end
|
295
|
+
|
296
|
+
def set_node_value(node_id:, value:)
|
297
|
+
@devtools.send_cmd('DOM.setNodeValue',
|
298
|
+
nodeId: node_id,
|
299
|
+
value: value)
|
300
|
+
end
|
301
|
+
|
302
|
+
def set_outer_html(node_id:, outer_html:)
|
303
|
+
@devtools.send_cmd('DOM.setOuterHTML',
|
304
|
+
nodeId: node_id,
|
305
|
+
outerHTML: outer_html)
|
306
|
+
end
|
307
|
+
|
308
|
+
def undo
|
309
|
+
@devtools.send_cmd('DOM.undo')
|
310
|
+
end
|
311
|
+
|
312
|
+
def get_frame_owner(frame_id:)
|
313
|
+
@devtools.send_cmd('DOM.getFrameOwner',
|
314
|
+
frameId: frame_id)
|
315
|
+
end
|
316
|
+
|
317
|
+
end # DOM
|
318
|
+
end # DevTools
|
319
|
+
end # WebDriver
|
320
|
+
end # Selenium
|
@@ -0,0 +1,93 @@
|
|
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
|
+
module Selenium
|
22
|
+
module WebDriver
|
23
|
+
class DevTools
|
24
|
+
def domdebugger
|
25
|
+
@domdebugger ||= DOMDebugger.new(self)
|
26
|
+
end
|
27
|
+
|
28
|
+
class DOMDebugger
|
29
|
+
|
30
|
+
def initialize(devtools)
|
31
|
+
@devtools = devtools
|
32
|
+
end
|
33
|
+
|
34
|
+
def on(event, &block)
|
35
|
+
event = EVENTS[event] if event.is_a?(Symbol)
|
36
|
+
@devtools.callbacks["DOMDebugger.#{event}"] << block
|
37
|
+
end
|
38
|
+
|
39
|
+
def get_event_listeners(object_id:, depth: nil, pierce: nil)
|
40
|
+
@devtools.send_cmd('DOMDebugger.getEventListeners',
|
41
|
+
objectId: object_id,
|
42
|
+
depth: depth,
|
43
|
+
pierce: pierce)
|
44
|
+
end
|
45
|
+
|
46
|
+
def remove_dombreakpoint(node_id:, type:)
|
47
|
+
@devtools.send_cmd('DOMDebugger.removeDOMBreakpoint',
|
48
|
+
nodeId: node_id,
|
49
|
+
type: type)
|
50
|
+
end
|
51
|
+
|
52
|
+
def remove_event_listener_breakpoint(event_name:, target_name: nil)
|
53
|
+
@devtools.send_cmd('DOMDebugger.removeEventListenerBreakpoint',
|
54
|
+
eventName: event_name,
|
55
|
+
targetName: target_name)
|
56
|
+
end
|
57
|
+
|
58
|
+
def remove_instrumentation_breakpoint(event_name:)
|
59
|
+
@devtools.send_cmd('DOMDebugger.removeInstrumentationBreakpoint',
|
60
|
+
eventName: event_name)
|
61
|
+
end
|
62
|
+
|
63
|
+
def remove_xhrbreakpoint(url:)
|
64
|
+
@devtools.send_cmd('DOMDebugger.removeXHRBreakpoint',
|
65
|
+
url: url)
|
66
|
+
end
|
67
|
+
|
68
|
+
def set_dombreakpoint(node_id:, type:)
|
69
|
+
@devtools.send_cmd('DOMDebugger.setDOMBreakpoint',
|
70
|
+
nodeId: node_id,
|
71
|
+
type: type)
|
72
|
+
end
|
73
|
+
|
74
|
+
def set_event_listener_breakpoint(event_name:, target_name: nil)
|
75
|
+
@devtools.send_cmd('DOMDebugger.setEventListenerBreakpoint',
|
76
|
+
eventName: event_name,
|
77
|
+
targetName: target_name)
|
78
|
+
end
|
79
|
+
|
80
|
+
def set_instrumentation_breakpoint(event_name:)
|
81
|
+
@devtools.send_cmd('DOMDebugger.setInstrumentationBreakpoint',
|
82
|
+
eventName: event_name)
|
83
|
+
end
|
84
|
+
|
85
|
+
def set_xhrbreakpoint(url:)
|
86
|
+
@devtools.send_cmd('DOMDebugger.setXHRBreakpoint',
|
87
|
+
url: url)
|
88
|
+
end
|
89
|
+
|
90
|
+
end # DOMDebugger
|
91
|
+
end # DevTools
|
92
|
+
end # WebDriver
|
93
|
+
end # Selenium
|