blah blah woof woof

Show Me the Page!

Tim Riley 2009.08.06

Get this in your Cucumber steps.

Then /^show me the page$/ do
  save_and_open_page
end

Thanks to the magic of webrat’s lesser known save_and_open_page, this will save the current page to a temporary file and open it in your browser. Be sure to gem install launchy for it to work.

Here’s a sample of show me the page in a scenario:

Scenario: Signing in
  When I go to the home page
  And I fill in "username" with "john"
  And I fill in "password" with "john"
  Then show me the page

Very useful for debugging.

Want More?

Previous Article

  1. 2009.07.25 Machinist and Paperclip

Next Article

  1. 2009.09.02 Decaf Sucks, and a Rails Rumble Redux