/ cucumber

Quick Tip #1: Debugging Cucumber

Awhile ago I was writing some Cucumber features and I kept running into a failing Scenario that was related to displaying information in the view. So my good friend @remear provided me with a few simple Cucumber steps for debugging such issues.

What he provided follows below:

  Then /^I should see page debug$/ do
    puts page.body
  end
   
  Then /^I should see a "([^"]*)" JS confirm dialog$/ do |msg|
    selenium.get_alert.should eql(msg)
  end
   
  Then /^I should output "([^"]*)"$/ do |string|
    Rails.logger.debug string
  end