Class: Selenium::DevTools::V131::Console
- Inherits:
-
Object
- Object
- Selenium::DevTools::V131::Console
- Defined in:
- lib/selenium/devtools/v131/console.rb
Constant Summary collapse
- EVENTS =
{ message_added: 'messageAdded', }.freeze
Instance Method Summary collapse
- #clear_messages ⇒ Object
- #disable ⇒ Object
- #enable ⇒ Object
-
#initialize(devtools) ⇒ Console
constructor
A new instance of Console.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Console
Returns a new instance of Console.
29 30 31 |
# File 'lib/selenium/devtools/v131/console.rb', line 29 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#clear_messages ⇒ Object
38 39 40 |
# File 'lib/selenium/devtools/v131/console.rb', line 38 def @devtools.send_cmd('Console.clearMessages') end |
#disable ⇒ Object
42 43 44 |
# File 'lib/selenium/devtools/v131/console.rb', line 42 def disable @devtools.send_cmd('Console.disable') end |
#enable ⇒ Object
46 47 48 |
# File 'lib/selenium/devtools/v131/console.rb', line 46 def enable @devtools.send_cmd('Console.enable') end |
#on(event, &block) ⇒ Object
33 34 35 36 |
# File 'lib/selenium/devtools/v131/console.rb', line 33 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Console.#{event}"] << block end |