selenium-webdriver 4.0.0.alpha1 → 4.0.0.alpha6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES +139 -1
  3. data/LICENSE +1 -1
  4. data/lib/selenium/server.rb +3 -3
  5. data/lib/selenium/webdriver.rb +11 -7
  6. data/lib/selenium/webdriver/atoms/findElements.js +122 -0
  7. data/lib/selenium/webdriver/atoms/getAttribute.js +84 -7
  8. data/lib/selenium/webdriver/atoms/isDisplayed.js +75 -77
  9. data/lib/selenium/webdriver/chrome.rb +10 -9
  10. data/lib/selenium/webdriver/chrome/bridge.rb +20 -4
  11. data/lib/selenium/webdriver/chrome/driver.rb +3 -52
  12. data/lib/selenium/webdriver/chrome/options.rb +97 -57
  13. data/lib/selenium/webdriver/chrome/profile.rb +2 -2
  14. data/lib/selenium/webdriver/chrome/service.rb +0 -4
  15. data/lib/selenium/webdriver/common.rb +3 -0
  16. data/lib/selenium/webdriver/common/driver.rb +76 -17
  17. data/lib/selenium/webdriver/common/driver_extensions/{has_touch_screen.rb → has_devtools.rb} +10 -8
  18. data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +2 -1
  19. data/lib/selenium/webdriver/common/logger.rb +48 -16
  20. data/lib/selenium/webdriver/common/manager.rb +5 -0
  21. data/lib/selenium/webdriver/common/options.rb +60 -121
  22. data/lib/selenium/webdriver/common/platform.rb +3 -0
  23. data/lib/selenium/webdriver/common/port_prober.rb +4 -6
  24. data/lib/selenium/webdriver/common/profile_helper.rb +10 -2
  25. data/lib/selenium/webdriver/common/proxy.rb +0 -0
  26. data/lib/selenium/webdriver/common/search_context.rb +3 -2
  27. data/lib/selenium/webdriver/common/service.rb +30 -113
  28. data/lib/selenium/webdriver/common/service_manager.rb +151 -0
  29. data/lib/selenium/webdriver/common/socket_lock.rb +2 -2
  30. data/lib/selenium/webdriver/common/wait.rb +1 -1
  31. data/lib/selenium/webdriver/devtools.rb +118 -0
  32. data/lib/selenium/webdriver/devtools/accessibility.rb +62 -0
  33. data/lib/selenium/webdriver/devtools/animation.rb +98 -0
  34. data/lib/selenium/webdriver/devtools/application_cache.rb +64 -0
  35. data/lib/selenium/webdriver/devtools/audits.rb +61 -0
  36. data/lib/selenium/webdriver/devtools/background_service.rb +67 -0
  37. data/lib/selenium/webdriver/devtools/browser.rb +123 -0
  38. data/lib/selenium/webdriver/devtools/cache_storage.rb +73 -0
  39. data/lib/selenium/webdriver/devtools/cast.rb +70 -0
  40. data/lib/selenium/webdriver/devtools/console.rb +57 -0
  41. data/lib/selenium/webdriver/devtools/css.rb +165 -0
  42. data/lib/selenium/webdriver/devtools/database.rb +64 -0
  43. data/lib/selenium/webdriver/devtools/debugger.rb +229 -0
  44. data/lib/selenium/webdriver/devtools/device_orientation.rb +53 -0
  45. data/lib/selenium/webdriver/devtools/dom.rb +320 -0
  46. data/lib/selenium/webdriver/devtools/domdebugger.rb +93 -0
  47. data/lib/selenium/webdriver/devtools/domsnapshot.rb +65 -0
  48. data/lib/selenium/webdriver/devtools/domstorage.rb +79 -0
  49. data/lib/selenium/webdriver/devtools/emulation.rb +180 -0
  50. data/lib/selenium/webdriver/devtools/fetch.rb +97 -0
  51. data/lib/selenium/webdriver/devtools/headless_experimental.rb +61 -0
  52. data/lib/selenium/webdriver/devtools/heap_profiler.rb +107 -0
  53. data/lib/selenium/webdriver/devtools/indexed_db.rb +100 -0
  54. data/lib/selenium/webdriver/devtools/input.rb +140 -0
  55. data/lib/selenium/webdriver/devtools/inspector.rb +55 -0
  56. data/lib/selenium/webdriver/devtools/io.rb +59 -0
  57. data/lib/selenium/webdriver/devtools/layer_tree.rb +95 -0
  58. data/lib/selenium/webdriver/devtools/log.rb +66 -0
  59. data/lib/selenium/webdriver/devtools/media.rb +57 -0
  60. data/lib/selenium/webdriver/devtools/memory.rb +86 -0
  61. data/lib/selenium/webdriver/devtools/network.rb +228 -0
  62. data/lib/selenium/webdriver/devtools/overlay.rb +157 -0
  63. data/lib/selenium/webdriver/devtools/page.rb +374 -0
  64. data/lib/selenium/webdriver/devtools/performance.rb +63 -0
  65. data/lib/selenium/webdriver/devtools/profiler.rb +111 -0
  66. data/lib/selenium/webdriver/devtools/runtime.rb +193 -0
  67. data/lib/selenium/webdriver/devtools/schema.rb +46 -0
  68. data/lib/selenium/webdriver/devtools/security.rb +71 -0
  69. data/lib/selenium/webdriver/devtools/service_worker.rb +116 -0
  70. data/lib/selenium/webdriver/devtools/storage.rb +95 -0
  71. data/lib/selenium/webdriver/devtools/system_info.rb +50 -0
  72. data/lib/selenium/webdriver/devtools/target.rb +141 -0
  73. data/lib/selenium/webdriver/devtools/tethering.rb +55 -0
  74. data/lib/selenium/webdriver/devtools/tracing.rb +76 -0
  75. data/lib/selenium/webdriver/devtools/web_audio.rb +70 -0
  76. data/lib/selenium/webdriver/devtools/web_authn.rb +94 -0
  77. data/lib/selenium/webdriver/edge.rb +29 -9
  78. data/lib/selenium/webdriver/{firefox/util.rb → edge_chrome/bridge.rb} +11 -20
  79. data/lib/selenium/webdriver/{common/w3c_options.rb → edge_chrome/driver.rb} +14 -17
  80. data/lib/selenium/webdriver/edge_chrome/options.rb +36 -0
  81. data/lib/selenium/webdriver/edge_chrome/profile.rb +33 -0
  82. data/lib/selenium/webdriver/edge_chrome/service.rb +36 -0
  83. data/lib/selenium/webdriver/{common/w3c_manager.rb → edge_html/driver.rb} +11 -17
  84. data/lib/selenium/webdriver/{edge → edge_html}/options.rb +26 -22
  85. data/lib/selenium/webdriver/{edge → edge_html}/service.rb +2 -6
  86. data/lib/selenium/webdriver/firefox.rb +18 -15
  87. data/lib/selenium/webdriver/firefox/bridge.rb +1 -1
  88. data/lib/selenium/webdriver/firefox/driver.rb +2 -30
  89. data/lib/selenium/webdriver/firefox/extension.rb +8 -0
  90. data/lib/selenium/webdriver/firefox/options.rb +47 -52
  91. data/lib/selenium/webdriver/firefox/profile.rb +7 -78
  92. data/lib/selenium/webdriver/firefox/service.rb +0 -4
  93. data/lib/selenium/webdriver/ie.rb +8 -7
  94. data/lib/selenium/webdriver/ie/driver.rb +0 -32
  95. data/lib/selenium/webdriver/ie/options.rb +10 -33
  96. data/lib/selenium/webdriver/ie/service.rb +5 -9
  97. data/lib/selenium/webdriver/remote.rb +16 -10
  98. data/lib/selenium/webdriver/remote/bridge.rb +34 -42
  99. data/lib/selenium/webdriver/remote/capabilities.rb +22 -6
  100. data/lib/selenium/webdriver/remote/driver.rb +6 -12
  101. data/lib/selenium/webdriver/remote/http/default.rb +9 -4
  102. data/lib/selenium/webdriver/remote/http/persistent.rb +5 -6
  103. data/lib/selenium/webdriver/safari.rb +9 -8
  104. data/lib/selenium/webdriver/safari/bridge.rb +4 -4
  105. data/lib/selenium/webdriver/safari/driver.rb +3 -29
  106. data/lib/selenium/webdriver/safari/options.rb +18 -19
  107. data/lib/selenium/webdriver/safari/service.rb +0 -4
  108. data/lib/selenium/webdriver/support.rb +1 -0
  109. data/lib/selenium/webdriver/support/cdp_client_generator.rb +77 -0
  110. data/lib/selenium/webdriver/support/color.rb +2 -2
  111. data/lib/selenium/webdriver/support/event_firing_bridge.rb +1 -1
  112. data/lib/selenium/webdriver/support/relative_locator.rb +51 -0
  113. data/lib/selenium/webdriver/version.rb +1 -1
  114. data/selenium-webdriver.gemspec +5 -4
  115. metadata +81 -42
  116. data/lib/selenium/webdriver/common/bridge_helper.rb +0 -82
  117. data/lib/selenium/webdriver/common/keyboard.rb +0 -70
  118. data/lib/selenium/webdriver/common/mouse.rb +0 -89
  119. data/lib/selenium/webdriver/common/touch_action_builder.rb +0 -78
  120. data/lib/selenium/webdriver/common/touch_screen.rb +0 -123
  121. data/lib/selenium/webdriver/common/w3c_action_builder.rb +0 -212
  122. data/lib/selenium/webdriver/edge/bridge.rb +0 -76
  123. data/lib/selenium/webdriver/edge/driver.rb +0 -70
  124. data/lib/selenium/webdriver/firefox/binary.rb +0 -110
  125. data/lib/selenium/webdriver/firefox/extension/prefs.json +0 -69
  126. data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
  127. data/lib/selenium/webdriver/firefox/launcher.rb +0 -111
  128. data/lib/selenium/webdriver/firefox/legacy/driver.rb +0 -83
  129. data/lib/selenium/webdriver/firefox/marionette/bridge.rb +0 -49
  130. data/lib/selenium/webdriver/firefox/marionette/driver.rb +0 -90
  131. data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
  132. data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
  133. data/lib/selenium/webdriver/remote/oss/bridge.rb +0 -594
  134. data/lib/selenium/webdriver/remote/oss/commands.rb +0 -223
  135. data/lib/selenium/webdriver/remote/w3c/bridge.rb +0 -605
  136. data/lib/selenium/webdriver/remote/w3c/capabilities.rb +0 -310
  137. data/lib/selenium/webdriver/remote/w3c/commands.rb +0 -157
@@ -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