Sha256: b97902b44918697dc031bc8b71deaf7caa07850679f8b2f914f5f683c9567bfb
Contents?: true
Size: 695 Bytes
Versions: 7
Compression:
Stored size: 695 Bytes
Contents
require 'capybara/session' module Capybara class Session SAVE_SCREENSHOT_METHODS = [ :click_button, :click_link, :click_link_or_button, :click_on, :fill_in, :choose, :check, :uncheck, :select, :unselect, :attach_file, :execute_script, :go_back, :go_forward, :switch_to_window, :visit ] SAVE_SCREENSHOT_METHODS.each do |method| alias_method "after_hook_#{method}".to_sym, method define_method method do |*args, &block| Gnawrnip.photographer.take_shot if current_url != 'about:blank' send("after_hook_#{method}", *args, &block) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems