Class: Capybara::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/screenshot_config.rb

Overview

monkey patching Capybara::Session#save_screenshot

Instance Method Summary collapse

Instance Method Details

#old_save_screenshotObject



20
# File 'lib/capybara/screenshot_config.rb', line 20

alias_method :old_save_screenshot, :save_screenshot

#save_screenshot(path, options = {}) ⇒ Object



22
23
24
25
26
# File 'lib/capybara/screenshot_config.rb', line 22

def save_screenshot(path, options={})
  options = ScreenshotConfig.configuration.options.merge(options)

  old_save_screenshot("#{ScreenshotConfig.configuration.save_dir}/#{path}", options)
end