selenium-devtools 0.98.0 → 0.100.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/lib/selenium/devtools/v100/accessibility.rb +92 -0
  3. data/lib/selenium/devtools/v100/animation.rb +94 -0
  4. data/lib/selenium/devtools/v100/audits.rb +62 -0
  5. data/lib/selenium/devtools/v100/background_service.rb +63 -0
  6. data/lib/selenium/devtools/v100/browser.rb +135 -0
  7. data/lib/selenium/devtools/v100/cache_storage.rb +69 -0
  8. data/lib/selenium/devtools/v100/cast.rb +71 -0
  9. data/lib/selenium/devtools/v100/console.rb +53 -0
  10. data/lib/selenium/devtools/v100/css.rb +189 -0
  11. data/lib/selenium/devtools/v100/database.rb +60 -0
  12. data/lib/selenium/devtools/v100/debugger.rb +220 -0
  13. data/lib/selenium/devtools/v100/device_orientation.rb +49 -0
  14. data/lib/selenium/devtools/v100/dom.rb +335 -0
  15. data/lib/selenium/devtools/v100/dom_debugger.rb +94 -0
  16. data/lib/selenium/devtools/v100/dom_snapshot.rb +63 -0
  17. data/lib/selenium/devtools/v100/dom_storage.rb +75 -0
  18. data/lib/selenium/devtools/v100/emulation.rb +196 -0
  19. data/lib/selenium/devtools/v100/event_breakpoints.rb +48 -0
  20. data/lib/selenium/devtools/v100/fetch.rb +103 -0
  21. data/lib/selenium/devtools/v100/headless_experimental.rb +57 -0
  22. data/lib/selenium/devtools/v100/heap_profiler.rb +105 -0
  23. data/lib/selenium/devtools/v100/indexed_db.rb +96 -0
  24. data/lib/selenium/devtools/v100/input.rb +168 -0
  25. data/lib/selenium/devtools/v100/inspector.rb +51 -0
  26. data/lib/selenium/devtools/v100/io.rb +55 -0
  27. data/lib/selenium/devtools/v100/layer_tree.rb +91 -0
  28. data/lib/selenium/devtools/v100/log.rb +62 -0
  29. data/lib/selenium/devtools/v100/media.rb +53 -0
  30. data/lib/selenium/devtools/v100/memory.rb +82 -0
  31. data/lib/selenium/devtools/v100/network.rb +264 -0
  32. data/lib/selenium/devtools/v100/overlay.rb +202 -0
  33. data/lib/selenium/devtools/v100/page.rb +394 -0
  34. data/lib/selenium/devtools/v100/performance.rb +59 -0
  35. data/lib/selenium/devtools/v100/performance_timeline.rb +46 -0
  36. data/lib/selenium/devtools/v100/profiler.rb +95 -0
  37. data/lib/selenium/devtools/v100/runtime.rb +199 -0
  38. data/lib/selenium/devtools/v100/schema.rb +42 -0
  39. data/lib/selenium/devtools/v100/security.rb +67 -0
  40. data/lib/selenium/devtools/v100/service_worker.rb +112 -0
  41. data/lib/selenium/devtools/v100/storage.rb +118 -0
  42. data/lib/selenium/devtools/v100/system_info.rb +46 -0
  43. data/lib/selenium/devtools/v100/target.rb +146 -0
  44. data/lib/selenium/devtools/v100/tethering.rb +51 -0
  45. data/lib/selenium/devtools/v100/tracing.rb +75 -0
  46. data/lib/selenium/devtools/v100/web_audio.rb +66 -0
  47. data/lib/selenium/devtools/v100/web_authn.rb +96 -0
  48. data/lib/selenium/devtools/v100.rb +1 -0
  49. data/lib/selenium/devtools/v99/accessibility.rb +92 -0
  50. data/lib/selenium/devtools/v99/animation.rb +94 -0
  51. data/lib/selenium/devtools/v99/audits.rb +62 -0
  52. data/lib/selenium/devtools/v99/background_service.rb +63 -0
  53. data/lib/selenium/devtools/v99/browser.rb +135 -0
  54. data/lib/selenium/devtools/v99/cache_storage.rb +69 -0
  55. data/lib/selenium/devtools/v99/cast.rb +71 -0
  56. data/lib/selenium/devtools/v99/console.rb +53 -0
  57. data/lib/selenium/devtools/v99/css.rb +182 -0
  58. data/lib/selenium/devtools/v99/database.rb +60 -0
  59. data/lib/selenium/devtools/v99/debugger.rb +220 -0
  60. data/lib/selenium/devtools/v99/device_orientation.rb +49 -0
  61. data/lib/selenium/devtools/v99/dom.rb +334 -0
  62. data/lib/selenium/devtools/v99/dom_debugger.rb +94 -0
  63. data/lib/selenium/devtools/v99/dom_snapshot.rb +63 -0
  64. data/lib/selenium/devtools/v99/dom_storage.rb +75 -0
  65. data/lib/selenium/devtools/v99/emulation.rb +197 -0
  66. data/lib/selenium/devtools/v99/event_breakpoints.rb +48 -0
  67. data/lib/selenium/devtools/v99/fetch.rb +103 -0
  68. data/lib/selenium/devtools/v99/headless_experimental.rb +57 -0
  69. data/lib/selenium/devtools/v99/heap_profiler.rb +105 -0
  70. data/lib/selenium/devtools/v99/indexed_db.rb +96 -0
  71. data/lib/selenium/devtools/v99/input.rb +168 -0
  72. data/lib/selenium/devtools/v99/inspector.rb +51 -0
  73. data/lib/selenium/devtools/v99/io.rb +55 -0
  74. data/lib/selenium/devtools/v99/layer_tree.rb +91 -0
  75. data/lib/selenium/devtools/v99/log.rb +62 -0
  76. data/lib/selenium/devtools/v99/media.rb +53 -0
  77. data/lib/selenium/devtools/v99/memory.rb +82 -0
  78. data/lib/selenium/devtools/v99/network.rb +264 -0
  79. data/lib/selenium/devtools/v99/overlay.rb +202 -0
  80. data/lib/selenium/devtools/v99/page.rb +394 -0
  81. data/lib/selenium/devtools/v99/performance.rb +59 -0
  82. data/lib/selenium/devtools/v99/performance_timeline.rb +46 -0
  83. data/lib/selenium/devtools/v99/profiler.rb +95 -0
  84. data/lib/selenium/devtools/v99/runtime.rb +199 -0
  85. data/lib/selenium/devtools/v99/schema.rb +42 -0
  86. data/lib/selenium/devtools/v99/security.rb +67 -0
  87. data/lib/selenium/devtools/v99/service_worker.rb +112 -0
  88. data/lib/selenium/devtools/v99/storage.rb +118 -0
  89. data/lib/selenium/devtools/v99/system_info.rb +46 -0
  90. data/lib/selenium/devtools/v99/target.rb +146 -0
  91. data/lib/selenium/devtools/v99/tethering.rb +51 -0
  92. data/lib/selenium/devtools/v99/tracing.rb +75 -0
  93. data/lib/selenium/devtools/v99/web_audio.rb +66 -0
  94. data/lib/selenium/devtools/v99/web_authn.rb +96 -0
  95. data/lib/selenium/devtools/v99.rb +1 -0
  96. data/lib/selenium/devtools/version.rb +1 -1
  97. metadata +96 -2
