bernerdschaefer / akephalos

Headless HTMLUnit powered browser for Capybara
bernerdschaefer.github.com/akephalos
MIT License
338 stars 50 forks source link

how to debug inside a step definition? #54

Open gduquesnay opened 13 years ago

gduquesnay commented 13 years ago

When I put a 'debugger' statement inside a step definition and run cucumber. I get dropped into a debug session but can't type anything. If I do "Ctrl-C" I can type but page.body gives exceptions like "DRb::DRbConnError Exception: druby://127.0.0.1:44537 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>".

How do I debug?

phillipkoebbe commented 13 years ago

I can type, but many keystrokes don't get picked up. It usually takes pressing the same key about 4 times before it registers. For example, if I want to "puts page.body", I have to type

ppppuuuuttttssss[space][space][space][space]ppppaaaaggggeeee....bbbbooooddddyyyy[return][return][return][return]

Again, those don't all show up, but I have to type like that to get things recognized. It's quite a hassle. I cringe any time I discover I have to debug in Akephalos. This is one of few complaints from me. I can do a screen recording if it will help.

jrafanie commented 13 years ago

Have you tried doing something like this instead of running with a debugger? http://railsdog.com/blog/2011/02/22/cucumber-testing-tips/

I enhanced this idea to use provide access to the current page through akephalos. See my example here: https://gist.github.com/1203731

phillipkoebbe commented 13 years ago

Thanks for the information, jrafanie. I will definitely look into it. I'll have to change my work flow a bit, but that's not always a bad thing :)