Module: SeleniumMonkeypatch

Defined in:
lib/birdsong/monkeypatch.rb

Overview

Defined Under Namespace

Modules: InstanceMethods

Constant Summary collapse

@@logger =
Logger.new(STDOUT)

Class Method Summary collapse

Class Method Details

.apply_patchObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/birdsong/monkeypatch.rb', line 11

def apply_patch
  target_class = find_class
  target_method = find_method(target_class)

  unless target_method
    raise "Could not find class or method when patching Selenium::WebDriver::DevTools.send_cmd"
  end

  @@logger.info "#{__FILE__} is monkeypatching Selenium::WebDriver::DevTools.send_cmd"
  target_class.prepend(InstanceMethods)
end