@@ -0,0 +1,394 @@
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 DevTools
23
+ module V100
24
+ class Page
25
+ EVENTS = {
26
+ dom_content_event_fired: 'domContentEventFired',
27
+ file_chooser_opened: 'fileChooserOpened',
28
+ frame_attached: 'frameAttached',
29
+ frame_cleared_scheduled_navigation: 'frameClearedScheduledNavigation',
30
+ frame_detached: 'frameDetached',
31
+ frame_navigated: 'frameNavigated',
32
+ document_opened: 'documentOpened',
33
+ frame_resized: 'frameResized',
34
+ frame_requested_navigation: 'frameRequestedNavigation',
35
+ frame_scheduled_navigation: 'frameScheduledNavigation',
36
+ frame_started_loading: 'frameStartedLoading',
37
+ frame_stopped_loading: 'frameStoppedLoading',
38
+ download_will_begin: 'downloadWillBegin',
39
+ download_progress: 'downloadProgress',
40
+ interstitial_hidden: 'interstitialHidden',
41
+ interstitial_shown: 'interstitialShown',
42
+ javascript_dialog_closed: 'javascriptDialogClosed',
43
+ javascript_dialog_opening: 'javascriptDialogOpening',
44
+ lifecycle_event: 'lifecycleEvent',
45
+ back_forward_cache_not_used: 'backForwardCacheNotUsed',
46
+ load_event_fired: 'loadEventFired',
47
+ navigated_within_document: 'navigatedWithinDocument',
48
+ screencast_frame: 'screencastFrame',
49
+ screencast_visibility_changed: 'screencastVisibilityChanged',
50
+ window_open: 'windowOpen',
51
+ compilation_cache_produced: 'compilationCacheProduced',
52
+ }.freeze
53
+
54
+ def initialize(devtools)
55
+ @devtools = devtools
56
+ end
57
+
58
+ def on(event, &block)
59
+ event = EVENTS[event] if event.is_a?(Symbol)
60
+ @devtools.callbacks["Page.#{event}"] << block
61
+ end
62
+
63
+ def add_script_to_evaluate_on_load(script_source:)
64
+ @devtools.send_cmd('Page.addScriptToEvaluateOnLoad',
65
+ scriptSource: script_source)
66
+ end
67
+
68
+ def add_script_to_evaluate_on_new_document(source:, world_name: nil, include_command_line_api: nil)
69
+ @devtools.send_cmd('Page.addScriptToEvaluateOnNewDocument',
70
+ source: source,
71
+ worldName: world_name,
72
+ includeCommandLineAPI: include_command_line_api)
73
+ end
74
+
75
+ def bring_to_front
76
+ @devtools.send_cmd('Page.bringToFront')
77
+ end
78
+
79
+ def capture_screenshot(format: nil, quality: nil, clip: nil, from_surface: nil, capture_beyond_viewport: nil)
80
+ @devtools.send_cmd('Page.captureScreenshot',
81
+ format: format,
82
+ quality: quality,
83
+ clip: clip,
84
+ fromSurface: from_surface,
85
+ captureBeyondViewport: capture_beyond_viewport)
86
+ end
87
+
88
+ def capture_snapshot(format: nil)
89
+ @devtools.send_cmd('Page.captureSnapshot',
90
+ format: format)
91
+ end
92
+
93
+ def clear_device_metrics_override
94
+ @devtools.send_cmd('Page.clearDeviceMetricsOverride')
95
+ end
96
+
97
+ def clear_device_orientation_override
98
+ @devtools.send_cmd('Page.clearDeviceOrientationOverride')
99
+ end
100
+
101
+ def clear_geolocation_override
102
+ @devtools.send_cmd('Page.clearGeolocationOverride')
103
+ end
104
+
105
+ def create_isolated_world(frame_id:, world_name: nil, grant_univeral_access: nil)
106
+ @devtools.send_cmd('Page.createIsolatedWorld',
107
+ frameId: frame_id,
108
+ worldName: world_name,
109
+ grantUniveralAccess: grant_univeral_access)
110
+ end
111
+
112
+ def delete_cookie(cookie_name:, url:)
113
+ @devtools.send_cmd('Page.deleteCookie',
114
+ cookieName: cookie_name,
115
+ url: url)
116
+ end
117
+
118
+ def disable
119
+ @devtools.send_cmd('Page.disable')
120
+ end
121
+
122
+ def enable
123
+ @devtools.send_cmd('Page.enable')
124
+ end
125
+
126
+ def get_app_manifest
127
+ @devtools.send_cmd('Page.getAppManifest')
128
+ end
129
+
130
+ def get_installability_errors
131
+ @devtools.send_cmd('Page.getInstallabilityErrors')
132
+ end
133
+
134
+ def get_manifest_icons
135
+ @devtools.send_cmd('Page.getManifestIcons')
136
+ end
137
+
138
+ def get_app_id
139
+ @devtools.send_cmd('Page.getAppId')
140
+ end
141
+
142
+ def get_cookies
143
+ @devtools.send_cmd('Page.getCookies')
144
+ end
145
+
146
+ def get_frame_tree
147
+ @devtools.send_cmd('Page.getFrameTree')
148
+ end
149
+
150
+ def get_layout_metrics
151
+ @devtools.send_cmd('Page.getLayoutMetrics')
152
+ end
153
+
154
+ def get_navigation_history
155
+ @devtools.send_cmd('Page.getNavigationHistory')
156
+ end
157
+
158
+ def reset_navigation_history
159
+ @devtools.send_cmd('Page.resetNavigationHistory')
160
+ end
161
+
162
+ def get_resource_content(frame_id:, url:)
163
+ @devtools.send_cmd('Page.getResourceContent',
164
+ frameId: frame_id,
165
+ url: url)
166
+ end
167
+
168
+ def get_resource_tree
169
+ @devtools.send_cmd('Page.getResourceTree')
170
+ end
171
+
172
+ def handle_javascript_dialog(accept:, prompt_text: nil)
173
+ @devtools.send_cmd('Page.handleJavaScriptDialog',
174
+ accept: accept,
175
+ promptText: prompt_text)
176
+ end
177
+
178
+ def navigate(url:, referrer: nil, transition_type: nil, frame_id: nil, referrer_policy: nil)
179
+ @devtools.send_cmd('Page.navigate',
180
+ url: url,
181
+ referrer: referrer,
182
+ transitionType: transition_type,
183
+ frameId: frame_id,
184
+ referrerPolicy: referrer_policy)
185
+ end
186
+
187
+ def navigate_to_history_entry(entry_id:)
188
+ @devtools.send_cmd('Page.navigateToHistoryEntry',
189
+ entryId: entry_id)
190
+ end
191
+
192
+ def print_to_pdf(landscape: nil, display_header_footer: nil, print_background: nil, scale: nil, paper_width: nil, paper_height: nil, margin_top: nil, margin_bottom: nil, margin_left: nil, margin_right: nil, page_ranges: nil, ignore_invalid_page_ranges: nil, header_template: nil, footer_template: nil, prefer_css_page_size: nil, transfer_mode: nil)
193
+ @devtools.send_cmd('Page.printToPDF',
194
+ landscape: landscape,
195
+ displayHeaderFooter: display_header_footer,
196
+ printBackground: print_background,
197
+ scale: scale,
198
+ paperWidth: paper_width,
199
+ paperHeight: paper_height,
200
+ marginTop: margin_top,
201
+ marginBottom: margin_bottom,
202
+ marginLeft: margin_left,
203
+ marginRight: margin_right,
204
+ pageRanges: page_ranges,
205
+ ignoreInvalidPageRanges: ignore_invalid_page_ranges,
206
+ headerTemplate: header_template,
207
+ footerTemplate: footer_template,
208
+ preferCSSPageSize: prefer_css_page_size,
209
+ transferMode: transfer_mode)
210
+ end
211
+
212
+ def reload(ignore_cache: nil, script_to_evaluate_on_load: nil)
213
+ @devtools.send_cmd('Page.reload',
214
+ ignoreCache: ignore_cache,
215
+ scriptToEvaluateOnLoad: script_to_evaluate_on_load)
216
+ end
217
+
218
+ def remove_script_to_evaluate_on_load(identifier:)
219
+ @devtools.send_cmd('Page.removeScriptToEvaluateOnLoad',
220
+ identifier: identifier)
221
+ end
222
+
223
+ def remove_script_to_evaluate_on_new_document(identifier:)
224
+ @devtools.send_cmd('Page.removeScriptToEvaluateOnNewDocument',
225
+ identifier: identifier)
226
+ end
227
+
228
+ def screencast_frame_ack(session_id:)
229
+ @devtools.send_cmd('Page.screencastFrameAck',
230
+ sessionId: session_id)
231
+ end
232
+
233
+ def search_in_resource(frame_id:, url:, query:, case_sensitive: nil, is_regex: nil)
234
+ @devtools.send_cmd('Page.searchInResource',
235
+ frameId: frame_id,
236
+ url: url,
237
+ query: query,
238
+ caseSensitive: case_sensitive,
239
+ isRegex: is_regex)
240
+ end
241
+
242
+ def set_ad_blocking_enabled(enabled:)
243
+ @devtools.send_cmd('Page.setAdBlockingEnabled',
244
+ enabled: enabled)
245
+ end
246
+
247
+ def set_bypass_csp(enabled:)
248
+ @devtools.send_cmd('Page.setBypassCSP',
249
+ enabled: enabled)
250
+ end
251
+
252
+ def get_permissions_policy_state(frame_id:)
253
+ @devtools.send_cmd('Page.getPermissionsPolicyState',
254
+ frameId: frame_id)
255
+ end
256
+
257
+ def get_origin_trials(frame_id:)
258
+ @devtools.send_cmd('Page.getOriginTrials',
259
+ frameId: frame_id)
260
+ end
261
+
262
+ def set_device_metrics_override(width:, height:, device_scale_factor:, mobile:, scale: nil, screen_width: nil, screen_height: nil, position_x: nil, position_y: nil, dont_set_visible_size: nil, screen_orientation: nil, viewport: nil)
263
+ @devtools.send_cmd('Page.setDeviceMetricsOverride',
264
+ width: width,
265
+ height: height,
266
+ deviceScaleFactor: device_scale_factor,
267
+ mobile: mobile,
268
+ scale: scale,
269
+ screenWidth: screen_width,
270
+ screenHeight: screen_height,
271
+ positionX: position_x,
272
+ positionY: position_y,
273
+ dontSetVisibleSize: dont_set_visible_size,
274
+ screenOrientation: screen_orientation,
275
+ viewport: viewport)
276
+ end
277
+
278
+ def set_device_orientation_override(alpha:, beta:, gamma:)
279
+ @devtools.send_cmd('Page.setDeviceOrientationOverride',
280
+ alpha: alpha,
281
+ beta: beta,
282
+ gamma: gamma)
283
+ end
284
+
285
+ def set_font_families(font_families:, for_scripts: nil)
286
+ @devtools.send_cmd('Page.setFontFamilies',
287
+ fontFamilies: font_families,
288
+ forScripts: for_scripts)
289
+ end
290
+
291
+ def set_font_sizes(font_sizes:)
292
+ @devtools.send_cmd('Page.setFontSizes',
293
+ fontSizes: font_sizes)
294
+ end
295
+
296
+ def set_document_content(frame_id:, html:)
297
+ @devtools.send_cmd('Page.setDocumentContent',
298
+ frameId: frame_id,
299
+ html: html)
300
+ end
301
+
302
+ def set_download_behavior(behavior:, download_path: nil)
303
+ @devtools.send_cmd('Page.setDownloadBehavior',
304
+ behavior: behavior,
305
+ downloadPath: download_path)
306
+ end
307
+
308
+ def set_geolocation_override(latitude: nil, longitude: nil, accuracy: nil)
309
+ @devtools.send_cmd('Page.setGeolocationOverride',
310
+ latitude: latitude,
311
+ longitude: longitude,
312
+ accuracy: accuracy)
313
+ end
314
+
315
+ def set_lifecycle_events_enabled(enabled:)
316
+ @devtools.send_cmd('Page.setLifecycleEventsEnabled',
317
+ enabled: enabled)
318
+ end
319
+
320
+ def set_touch_emulation_enabled(enabled:, configuration: nil)
321
+ @devtools.send_cmd('Page.setTouchEmulationEnabled',
322
+ enabled: enabled,
323
+ configuration: configuration)
324
+ end
325
+
326
+ def start_screencast(format: nil, quality: nil, max_width: nil, max_height: nil, every_nth_frame: nil)
327
+ @devtools.send_cmd('Page.startScreencast',
328
+ format: format,
329
+ quality: quality,
330
+ maxWidth: max_width,
331
+ maxHeight: max_height,
332
+ everyNthFrame: every_nth_frame)
333
+ end
334
+
335
+ def stop_loading
336
+ @devtools.send_cmd('Page.stopLoading')
337
+ end
338
+
339
+ def crash
340
+ @devtools.send_cmd('Page.crash')
341
+ end
342
+
343
+ def close
344
+ @devtools.send_cmd('Page.close')
345
+ end
346
+
347
+ def set_web_lifecycle_state(state:)
348
+ @devtools.send_cmd('Page.setWebLifecycleState',
349
+ state: state)
350
+ end
351
+
352
+ def stop_screencast
353
+ @devtools.send_cmd('Page.stopScreencast')
354
+ end
355
+
356
+ def produce_compilation_cache(scripts:)
357
+ @devtools.send_cmd('Page.produceCompilationCache',
358
+ scripts: scripts)
359
+ end
360
+
361
+ def add_compilation_cache(url:, data:)
362
+ @devtools.send_cmd('Page.addCompilationCache',
363
+ url: url,
364
+ data: data)
365
+ end
366
+
367
+ def clear_compilation_cache
368
+ @devtools.send_cmd('Page.clearCompilationCache')
369
+ end
370
+
371
+ def set_spc_transaction_mode(mode:)
372
+ @devtools.send_cmd('Page.setSPCTransactionMode',
373
+ mode: mode)
374
+ end
375
+
376
+ def generate_test_report(message:, group: nil)
377
+ @devtools.send_cmd('Page.generateTestReport',
378
+ message: message,
379
+ group: group)
380
+ end
381
+
382
+ def wait_for_debugger
383
+ @devtools.send_cmd('Page.waitForDebugger')
384
+ end
385
+
386
+ def set_intercept_file_chooser_dialog(enabled:)
387
+ @devtools.send_cmd('Page.setInterceptFileChooserDialog',
388
+ enabled: enabled)
389
+ end
390
+
391
+ end # Page
392
+ end # V100
393
+ end # DevTools
394
+ end # Selenium
@@ -0,0 +1,59 @@
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 DevTools
23
+ module V100
24
+ class Performance
25
+ EVENTS = {
26
+ metrics: 'metrics',
27
+ }.freeze
28
+
29
+ def initialize(devtools)
30
+ @devtools = devtools
31
+ end
32
+
33
+ def on(event, &block)
34
+ event = EVENTS[event] if event.is_a?(Symbol)
35
+ @devtools.callbacks["Performance.#{event}"] << block
36
+ end
37
+
38
+ def disable
39
+ @devtools.send_cmd('Performance.disable')
40
+ end
41
+
42
+ def enable(time_domain: nil)
43
+ @devtools.send_cmd('Performance.enable',
44
+ timeDomain: time_domain)
45
+ end
46
+
47
+ def set_time_domain(time_domain:)
48
+ @devtools.send_cmd('Performance.setTimeDomain',
49
+ timeDomain: time_domain)
50
+ end
51
+
52
+ def get_metrics
53
+ @devtools.send_cmd('Performance.getMetrics')
54
+ end
55
+
56
+ end # Performance
57
+ end # V100
58
+ end # DevTools
59
+ end # Selenium
@@ -0,0 +1,46 @@
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 DevTools
23
+ module V100
24
+ class PerformanceTimeline
25
+ EVENTS = {
26
+ timeline_event_added: 'timelineEventAdded',
27
+ }.freeze
28
+
29
+ def initialize(devtools)
30
+ @devtools = devtools
31
+ end
32
+
33
+ def on(event, &block)
34
+ event = EVENTS[event] if event.is_a?(Symbol)
35
+ @devtools.callbacks["PerformanceTimeline.#{event}"] << block
36
+ end
37
+
38
+ def enable(event_types:)
39
+ @devtools.send_cmd('PerformanceTimeline.enable',
40
+ eventTypes: event_types)
41
+ end
42
+
43
+ end # PerformanceTimeline
44
+ end # V100
45
+ end # DevTools
46
+ end # Selenium
@@ -0,0 +1,95 @@
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 DevTools
23
+ module V100
24
+ class Profiler
25
+ EVENTS = {
26
+ console_profile_finished: 'consoleProfileFinished',
27
+ console_profile_started: 'consoleProfileStarted',
28
+ precise_coverage_delta_update: 'preciseCoverageDeltaUpdate',
29
+ }.freeze
30
+
31
+ def initialize(devtools)
32
+ @devtools = devtools
33
+ end
34
+
35
+ def on(event, &block)
36
+ event = EVENTS[event] if event.is_a?(Symbol)
37
+ @devtools.callbacks["Profiler.#{event}"] << block
38
+ end
39
+
40
+ def disable
41
+ @devtools.send_cmd('Profiler.disable')
42
+ end
43
+
44
+ def enable
45
+ @devtools.send_cmd('Profiler.enable')
46
+ end
47
+
48
+ def get_best_effort_coverage
49
+ @devtools.send_cmd('Profiler.getBestEffortCoverage')
50
+ end
51
+
52
+ def set_sampling_interval(interval:)
53
+ @devtools.send_cmd('Profiler.setSamplingInterval',
54
+ interval: interval)
55
+ end
56
+
57
+ def start
58
+ @devtools.send_cmd('Profiler.start')
59
+ end
60
+
61
+ def start_precise_coverage(call_count: nil, detailed: nil, allow_triggered_updates: nil)
62
+ @devtools.send_cmd('Profiler.startPreciseCoverage',
63
+ callCount: call_count,
64
+ detailed: detailed,
65
+ allowTriggeredUpdates: allow_triggered_updates)
66
+ end
67
+
68
+ def start_type_profile
69
+ @devtools.send_cmd('Profiler.startTypeProfile')
70
+ end
71
+
72
+ def stop
73
+ @devtools.send_cmd('Profiler.stop')
74
+ end
75
+
76
+ def stop_precise_coverage
77
+ @devtools.send_cmd('Profiler.stopPreciseCoverage')
78
+ end
79
+
80
+ def stop_type_profile
81
+ @devtools.send_cmd('Profiler.stopTypeProfile')
82
+ end
83
+
84
+ def take_precise_coverage
85
+ @devtools.send_cmd('Profiler.takePreciseCoverage')
86
+ end
87
+
88
+ def take_type_profile
89
+ @devtools.send_cmd('Profiler.takeTypeProfile')
90
+ end
91
+
92
+ end # Profiler
93
+ end # V100
94
+ end # DevTools
95
+ end # Selenium