Method: Capybara::Session#save_and_open_screenshot

Defined in:
lib/capybara/session.rb

#save_and_open_screenshot(path = nil, **options) ⇒ Object

Save a screenshot of the page and open it for inspection.

If invoked without arguments it will save file to save_path and file will be given randomly generated filename. If invoked with a relative path the path will be relative to save_path.

Parameters:

  • path (String) (defaults to: nil)

    the path to where it should be saved

  • options (Hash)

    a customizable set of options



762
763
764
# File 'lib/capybara/session.rb', line 762

def save_and_open_screenshot(path = nil, **options)
  save_screenshot(path, **options).tap { |s_path| open_file(s_path) }
end