Tim Riley

Show Me the Page!

August 6th 2009 — Canberra, Australia

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.

Tim Riley

Hi, I'm Tim Riley. I'm a web developer based in Canberra, Australia, where I work at a small design studio called Icelab. This is my blog, where I can share with you the things I learn as I go about building products for the web.

What I Build

Recent Presentations

  1. Facebook Authentication with OAuth
  2. JavaScript Testing with Capybara and Cucumber
  3. Using Titanium to Build Mobile Apps with JavaScript (audio)
  4. An Introduction to Sinatra
  5. Building your Capistrano Recipe Book