Skip to main content

Capybara

12th October, 2022

Updated: 12th October, 2022

    Printing the page content in Capybara Capybara is a great integration testing framework that easily replaces Webrat. Plus, it works with Rails 3, which Webrat seems not to do. If you need to print the current page's content, for example to debug your test, you can do so with:

    puts page.body

    This trick is a bit hard to find in the documentation.

    Update: There is also

    save_and_open_page

    which opens the page content in a browser.


    a5c1492e-3490-4205-baee-396cd2f63ab6

    Created on: 12th October, 2022

    Last updated: 12th October, 2022

    Tagged With: