Class: Selenium::DevTools::V128::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v128/log.rb

Constant Summary collapse

EVENTS =
{
  entry_added: 'entryAdded',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Log

Returns a new instance of Log.



29
30
31
# File 'lib/selenium/devtools/v128/log.rb', line 29

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#clearObject



38
39
40
# File 'lib/selenium/devtools/v128/log.rb', line 38

def clear
  @devtools.send_cmd('Log.clear')
end

#disableObject



42
43
44
# File 'lib/selenium/devtools/v128/log.rb', line 42

def disable
  @devtools.send_cmd('Log.disable')
end

#enableObject



46
47
48
# File 'lib/selenium/devtools/v128/log.rb', line 46

def enable
  @devtools.send_cmd('Log.enable')
end

#on(event, &block) ⇒ Object



33
34
35
36
# File 'lib/selenium/devtools/v128/log.rb', line 33

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["Log.#{event}"] << block
end

#start_violations_report(config:) ⇒ Object



50
51
52
53
# File 'lib/selenium/devtools/v128/log.rb', line 50

def start_violations_report(config:)
  @devtools.send_cmd('Log.startViolationsReport',
                     config: config)
end

#stop_violations_reportObject



55
56
57
# File 'lib/selenium/devtools/v128/log.rb', line 55

def stop_violations_report
  @devtools.send_cmd('Log.stopViolationsReport')
end