Method: Capybara::Session#save_and_open_page

Defined in:
lib/capybara/session.rb

#save_and_open_page(file_name = nil) ⇒ Object

Save a snapshot of the page and open it in a browser for inspection

Parameters:

  • path (String)

    The path to where it should be saved [optional]



317
318
319
320
321
322
# File 'lib/capybara/session.rb', line 317

def save_and_open_page(file_name=nil)
  require "launchy"
  Launchy.open(save_page(file_name))
rescue LoadError
  warn "Please install the launchy gem to open page with save_and_open_page"
end