Class: Selenium::DevTools::V131::Debugger
- Inherits:
-
Object
- Object
- Selenium::DevTools::V131::Debugger
- Defined in:
- lib/selenium/devtools/v131/debugger.rb
Constant Summary collapse
- EVENTS =
{ breakpoint_resolved: 'breakpointResolved', paused: 'paused', resumed: 'resumed', script_failed_to_parse: 'scriptFailedToParse', script_parsed: 'scriptParsed', }.freeze
Instance Method Summary collapse
- #continue_to_location(location:, target_call_frames: nil) ⇒ Object
- #disable ⇒ Object
- #disassemble_wasm_module(script_id:) ⇒ Object
- #enable(max_scripts_cache_size: nil) ⇒ Object
- #evaluate_on_call_frame(call_frame_id:, expression:, object_group: nil, include_command_line_api: nil, silent: nil, return_by_value: nil, generate_preview: nil, throw_on_side_effect: nil, timeout: nil) ⇒ Object
- #get_possible_breakpoints(start:, _end: nil, restrict_to_function: nil) ⇒ Object
- #get_script_source(script_id:) ⇒ Object
- #get_stack_trace(stack_trace_id:) ⇒ Object
- #get_wasm_bytecode(script_id:) ⇒ Object
-
#initialize(devtools) ⇒ Debugger
constructor
A new instance of Debugger.
- #next_wasm_disassembly_chunk(stream_id:) ⇒ Object
- #on(event, &block) ⇒ Object
- #pause ⇒ Object
- #pause_on_async_call(parent_stack_trace_id:) ⇒ Object
- #remove_breakpoint(breakpoint_id:) ⇒ Object
- #restart_frame(call_frame_id:, mode: nil) ⇒ Object
- #resume(terminate_on_resume: nil) ⇒ Object
- #search_in_content(script_id:, query:, case_sensitive: nil, is_regex: nil) ⇒ Object
- #set_async_call_stack_depth(max_depth:) ⇒ Object
- #set_blackbox_execution_contexts(unique_ids:) ⇒ Object
- #set_blackbox_patterns(patterns:, skip_anonymous: nil) ⇒ Object
- #set_blackboxed_ranges(script_id:, positions:) ⇒ Object
- #set_breakpoint(location:, condition: nil) ⇒ Object
- #set_breakpoint_by_url(line_number:, url: nil, url_regex: nil, script_hash: nil, column_number: nil, condition: nil) ⇒ Object
- #set_breakpoint_on_function_call(object_id:, condition: nil) ⇒ Object
- #set_breakpoints_active(active:) ⇒ Object
- #set_instrumentation_breakpoint(instrumentation:) ⇒ Object
- #set_pause_on_exceptions(state:) ⇒ Object
- #set_return_value(new_value:) ⇒ Object
- #set_script_source(script_id:, script_source:, dry_run: nil, allow_top_frame_editing: nil) ⇒ Object
- #set_skip_all_pauses(skip:) ⇒ Object
- #set_variable_value(scope_number:, variable_name:, new_value:, call_frame_id:) ⇒ Object
- #step_into(break_on_async_call: nil, skip_list: nil) ⇒ Object
- #step_out ⇒ Object
- #step_over(skip_list: nil) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Debugger
Returns a new instance of Debugger.
33 34 35 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 33 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#continue_to_location(location:, target_call_frames: nil) ⇒ Object
42 43 44 45 46 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 42 def continue_to_location(location:, target_call_frames: nil) @devtools.send_cmd('Debugger.continueToLocation', location: location, targetCallFrames: target_call_frames) end |
#disable ⇒ Object
48 49 50 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 48 def disable @devtools.send_cmd('Debugger.disable') end |
#disassemble_wasm_module(script_id:) ⇒ Object
82 83 84 85 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 82 def disassemble_wasm_module(script_id:) @devtools.send_cmd('Debugger.disassembleWasmModule', scriptId: script_id) end |
#enable(max_scripts_cache_size: nil) ⇒ Object
52 53 54 55 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 52 def enable(max_scripts_cache_size: nil) @devtools.send_cmd('Debugger.enable', maxScriptsCacheSize: max_scripts_cache_size) end |
#evaluate_on_call_frame(call_frame_id:, expression:, object_group: nil, include_command_line_api: nil, silent: nil, return_by_value: nil, generate_preview: nil, throw_on_side_effect: nil, timeout: nil) ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 57 def evaluate_on_call_frame(call_frame_id:, expression:, object_group: nil, include_command_line_api: nil, silent: nil, return_by_value: nil, generate_preview: nil, throw_on_side_effect: nil, timeout: nil) @devtools.send_cmd('Debugger.evaluateOnCallFrame', callFrameId: call_frame_id, expression: expression, objectGroup: object_group, includeCommandLineAPI: include_command_line_api, silent: silent, returnByValue: return_by_value, generatePreview: generate_preview, throwOnSideEffect: throw_on_side_effect, timeout: timeout) end |
#get_possible_breakpoints(start:, _end: nil, restrict_to_function: nil) ⇒ Object
70 71 72 73 74 75 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 70 def get_possible_breakpoints(start:, _end: nil, restrict_to_function: nil) @devtools.send_cmd('Debugger.getPossibleBreakpoints', start: start, end: _end, restrictToFunction: restrict_to_function) end |
#get_script_source(script_id:) ⇒ Object
77 78 79 80 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 77 def get_script_source(script_id:) @devtools.send_cmd('Debugger.getScriptSource', scriptId: script_id) end |
#get_stack_trace(stack_trace_id:) ⇒ Object
97 98 99 100 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 97 def get_stack_trace(stack_trace_id:) @devtools.send_cmd('Debugger.getStackTrace', stackTraceId: stack_trace_id) end |
#get_wasm_bytecode(script_id:) ⇒ Object
92 93 94 95 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 92 def get_wasm_bytecode(script_id:) @devtools.send_cmd('Debugger.getWasmBytecode', scriptId: script_id) end |
#next_wasm_disassembly_chunk(stream_id:) ⇒ Object
87 88 89 90 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 87 def next_wasm_disassembly_chunk(stream_id:) @devtools.send_cmd('Debugger.nextWasmDisassemblyChunk', streamId: stream_id) end |
#on(event, &block) ⇒ Object
37 38 39 40 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 37 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Debugger.#{event}"] << block end |
#pause ⇒ Object
102 103 104 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 102 def pause @devtools.send_cmd('Debugger.pause') end |
#pause_on_async_call(parent_stack_trace_id:) ⇒ Object
106 107 108 109 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 106 def pause_on_async_call(parent_stack_trace_id:) @devtools.send_cmd('Debugger.pauseOnAsyncCall', parentStackTraceId: parent_stack_trace_id) end |
#remove_breakpoint(breakpoint_id:) ⇒ Object
111 112 113 114 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 111 def remove_breakpoint(breakpoint_id:) @devtools.send_cmd('Debugger.removeBreakpoint', breakpointId: breakpoint_id) end |
#restart_frame(call_frame_id:, mode: nil) ⇒ Object
116 117 118 119 120 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 116 def restart_frame(call_frame_id:, mode: nil) @devtools.send_cmd('Debugger.restartFrame', callFrameId: call_frame_id, mode: mode) end |
#resume(terminate_on_resume: nil) ⇒ Object
122 123 124 125 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 122 def resume(terminate_on_resume: nil) @devtools.send_cmd('Debugger.resume', terminateOnResume: terminate_on_resume) end |
#search_in_content(script_id:, query:, case_sensitive: nil, is_regex: nil) ⇒ Object
127 128 129 130 131 132 133 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 127 def search_in_content(script_id:, query:, case_sensitive: nil, is_regex: nil) @devtools.send_cmd('Debugger.searchInContent', scriptId: script_id, query: query, caseSensitive: case_sensitive, isRegex: is_regex) end |
#set_async_call_stack_depth(max_depth:) ⇒ Object
135 136 137 138 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 135 def set_async_call_stack_depth(max_depth:) @devtools.send_cmd('Debugger.setAsyncCallStackDepth', maxDepth: max_depth) end |
#set_blackbox_execution_contexts(unique_ids:) ⇒ Object
140 141 142 143 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 140 def set_blackbox_execution_contexts(unique_ids:) @devtools.send_cmd('Debugger.setBlackboxExecutionContexts', uniqueIds: unique_ids) end |
#set_blackbox_patterns(patterns:, skip_anonymous: nil) ⇒ Object
145 146 147 148 149 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 145 def set_blackbox_patterns(patterns:, skip_anonymous: nil) @devtools.send_cmd('Debugger.setBlackboxPatterns', patterns: patterns, skipAnonymous: skip_anonymous) end |
#set_blackboxed_ranges(script_id:, positions:) ⇒ Object
151 152 153 154 155 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 151 def set_blackboxed_ranges(script_id:, positions:) @devtools.send_cmd('Debugger.setBlackboxedRanges', scriptId: script_id, positions: positions) end |
#set_breakpoint(location:, condition: nil) ⇒ Object
157 158 159 160 161 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 157 def set_breakpoint(location:, condition: nil) @devtools.send_cmd('Debugger.setBreakpoint', location: location, condition: condition) end |
#set_breakpoint_by_url(line_number:, url: nil, url_regex: nil, script_hash: nil, column_number: nil, condition: nil) ⇒ Object
168 169 170 171 172 173 174 175 176 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 168 def set_breakpoint_by_url(line_number:, url: nil, url_regex: nil, script_hash: nil, column_number: nil, condition: nil) @devtools.send_cmd('Debugger.setBreakpointByUrl', lineNumber: line_number, url: url, urlRegex: url_regex, scriptHash: script_hash, columnNumber: column_number, condition: condition) end |
#set_breakpoint_on_function_call(object_id:, condition: nil) ⇒ Object
178 179 180 181 182 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 178 def set_breakpoint_on_function_call(object_id:, condition: nil) @devtools.send_cmd('Debugger.setBreakpointOnFunctionCall', objectId: object_id, condition: condition) end |
#set_breakpoints_active(active:) ⇒ Object
184 185 186 187 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 184 def set_breakpoints_active(active:) @devtools.send_cmd('Debugger.setBreakpointsActive', active: active) end |
#set_instrumentation_breakpoint(instrumentation:) ⇒ Object
163 164 165 166 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 163 def set_instrumentation_breakpoint(instrumentation:) @devtools.send_cmd('Debugger.setInstrumentationBreakpoint', instrumentation: instrumentation) end |
#set_pause_on_exceptions(state:) ⇒ Object
189 190 191 192 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 189 def set_pause_on_exceptions(state:) @devtools.send_cmd('Debugger.setPauseOnExceptions', state: state) end |
#set_return_value(new_value:) ⇒ Object
194 195 196 197 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 194 def set_return_value(new_value:) @devtools.send_cmd('Debugger.setReturnValue', newValue: new_value) end |
#set_script_source(script_id:, script_source:, dry_run: nil, allow_top_frame_editing: nil) ⇒ Object
199 200 201 202 203 204 205 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 199 def set_script_source(script_id:, script_source:, dry_run: nil, allow_top_frame_editing: nil) @devtools.send_cmd('Debugger.setScriptSource', scriptId: script_id, scriptSource: script_source, dryRun: dry_run, allowTopFrameEditing: allow_top_frame_editing) end |
#set_skip_all_pauses(skip:) ⇒ Object
207 208 209 210 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 207 def set_skip_all_pauses(skip:) @devtools.send_cmd('Debugger.setSkipAllPauses', skip: skip) end |
#set_variable_value(scope_number:, variable_name:, new_value:, call_frame_id:) ⇒ Object
212 213 214 215 216 217 218 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 212 def set_variable_value(scope_number:, variable_name:, new_value:, call_frame_id:) @devtools.send_cmd('Debugger.setVariableValue', scopeNumber: scope_number, variableName: variable_name, newValue: new_value, callFrameId: call_frame_id) end |
#step_into(break_on_async_call: nil, skip_list: nil) ⇒ Object
220 221 222 223 224 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 220 def step_into(break_on_async_call: nil, skip_list: nil) @devtools.send_cmd('Debugger.stepInto', breakOnAsyncCall: break_on_async_call, skipList: skip_list) end |
#step_out ⇒ Object
226 227 228 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 226 def step_out @devtools.send_cmd('Debugger.stepOut') end |
#step_over(skip_list: nil) ⇒ Object
230 231 232 233 |
# File 'lib/selenium/devtools/v131/debugger.rb', line 230 def step_over(skip_list: nil) @devtools.send_cmd('Debugger.stepOver', skipList: skip_list) end |