Building on a previous post about debugging cucumber tests with ruby-debug, here’s a simple cucumber step definition you can use in your cucumber scenario in order to debug it:
Then /^I debug$/ do
breakpoint
0
end
Use it as follows:
Feature: Debug a cucumber scenario
As a test writer
In order to make my life easier
I want to be able to debug
Scenario: Calling the debugger in the middle of a test
Given some condition
Then I debug #this will call the debugger
And I do something subsequent to debugging