Class: Selenium::DevTools::V150::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v150/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.



30
31
32
# File 'lib/selenium/devtools/v150/log.rb', line 30

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#clearObject



39
40
41
# File 'lib/selenium/devtools/v150/log.rb', line 39

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

#disableObject



43
44
45
# File 'lib/selenium/devtools/v150/log.rb', line 43

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

#enableObject



47
48
49
# File 'lib/selenium/devtools/v150/log.rb', line 47

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

#on(event, &block) ⇒ Object



34
35
36
37
# File 'lib/selenium/devtools/v150/log.rb', line 34

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

#start_violations_report(config:) ⇒ Object



51
52
53
54
# File 'lib/selenium/devtools/v150/log.rb', line 51

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

#stop_violations_reportObject



56
57
58
# File 'lib/selenium/devtools/v150/log.rb', line 56

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