Method: Capybara::Session#save_and_open_page

Defined in:
lib/capybara/session.rb

#save_and_open_page(path = nil) ⇒ Object

Save a snapshot of the page and open it in a browser 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



732
733
734
# File 'lib/capybara/session.rb', line 732

def save_and_open_page(path = nil)
  save_page(path).tap { |s_path| open_file(s_path) }
end